From acbe9ad9e519b04c1904814c38869629af4ee59c Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Thu, 27 Dec 2018 09:58:53 -0800 Subject: [PATCH] Upgrading vendor folder dependencies. --- Gopkg.lock | 16 +- .../git.apache.org/thrift.git/.eslintignore | 9 + .../git.apache.org/thrift.git/.eslintrc.json | 24 + .../thrift.git/.github/stale.yml | 59 + vendor/git.apache.org/thrift.git/.gitignore | 9 + .../git.apache.org/thrift.git/.rustfmt.toml | 69 +- vendor/git.apache.org/thrift.git/CHANGES | 253 +- vendor/git.apache.org/thrift.git/LANGUAGES.md | 15 +- vendor/git.apache.org/thrift.git/Makefile.am | 2 +- .../thrift.git/Thrift-swift3.podspec | 10 +- .../git.apache.org/thrift.git/Thrift.podspec | 10 +- .../thrift.git/aclocal/ax_boost_base.m4 | 6 +- .../aclocal/ax_cxx_compile_stdcxx.m4 | 42 +- vendor/git.apache.org/thrift.git/appveyor.yml | 4 +- vendor/git.apache.org/thrift.git/bower.json | 1 + .../build/appveyor/MSVC-appveyor-build.bat | 3 - .../build/appveyor/MSVC-appveyor-install.bat | 15 +- .../thrift.git/build/appveyor/cl_setenv.bat | 1 - .../thrift.git/build/appveyor/cl_showenv.bat | 1 - .../build/cmake/DefineCMakeDefaults.cmake | 2 +- .../build/cmake/DefinePlatformSpecifc.cmake | 3 - .../thrift.git/build/docker/scripts/sca.sh | 2 +- .../build/docker/ubuntu-bionic/Dockerfile | 10 +- .../thrift.git/compiler/cpp/CMakeLists.txt | 2 +- .../src/thrift/generate/t_csharp_generator.cc | 78 +- .../cpp/src/thrift/generate/t_go_generator.cc | 4 +- .../src/thrift/generate/t_java_generator.cc | 10 + .../cpp/src/thrift/generate/t_js_generator.cc | 569 ++- .../src/thrift/generate/t_perl_generator.cc | 20 +- .../cpp/src/thrift/generate/t_py_generator.cc | 6 +- .../cpp/src/thrift/generate/t_rs_generator.cc | 89 +- .../git.apache.org/thrift.git/composer.json | 8 +- vendor/git.apache.org/thrift.git/configure.ac | 20 +- .../contrib/Rebus/Properties/AssemblyInfo.cs | 4 +- .../thrift.git/contrib/fb303/py/setup.py | 2 +- .../contrib/thrift-maven-plugin/pom.xml | 2 +- .../thrift.git/contrib/thrift.spec | 2 +- .../contrib/zeromq/csharp/ThriftZMQ.csproj | 4 +- .../thrift.git/debian/changelog | 26 +- vendor/git.apache.org/thrift.git/doap.rdf | 10 + .../git.apache.org/thrift.git/lib/Makefile.am | 1 + .../thrift/c_glib/protocol/thrift_protocol.c | 12 +- .../thrift.git/lib/cocoa/src/Thrift.h | 2 +- .../thrift.git/lib/cpp/libthrift.vcxproj | 9 +- .../cpp/src/thrift/protocol/TJSONProtocol.cpp | 4 +- .../cpp/src/thrift/qt/TQIODeviceTransport.cpp | 2 +- .../src/thrift/transport/TBufferTransports.h | 2 +- .../src/thrift/transport/TFileTransport.cpp | 5 +- .../src/thrift/transport/THeaderTransport.cpp | 2 +- .../cpp/src/thrift/transport/TSocketPool.cpp | 11 +- .../lib/cpp/test/TMemoryBufferTest.cpp | 2 +- .../Properties/AssemblyInfo.cs | 4 +- .../ThriftMSBuildTask.csproj | 4 +- .../lib/csharp/src/Properties/AssemblyInfo.cs | 4 +- .../thrift.git/lib/csharp/src/Thrift.csproj | 4 +- .../src/Transport/TBufferedTransport.cs | 27 +- .../csharp/src/Transport/TFramedTransport.cs | 21 +- .../Multiplex/Client/MultiplexClient.csproj | 4 +- .../Client/Properties/AssemblyInfo.cs | 4 +- .../Multiplex/Server/MultiplexServer.csproj | 4 +- .../Server/Properties/AssemblyInfo.cs | 4 +- .../ThriftMVCTest/Properties/AssemblyInfo.cs | 4 +- .../thrift.git/lib/d/src/thrift/base.d | 2 +- .../thrift.git/lib/d/test/client_pool_test.d | 42 +- .../thrift.git/lib/dart/pubspec.yaml | 2 +- .../thrift.git/lib/delphi/src/Thrift.pas | 2 +- .../thrift.git/lib/go/README.md | 2 +- .../lib/go/thrift/serializer_types_test.go | 2 +- .../thrift.git/lib/go/thrift/server_socket.go | 15 +- .../thrift.git/lib/haxe/README.md | 4 +- .../thrift.git/lib/haxe/haxelib.json | 2 +- .../thrift.git/lib/hs/Thrift.cabal | 8 +- .../thrift.git/lib/java/gradle.properties | 4 +- .../thrift.git/lib/js/Gruntfile.js | 42 +- .../thrift.git/lib/js/package-lock.json | 3094 +++++++++++++---- .../thrift.git/lib/js/package.json | 2 +- .../thrift.git/lib/js/src/thrift.js | 2 +- .../thrift.git/lib/lua/THttpTransport.lua | 2 +- .../thrift.git/lib/lua/Thrift.lua | 2 +- .../netcore/Thrift/Properties/AssemblyInfo.cs | 4 +- .../Transports/Client/THttpClientTransport.cs | 4 +- .../thrift.git/lib/nodejs/Makefile.am | 3 +- .../lib/nodejs/lib/thrift/json_protocol.js | 1 - .../thrift.git/lib/nodejs/test/binary.test.js | 143 +- .../thrift.git/lib/nodejs/test/client.js | 138 +- .../lib/nodejs/test/deep-constructor.test.js | 316 +- .../thrift.git/lib/nodejs/test/exceptions.js | 166 +- .../thrift.git/lib/nodejs/test/helpers.js | 19 +- .../thrift.git/lib/nodejs/test/server.js | 121 +- .../thrift.git/lib/nodejs/test/test-cases.js | 227 +- .../thrift.git/lib/nodejs/test/testAll.sh | 24 +- .../thrift.git/lib/nodejs/test/test_driver.js | 409 ++- .../lib/nodejs/test/test_handler.js | 129 +- .../thrift.git/lib/nodets/.gitignore | 1 + .../thrift.git/lib/nodets/Makefile.am | 45 + .../thrift.git/lib/nodets/coding_standards.md | 1 + .../thrift.git/lib/nodets/test/client.ts | 63 + .../thrift.git/lib/nodets/test/runClient.sh | 18 + .../thrift.git/lib/nodets/test/runServer.sh | 20 + .../thrift.git/lib/nodets/test/server.ts | 26 + .../thrift.git/lib/nodets/test/test-cases.ts | 113 + .../thrift.git/lib/nodets/test/testAll.sh | 38 + .../thrift.git/lib/nodets/test/test_driver.ts | 278 ++ .../lib/nodets/test/test_handler.ts | 299 ++ .../thrift.git/lib/nodets/test/tsconfig.json | 22 + .../thrift.git/lib/ocaml/_oasis | 2 +- .../thrift.git/lib/perl/lib/Thrift.pm | 2 +- .../lib/perl/lib/Thrift/BinaryProtocol.pm | 20 +- .../lib/perl/lib/Thrift/Exception.pm | 15 +- .../lib/perl/lib/Thrift/FramedTransport.pm | 2 +- .../lib/perl/lib/Thrift/HttpClient.pm | 33 +- .../lib/perl/lib/Thrift/MemoryBuffer.pm | 10 +- .../perl/lib/Thrift/MultiplexedProcessor.pm | 14 +- .../perl/lib/Thrift/MultiplexedProtocol.pm | 2 +- .../lib/perl/lib/Thrift/Protocol.pm | 108 +- .../lib/perl/lib/Thrift/SSLServerSocket.pm | 2 +- .../lib/perl/lib/Thrift/SSLSocket.pm | 2 +- .../thrift.git/lib/perl/lib/Thrift/Server.pm | 39 +- .../lib/perl/lib/Thrift/ServerSocket.pm | 17 +- .../thrift.git/lib/perl/lib/Thrift/Socket.pm | 22 +- .../lib/perl/lib/Thrift/Transport.pm | 16 +- .../lib/perl/lib/Thrift/UnixServerSocket.pm | 8 +- .../lib/perl/lib/Thrift/UnixSocket.pm | 4 +- .../thrift.git/lib/php/lib/Base/TBase.php | 2 +- .../lib/Exception/TApplicationException.php | 2 +- .../lib/php/lib/Exception/TException.php | 2 +- .../lib/php/lib/Transport/TCurlClient.php | 18 + .../lib/php/lib/Transport/THttpClient.php | 25 +- .../thrift_protocol/php_thrift_protocol.cpp | 4 +- .../git.apache.org/thrift.git/lib/py/setup.py | 2 +- .../thrift.git/lib/py/src/ext/protocol.h | 4 +- .../thrift.git/lib/py/src/ext/protocol.tcc | 20 +- .../lib/py/src/transport/TSocket.py | 11 +- .../thrift.git/lib/rb/thrift.gemspec | 2 +- .../thrift.git/lib/rs/Cargo.toml | 2 +- .../thrift.git/lib/rs/README.md | 51 + .../thrift.git/lib/rs/src/errors.rs | 158 +- .../thrift.git/lib/rs/src/lib.rs | 12 +- .../thrift.git/lib/rs/src/protocol/binary.rs | 290 +- .../thrift.git/lib/rs/src/protocol/compact.rs | 199 +- .../thrift.git/lib/rs/src/protocol/mod.rs | 142 +- .../lib/rs/src/protocol/multiplexed.rs | 14 +- .../thrift.git/lib/rs/src/protocol/stored.rs | 20 +- .../thrift.git/lib/rs/src/server/mod.rs | 2 +- .../lib/rs/src/server/multiplexed.rs | 73 +- .../thrift.git/lib/rs/src/server/threaded.rs | 34 +- .../lib/rs/src/transport/buffered.rs | 5 +- .../thrift.git/lib/rs/src/transport/framed.rs | 57 +- .../thrift.git/lib/rs/src/transport/mem.rs | 58 +- .../thrift.git/lib/rs/src/transport/mod.rs | 63 +- .../thrift.git/lib/rs/src/transport/socket.rs | 51 +- .../rs/test/src/bin/kitchen_sink_client.rs | 205 +- .../rs/test/src/bin/kitchen_sink_server.rs | 125 +- .../lib/rs/test/thrifts/Base_One.thrift | 3 + .../lib/rs/test/thrifts/Base_Two.thrift | 6 + .../lib/rs/test/thrifts/Midlayer.thrift | 9 + .../lib/rs/test/thrifts/Ultimate.thrift | 17 + .../thrift.git/lib/st/package.xml | 2 +- .../thrift.git/package-lock.json | 1839 +++++++--- vendor/git.apache.org/thrift.git/package.json | 17 +- .../thrift.git/sonar-project.properties | 6 +- .../thrift.git/test/ThriftTest.thrift | 2 +- .../thrift.git/test/cpp/src/TestClient.cpp | 8 +- .../thrift.git/test/crossrunner/run.py | 8 +- .../test/csharp/Properties/AssemblyInfo.cs | 4 +- .../thrift.git/test/csharp/ThriftTest.csproj | 4 +- .../test/dart/test_client/pubspec.yaml | 2 +- .../test/erl/src/thrift_test.app.src | 2 +- .../thrift.git/test/known_failures_Linux.json | 2 + .../thrift.git/test/perl/TestClient.pl | 173 +- .../thrift.git/test/perl/TestServer.pl | 227 +- .../thrift.git/test/rs/src/bin/test_client.rs | 14 +- .../thrift.git/test/rs/src/bin/test_server.rs | 6 +- .../git.apache.org/thrift.git/test/tests.json | 27 + .../thrift.git/tutorial/cl/Makefile.am | 36 +- .../tutorial/cl/ensure-externals.sh | 1 + .../thrift.git/tutorial/cl/load-locally.lisp | 22 + .../tutorial/cl/make-tutorial-client.lisp | 2 +- .../tutorial/cl/make-tutorial-server.lisp | 2 +- .../CsharpClient/Properties/AssemblyInfo.cs | 4 +- .../CsharpServer/Properties/AssemblyInfo.cs | 4 +- .../tutorial/dart/client/pubspec.yaml | 2 +- .../tutorial/dart/console_client/pubspec.yaml | 2 +- .../tutorial/dart/server/pubspec.yaml | 2 +- .../delphi/DelphiClient/DelphiClient.dproj | 6 +- .../delphi/DelphiServer/DelphiServer.dproj | 6 +- .../thrift.git/tutorial/go/Makefile.am | 8 +- .../thrift.git/tutorial/go/src/client.go | 2 +- .../thrift.git/tutorial/go/src/main.go | 2 +- .../thrift.git/tutorial/go/src/server.go | 2 +- .../tutorial/hs/ThriftTutorial.cabal | 2 +- .../thrift.git/tutorial/ocaml/_oasis | 2 +- .../thrift.git/tutorial/perl/PerlClient.pl | 12 +- .../thrift.git/tutorial/perl/PerlServer.pl | 16 +- .../tutorial/rs/src/bin/tutorial_client.rs | 13 +- .../tutorial/rs/src/bin/tutorial_server.rs | 41 +- vendor/github.com/davecgh/go-spew/.travis.yml | 28 +- vendor/github.com/davecgh/go-spew/LICENSE | 2 +- vendor/github.com/davecgh/go-spew/README.md | 12 +- .../github.com/davecgh/go-spew/spew/bypass.go | 187 +- .../davecgh/go-spew/spew/bypasssafe.go | 2 +- .../github.com/davecgh/go-spew/spew/common.go | 2 +- .../github.com/davecgh/go-spew/spew/dump.go | 10 +- .../davecgh/go-spew/spew/dump_test.go | 2 +- .../davecgh/go-spew/spew/dumpcgo_test.go | 6 +- .../github.com/davecgh/go-spew/spew/format.go | 4 +- .../davecgh/go-spew/spew/format_test.go | 6 +- .../davecgh/go-spew/spew/internal_test.go | 5 +- .../go-spew/spew/internalunsafe_test.go | 11 +- .../github.com/stretchr/testify/.travis.yml | 8 +- vendor/github.com/stretchr/testify/Gopkg.lock | 8 +- vendor/github.com/stretchr/testify/Gopkg.toml | 36 +- vendor/github.com/stretchr/testify/README.md | 55 +- .../testify/assert/assertion_format.go | 201 +- .../testify/assert/assertion_format.go.tmpl | 1 + .../testify/assert/assertion_forward.go | 402 ++- .../testify/assert/assertion_forward.go.tmpl | 1 + .../stretchr/testify/assert/assertions.go | 280 +- .../testify/assert/assertions_test.go | 216 +- .../testify/assert/http_assertions.go | 22 +- .../testify/assert/http_assertions_test.go | 29 + .../github.com/stretchr/testify/mock/mock.go | 129 +- .../stretchr/testify/mock/mock_test.go | 167 +- .../stretchr/testify/require/require.go | 852 +++-- .../stretchr/testify/require/require.go.tmpl | 6 +- .../testify/require/require_forward.go | 402 ++- .../testify/require/require_forward.go.tmpl | 1 + .../stretchr/testify/require/requirements.go | 20 + .../testify/require/requirements_test.go | 197 ++ 229 files changed, 10735 insertions(+), 4528 deletions(-) create mode 100644 vendor/git.apache.org/thrift.git/.eslintignore create mode 100644 vendor/git.apache.org/thrift.git/.eslintrc.json create mode 100644 vendor/git.apache.org/thrift.git/.github/stale.yml create mode 100644 vendor/git.apache.org/thrift.git/lib/nodets/.gitignore create mode 100755 vendor/git.apache.org/thrift.git/lib/nodets/Makefile.am create mode 100644 vendor/git.apache.org/thrift.git/lib/nodets/coding_standards.md create mode 100644 vendor/git.apache.org/thrift.git/lib/nodets/test/client.ts create mode 100755 vendor/git.apache.org/thrift.git/lib/nodets/test/runClient.sh create mode 100755 vendor/git.apache.org/thrift.git/lib/nodets/test/runServer.sh create mode 100644 vendor/git.apache.org/thrift.git/lib/nodets/test/server.ts create mode 100644 vendor/git.apache.org/thrift.git/lib/nodets/test/test-cases.ts create mode 100755 vendor/git.apache.org/thrift.git/lib/nodets/test/testAll.sh create mode 100644 vendor/git.apache.org/thrift.git/lib/nodets/test/test_driver.ts create mode 100644 vendor/git.apache.org/thrift.git/lib/nodets/test/test_handler.ts create mode 100644 vendor/git.apache.org/thrift.git/lib/nodets/test/tsconfig.json create mode 120000 vendor/git.apache.org/thrift.git/tutorial/cl/ensure-externals.sh create mode 100644 vendor/git.apache.org/thrift.git/tutorial/cl/load-locally.lisp diff --git a/Gopkg.lock b/Gopkg.lock index e130308..6ee9813 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,19 +3,19 @@ [[projects]] branch = "0.12.0" - digest = "1:0d6d7a897b900dd5924e36bfa05dea429d7049b4b0b87bd3f93cb5f0acc35a21" + digest = "1:89696c38cec777120b8b1bb5e2d363d655cf2e1e7d8c851919aaa0fd576d9b86" name = "git.apache.org/thrift.git" packages = ["lib/go/thrift"] pruneopts = "" - revision = "5c1ecb67cde4d9aff7ed3188ab11566184b27bf0" + revision = "384647d290e2e4a55a14b1b7ef1b7e66293a2c33" [[projects]] - digest = "1:56c130d885a4aacae1dd9c7b71cfe39912c7ebc1ff7d2b46083c8812996dc43b" + digest = "1:0deddd908b6b4b768cfc272c16ee61e7088a60f7fe2f06c547bd3d8e1f8b8e77" name = "github.com/davecgh/go-spew" packages = ["spew"] pruneopts = "" - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" + revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" + version = "v1.1.1" [[projects]] digest = "1:df48fb76fb2a40edea0c9b3d960bc95e326660d82ff1114e1f88001f7a236b40" @@ -40,12 +40,12 @@ revision = "471cd4e61d7a78ece1791fa5faa0345dc8c7d5a5" [[projects]] - digest = "1:2d0dc026c4aef5e2f3a0e06a4dabe268b840d8f63190cf6894e02134a03f52c5" + digest = "1:c587772fb8ad29ad4db67575dad25ba17a51f072ff18a22b4f0257a4d9c24f75" name = "github.com/stretchr/testify" packages = ["assert"] pruneopts = "" - revision = "b91bfb9ebec76498946beb6af7c0230c7cc7ba6c" - version = "v1.2.0" + revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" + version = "v1.2.2" [solve-meta] analyzer-name = "dep" diff --git a/vendor/git.apache.org/thrift.git/.eslintignore b/vendor/git.apache.org/thrift.git/.eslintignore new file mode 100644 index 0000000..dde2dba --- /dev/null +++ b/vendor/git.apache.org/thrift.git/.eslintignore @@ -0,0 +1,9 @@ +# TODO: Use eslint on js lib and generated code + +# Ignore lib/js for now, which uses jshint currently +lib/js/* +# Ignore all generated code for now +**/gen-* + +# Don't lint nested node_modules +**/node_modules diff --git a/vendor/git.apache.org/thrift.git/.eslintrc.json b/vendor/git.apache.org/thrift.git/.eslintrc.json new file mode 100644 index 0000000..0aae820 --- /dev/null +++ b/vendor/git.apache.org/thrift.git/.eslintrc.json @@ -0,0 +1,24 @@ +{ + "env": { + "es6": true, + "node": true + }, + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended" + ], + "parserOptions": { + "ecmaVersion": 2017 + }, + "rules": { + "no-console": "off", + "no-var": "error", + "prefer-const": "error", + "no-constant-condition": [ + "error", + { + "checkLoops": false + } + ] + } +} diff --git a/vendor/git.apache.org/thrift.git/.github/stale.yml b/vendor/git.apache.org/thrift.git/.github/stale.yml new file mode 100644 index 0000000..12d4afb --- /dev/null +++ b/vendor/git.apache.org/thrift.git/.github/stale.yml @@ -0,0 +1,59 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 60 + +# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. +# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. +daysUntilClose: 7 + +# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable +exemptLabels: + - Do Not Merge + - blocked + - pinned + - security + - "[Status] Maybe Later" + +# Set to true to ignore issues in a project (defaults to false) +exemptProjects: false + +# Set to true to ignore issues in a milestone (defaults to false) +exemptMilestones: false + +# Label to use when marking as stale +staleLabel: wontfix + +# Comment to post when marking as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed in 7 days if no further activity occurs. + Thank you for your contributions. + +# Comment to post when removing the stale label. +unmarkComment: > + This issue is no longer stale. + Thank you for your contributions. + +# Comment to post when closing a stale Issue or Pull Request. +closeComment: > + This issue has been automatically closed due to inactivity. + Thank you for your contributions. + +# Limit the number of actions per hour, from 1-30. Default is 30 +limitPerRun: 30 + +# Limit to only `issues` or `pulls` +# only: issues + +# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': +# pulls: +# daysUntilStale: 30 +# markComment: > +# This pull request has been automatically marked as stale because it has not had +# recent activity. It will be closed if no further activity occurs. Thank you +# for your contributions. + +# issues: +# exemptLabels: +# - confirmed diff --git a/vendor/git.apache.org/thrift.git/.gitignore b/vendor/git.apache.org/thrift.git/.gitignore index 0e7eedc..b7f7b45 100644 --- a/vendor/git.apache.org/thrift.git/.gitignore +++ b/vendor/git.apache.org/thrift.git/.gitignore @@ -339,8 +339,17 @@ project.lock.json /test/rs/target/ /test/rs/*.iml /test/rs/**/*.iml +/lib/cl/backport-update.zip +/lib/cl/lib +/tutorial/cl/quicklisp.lisp +/tutorial/cl/externals/ +/tutorial/cl/quicklisp/ /tutorial/cl/TutorialClient /tutorial/cl/TutorialServer +/tutorial/cl/backport-update.zip +/tutorial/cl/lib/ +/tutorial/cl/shared-implementation.fasl +/tutorial/cl/tutorial-implementation.fasl /tutorial/cpp/TutorialClient /tutorial/cpp/TutorialServer /tutorial/c_glib/tutorial_client diff --git a/vendor/git.apache.org/thrift.git/.rustfmt.toml b/vendor/git.apache.org/thrift.git/.rustfmt.toml index 2962d47..dca5afd 100644 --- a/vendor/git.apache.org/thrift.git/.rustfmt.toml +++ b/vendor/git.apache.org/thrift.git/.rustfmt.toml @@ -1,7 +1,64 @@ max_width = 100 -fn_args_layout = "Block" -array_layout = "Block" -where_style = "Rfc" -generics_indent = "Block" -fn_call_style = "Block" -reorder_imported_names = true +hard_tabs = false +tab_spaces = 4 +newline_style = "Auto" +use_small_heuristics = "Default" +indent_style = "Block" +wrap_comments = false +format_doc_comments = false +comment_width = 80 +normalize_comments = false +normalize_doc_attributes = false +license_template_path = "" +format_strings = false +format_macro_matchers = false +format_macro_bodies = true +empty_item_single_line = true +struct_lit_single_line = true +fn_single_line = false +where_single_line = false +imports_indent = "Block" +imports_layout = "Mixed" +merge_imports = false +reorder_imports = true +reorder_modules = true +reorder_impl_items = false +type_punctuation_density = "Wide" +space_before_colon = false +space_after_colon = true +spaces_around_ranges = false +binop_separator = "Front" +remove_nested_parens = true +combine_control_expr = true +overflow_delimited_expr = false +struct_field_align_threshold = 0 +enum_discrim_align_threshold = 0 +match_arm_blocks = true +force_multiline_blocks = false +fn_args_density = "Tall" +brace_style = "SameLineWhere" +control_brace_style = "AlwaysSameLine" +trailing_semicolon = true +trailing_comma = "Vertical" +match_block_trailing_comma = false +blank_lines_upper_bound = 1 +blank_lines_lower_bound = 0 +edition = "2015" +merge_derives = true +use_try_shorthand = false +use_field_init_shorthand = false +force_explicit_abi = true +condense_wildcard_suffixes = false +color = "Auto" +required_version = "1.0.0" +unstable_features = false +disable_all_formatting = false +skip_children = false +hide_parse_errors = false +error_on_line_overflow = false +error_on_unformatted = false +report_todo = "Never" +report_fixme = "Never" +ignore = [] +emit_mode = "Files" +make_backup = false diff --git a/vendor/git.apache.org/thrift.git/CHANGES b/vendor/git.apache.org/thrift.git/CHANGES index 9533ad0..e3e50b6 100644 --- a/vendor/git.apache.org/thrift.git/CHANGES +++ b/vendor/git.apache.org/thrift.git/CHANGES @@ -1,13 +1,262 @@ Apache Thrift Changelog -Breaking Changes since 0.11.0 [for 0.12.0]: --------------------------------------------------------------------------------- +================================================================================ +Thrift 0.12.0 +-------------------------------------------------------------------------------- +## New Languages + * Common LISP (cl) + * Swift + * Typescript (nodets) + +## Deprecated Languages + * Cocoa + +## Breaking Changes (since 0.11.0) + * [THRIFT-4529] - Rust enum variants are now camel-cased instead of uppercased to conform to Rust naming conventions * [THRIFT-4448] - Support for golang 1.6 and earlier has been dropped. * [THRIFT-4474] - PHP now uses the PSR-4 loader by default instead of class maps. * [THRIFT-4532] - method signatures changed in the compiler's t_oop_generator. * [THRIFT-4648] - The C (GLib) compiler's handling of namespaces has been improved. +## Known Issues (Blocker or Critical) + * [THRIFT-4037] - build: use a single build system for thrift + * [THRIFT-4119] - build: bootstrap.sh is missing from source tarball + * [THRIFT-3289] - csharp: socket exhaustion in csharp implementation + * [THRIFT-3029] - cocoa: Getters for fields defined with uppercase names do not work + * [THRIFT-3325] - cocoa: Extended services aren't subclasses in generated Cocoa + * [THRIFT-4116] - cocoa: Thrift de-capitalizes the name of IsSet property in Cocoa + * [THRIFT-3877] - cpp: the http implementation is not standard; interop with other languages is spotty at best + * [THRIFT-4180] - cpp: Impossible to build Thrift C++ library for Android (NDK) + * [THRIFT-4384] - cpp: Using multiple async services simultaneously is not thread-safe + * [THRIFT-3108] - haskell: Defaulted struct parameters on a service generates invalid Haskell + * [THRIFT-3990] - nodejs: Exception swallowed by deserialization function + * [THRIFT-4214] - nodejs: map key treated as hex value in JavaScript + * [THRIFT-4602] - nodejs: ERROR in ./node_modules/thrift/lib/nodejs/lib/thrift/connection.js Module not found: Error: Can't resolve 'child_process' + * [THRIFT-4639] - nodejs: Sequence numbering for multiplexed protocol broken + * [THRIFT-1310] - php: sequence and reconnection management issues + * [THRIFT-1538] - php: Error during deserialization int64 on 32-bit architecture + * [THRIFT-1580] - php: thrift type i64 java to php serialize/deserealize not working + * [THRIFT-1950] - php: PHP gets stuck in infinite loop + * [THRIFT-2954] - python: sending int or float in a double field breaks the connection + * [THRIFT-4080] - python: unix sockets can get stuck forever + * [THRIFT-4281] - python: generated code is out of order and causes load issues + * [THRIFT-4677] - py3: UnicodeDecideError in Python3 +## Build Process + * [THRIFT-4308] - D language docker images need demios for libevent and openssl fixed to re-enable make cross on dlang + * [THRIFT-4579] - Use Ubuntu Bionic (18.04 LTS) for CI builds instead of Artful (17.10) + * [THRIFT-4508] - Define CI operating system coverage rules for the project and (hopefully) simplify CI a little more + * [THRIFT-4397] - ubuntu install instructions broken on 16.04 + * [THRIFT-4545] - Appveyor builds are failing due to a haskell / cabal update in chocolatey + * [THRIFT-4452] - optimize Dockerfile (only onetime apt-get update) + * [THRIFT-4440] - rm `build/docker/ubuntu-trusty/Dockerfile.orig` + * [THRIFT-4352] - Ubuntu Artful doesn't appear to be compatible with Thrift and Haxe 3.4.2 + * [THRIFT-4666] - DLang Client Pool Test fails sporadically + * [THRIFT-4676] - CL tutorial build fails sporadically + * [THRIFT-4456] - Make haxelib download quiet so it doesn't blow up the build log + * [THRIFT-4605] - bootstrap.sh fails if automake=1.16.1 + +## c_glib + * [THRIFT-4648] - The C (GLib) compiler's handling of namespaces has been improved. + * [THRIFT-4622] - glibC compilation issue + * [THRIFT-4671] - c glib is unable to handle client close unexpectedly + +## cl (new language support in 0.12.0) + * [THRIFT-82] - Common Lisp support + +## csharp + * [THRIFT-4558] - reserved Csharp keywords are not escaped in some cases + * [THRIFT-4637] - C# async mode generates incorrect code with inherited services + * [THRIFT-4672] - IAsyncResult style methods not being supported by certain transports leads to issues in mixed ISync/IAsync use cases + * [THRIFT-4539] - Allow TBufferedTransport to be used as base class + * [THRIFT-4535] - XML docs; code cleanup (tabs->spaces; String->string) + * [THRIFT-4492] - protected ExceptionType type member of TApplicationException cannot be accessed + * [THRIFT-4446] - JSONProtocol Base64 Encoding Trims Padding + * [THRIFT-4455] - Missing dispose calls in ThreadedServer & ThreadpoolServer + * [THRIFT-4609] - keep InnerException wherever appropriate + * [THRIFT-4673] - IAsyncResult not supported by layered transports (buffered/framed) + +## cpp + * [THRIFT-4476] - Typecasting problem on list items + * [THRIFT-4465] - TNonblockingServer throwing THRIFT LOGGER: TConnection::workSocket(): THRIFT_EAGAIN (unavailable resources) + * [THRIFT-4680] - TBufferTransports.h does not compile under Visual Studio 2017 + * [THRIFT-4618] - TNonblockingServer crash because of limitation of select() + * [THRIFT-4620] - TZlibTransport.cpp doesn't ensure that there is enough space for the zlib flush marker in the buffer. + * [THRIFT-4571] - ZeroMQ contrib library needs a refresh + * [THRIFT-4559] - TSSLServerSocket incorrectly prints errors + * [THRIFT-4578] - Move `TAsyncProtocolProcessor` into main thrift library + * [THRIFT-4418] - evhttp_connection_new is deprecated; use evhttp_connection_base_new + +## compiler + * [THRIFT-4644] - Compiler cannot be compiled on macOS(maybe also on other platforms with clang) + * [THRIFT-4531] - Thrift generates wrong Python code for immutable structures with optional members + * [THRIFT-4513] - thrift generated code is not stable for constants + * [THRIFT-4532] - Avoid updating Thrift compiler generated code if the output has not changed + * [THRIFT-4400] - Visual Studio Compiler project should link runtime statically in release builds + * [THRIFT-4399] - plugin.thrift t_const_value is not used as a union in C++ code -- fix this + * [THRIFT-4496] - Dealing with language keywords in Thrift (e.g. service method names) + * [THRIFT-4393] - repeated runs of compiler produce different binary output at plugin interface + +## dlang + * [THRIFT-4478] - Thrift will not build with dlang 2.078 or later + * [THRIFT-4503] - dlang servers logError on normal client disconnection + * [THRIFT-4308] - D language docker images need demios for libevent and openssl fixed to re-enable make cross on dlang + +## dart + * [THRIFT-4646] - Effective Dart and Exceptions + * [THRIFT-4439] - Shouldn't download dart.deb directly. + +## delphi + * [THRIFT-4562] - Calling wrong exception CTOR leads to "call failed: unknown result" instead of the real exception being thrown + * [THRIFT-4554] - uncompileable code with member names that are also types under specific conditions + * [THRIFT-4422] - Add Async implementation via IFuture + * [THRIFT-4485] - Possible invalid ptr AV with overlapped read/write on pipes + * [THRIFT-4549] - Thrift exceptions should derive from TException + * [THRIFT-4540] - buffered transport broken when trying to re-open a formerly closed transport + * [THRIFT-4473] - Move Thrift.Console.pas out of the Library + * [THRIFT-4490] - Allow a default service as fallback for multiplex processors connected by old clients + * [THRIFT-4454] - Large writes/reads may cause range check errors in debug mode + * [THRIFT-4461] - Compiler directive should match Delphi XE4 + * [THRIFT-4462] - First line in Console duplicated + * [THRIFT-4642] - FPU ctrl word settings may cause an unexpected "denormalized" error + +## erlang + * [THRIFT-4497] - Erlang records should use map() for map type + * [THRIFT-4495] - Erlang records should allow 'undefined' for non-required fields + * [THRIFT-4580] - Fix erlang tutorial unpack on Windows + * [THRIFT-4582] - Ubuntu Xenial erlang 18.3 "make check" fails + +## golang + * [THRIFT-4448] - Support for golang 1.6 and earlier has been dropped. + * [THRIFT-4253] - Go generator assigns strings to field in const instead of pointers. + * [THRIFT-4573] - Unions Field Count Does Not Consider Binary + * [THRIFT-4447] - Golang: Panic on p.c.Call when using deprecated initializers + * [THRIFT-4650] - Required field incorrectly marked as set when fieldType does not match + * [THRIFT-4486] - Golang: -remote.go client cleanup + * [THRIFT-4537] - TSimpleServer can exit Accept loop with lock still acquired + * [THRIFT-4516] - Add support for go 1.10 + * [THRIFT-4421] - golang tests rely on gomock, which has change behaviour, causing tests to fail + * [THRIFT-4626] - Communication crash when using binary/compact protocol and zlib transport + * [THRIFT-4659] - golang race detected when closing listener socket + +## haskell + * [THRIFT-4634] - Haskell builds with older cabal cannot reconcile complex version requirements + +## java + * [THRIFT-4259] - Thrift does not compile due to Ant Maven task errors + * [THRIFT-1418] - Compiling Thrift from source: Class org.apache.tools.ant.taskdefs.ConditionTask doesn't support the nested "typefound" element + * [THRIFT-4530] - proposal: add nullability annotations to generated Java code + * [THRIFT-4614] - Generate missing @Nullable annotations for Java iterator getters + * [THRIFT-4555] - Getter of binary field in Java creates unnecessary copy + * [THRIFT-3983] - libthrift is deployed on central with pom packaging instead of jar + * [THRIFT-4294] - Java Configure Fails for Ant >= 1.10 + * [THRIFT-4178] - Java libraries missing from package when using cmake + * [THRIFT-4120] - pom files are not generated or provided in the build + * [THRIFT-1507] - Maven can't download resource from central when behind a proxy and won't use local repository + * [THRIFT-4556] - Optional rethrow of unhandled exceptions in java processor + * [THRIFT-4337] - Able to set keyStore and trustStore as InputStream in the TSSLTransportFactory.TSSLTransportParameters + * [THRIFT-4566] - Pass message of unhandled exception to optional rethrow. + * [THRIFT-4506] - Remove assertion in Java SASL code that would be ignored in release builds + * [THRIFT-4470] - Include popular IDE file templates to gitignore + * [THRIFT-4429] - Make TThreadPoolServer.executorService_ available in inherited classes and refactor methods to be able customization + * [THRIFT-3769] - Fix logic of THRIFT-2268 + * [THRIFT-4494] - Increase Java Socket Buffer Size + * [THRIFT-4499] - Remove Magic Number In TFIleTransport + +## js + * [THRIFT-4406] - JavaScript: Use modern Promise implementations + * [THRIFT-4625] - let / const variable decorators for es6 compiler + * [THRIFT-4653] - ES6 Classes + * [THRIFT-4592] - JS: readI32 performance on large arrays is very poor in Chrome + * [THRIFT-4509] - js and nodejs libraries need to be refreshed with current libraries + * [THRIFT-4403] - thrift.js: Incorrect usage of 'this' in TWebSocketTransport.__onOpen + * [THRIFT-4436] - Deserialization of nested list discards content + * [THRIFT-4437] - JS WebSocket client callbacks invoked twice on parallel requests + * [THRIFT-4679] - Duplicate declaration of InputBufferUnderrunError in lib/nodejs/lib/thrift/json_protocol.js + * [THRIFT-4551] - Add prettier for consistent JS code formatting + +## lua + * [THRIFT-4591] - lua client uses two write() calls per framed message send + * [THRIFT-3863] - Can't "make install" Lua Library + +## netcore + * [THRIFT-4524] - .NET Core Server doesn't close properly when cancelled + * [THRIFT-4434] - Update .NET Core components, add tests for .Net Core library and .Net Core compiler, fix bugs and build process + * [THRIFT-4446] - JSONProtocol Base64 Encoding Trims Padding + +## node.js + * [THRIFT-4225] - Error handling malformed arguments leaks memory, corrupts transport buffers causing next RPC to fail + * [THRIFT-3950] - Memory leak while calling oneway method + * [THRIFT-3143] - add typescript directory support + * [THRIFT-4564] - TBufferedTransport can leave corrupt data in the buffer + * [THRIFT-4647] - Node.js Fileserver webroot path + * [THRIFT-4489] - Unix domain socket support for NodeJS client + * [THRIFT-4443] - node.js json_protocol throws error in skip function + * [THRIFT-4604] - NodeJS: Expose Int64 from browser.js for consumption by browser + * [THRIFT-4480] - NodeJS warning on binary_protocol writeMessageEnd when seqid = 0 + +## perl + * [THRIFT-4382] - Replace the use of Perl Indirect Object Syntax calls to new() + * [THRIFT-4471] - Thrift CPAN release is missing Makefile.PL and the clients are unable to build the module + * [THRIFT-4416] - Perl CPAN Packaging Improvements + +## php + * [THRIFT-4474] - PHP generator use PSR-4 default + * [THRIFT-4463] - PHP generated code match PSR-2 + * [THRIFT-4373] - Extending Thrift class results in "Attempt serialize from non-Thrift object" + * [THRIFT-4354] - TSocket block on read + * [THRIFT-4423] - migrate php library to psr-4 + * [THRIFT-4656] - infinite loop in latest PHP library + * [THRIFT-4477] - TBufferedTransport must have underlying transport + * [THRIFT-4475] - lib/php/test should be checked for PSR-2 + * [THRIFT-4498] - add phpcs back + * [THRIFT-4460] - php library use PSR-2 + * [THRIFT-4641] - TCurlClient doesn't check for HTTP status code + * [THRIFT-4645] - TCurlClient: show actual error message when throwing TTransportException + * [THRIFT-4674] - Add stream context support into PHP/THttpClient + * [THRIFT-4459] - reduce php library directory depth + +## python + * [THRIFT-4670] - Twisted, slots, and void method fails with "object has no attribute 'success'" + * [THRIFT-4464] - Potentially server-crashing typo in Python TNonblockingServer + * [THRIFT-4548] - Supporting TBinaryProtocolAccelerated protocol when using TMultiplexedProcessor in Python + * [THRIFT-4577] - Outdated cipher string in python unit test + * [THRIFT-4505] - python build on Vagrant Windows boxes fails + * [THRIFT-4621] - THeader for Python + * [THRIFT-4668] - make socket backlog configurable for python + * [THRIFT-4561] - Python: cleanup socket timeout settings + +## ruby + * [THRIFT-4289] - Thrift RSpec test suite fails with Ruby 2.4.x due to Fixnum deprecation + * [THRIFT-4342] - Support ruby rspec 3 + * [THRIFT-4525] - Add ssl socket option to ruby cross tests + * [THRIFT-4450] - Add seek support to TCompactInputProtocol in Rust + * [THRIFT-4631] - Codegen Creates Invalid Ruby for Recursive Structs + * [THRIFT-4472] - Fix the genspec for ruby so it does not complain about an invalid license + +## rust + * [THRIFT-4662] - Rust const string calls function at compile time + * [THRIFT-4661] - Rust enum name wrong case in generated structs + * [THRIFT-4617] - Avoid generating conflicting struct names in Rust code + * [THRIFT-4529] - Rust generation should include #![allow(non_snake_case)] or force conform to Rust style guidelines + * [THRIFT-4390] - Rust binary protocol and buffered transport cannot handle writes above 4096 bytes + * [THRIFT-4419] - Rust framed transport cannot handle writes above 4096 bytes + * [THRIFT-4658] - Rust's TBinaryInputProtocol fails when strict is false + * [THRIFT-4187] - Dart -> Rust Framed cross tests fail + * [THRIFT-4664] - Rust cannot create ReadHalf/WriteHalf to implement custom tranports + +## swift (new language support in 0.12.0) + * [THRIFT-3773] - Swift Library + +## test suite + * [THRIFT-4515] - Gracefully shutdown cross-test servers to fully test teardown + * [THRIFT-4085] - Add .NET Core to the make cross standard test suite + * [THRIFT-4358] - Add unix domain sockets in ruby to cross test - code exists + +## typescript (new language support in 0.12.0) + * [THRIFT-3143] - add typescript directory support + +================================================================================ Thrift 0.11.0 -------------------------------------------------------------------------------- ## Sub-task diff --git a/vendor/git.apache.org/thrift.git/LANGUAGES.md b/vendor/git.apache.org/thrift.git/LANGUAGES.md index 7c83053..acf9083 100644 --- a/vendor/git.apache.org/thrift.git/LANGUAGES.md +++ b/vendor/git.apache.org/thrift.git/LANGUAGES.md @@ -1,8 +1,8 @@ # Apache Thrift Language Support # -Last Modified: 2018-07-06 +Last Modified: 2018-12-17 -Guidance For: 0.11.0 or later +Guidance For: 0.12.0 or later Thrift supports many programming languages and has an impressive test suite that exercises most of the languages, protocols, and transports that represents a matrix of thousands of possible combinations. Each language typically has a minimum required version as well as support libraries - some mandatory and some optional. All of this information is provided below to help you assess whether you can use Apache Thrift with your project. Obviously this is a complex matrix to maintain and may not be correct in all cases - if you spot an error please inform the developers using the mailing list. @@ -243,6 +243,17 @@ The Language/Library Levels indicate the minimum and maximum versions that are u node.js +node.ts +0.12.0 +Yes +3.1.6 +YesYes + +Yes +Yes +node.ts + + OCaml 0.2.0 diff --git a/vendor/git.apache.org/thrift.git/Makefile.am b/vendor/git.apache.org/thrift.git/Makefile.am index cdb8bd2..511452d 100755 --- a/vendor/git.apache.org/thrift.git/Makefile.am +++ b/vendor/git.apache.org/thrift.git/Makefile.am @@ -54,7 +54,7 @@ empty := space := $(empty) $(empty) comma := , -CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_CSHARP@ @MAYBE_PYTHON@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_HASKELL@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_DOTNETCORE@ +CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_CSHARP@ @MAYBE_PYTHON@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_HASKELL@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_DOTNETCORE@ @MAYBE_NODETS@ CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS)) if WITH_PY3 diff --git a/vendor/git.apache.org/thrift.git/Thrift-swift3.podspec b/vendor/git.apache.org/thrift.git/Thrift-swift3.podspec index e13d171..542d810 100644 --- a/vendor/git.apache.org/thrift.git/Thrift-swift3.podspec +++ b/vendor/git.apache.org/thrift.git/Thrift-swift3.podspec @@ -1,16 +1,16 @@ Pod::Spec.new do |s| - s.name = "Thrift-swift3" - s.version = "1.1.0" + s.name = "Thrift-swift3" + s.version = "0.12.0" s.summary = "Apache Thrift is a lightweight, language-independent software stack with an associated code generation mechanism for RPC." s.description = <<-DESC The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages. DESC s.homepage = "http://thrift.apache.org" - s.license = { :type => 'Apache License, Version 2.0', :url => 'https://raw.github.com/apache/thrift/thrift-0.9.0/LICENSE' } - s.author = { "The Apache Software Foundation" => "apache@apache.org" } + s.license = { :type => 'Apache License, Version 2.0', :url => 'https://www.apache.org/licenses/LICENSE-2.0' } + s.author = { "Apache Thrift Developers" => "dev@thrift.apache.org" } s.ios.deployment_target = '9.0' s.osx.deployment_target = '10.10' s.requires_arc = true - s.source = { :git => "https://github.com/apache/thrift.git", :tag => "thrift-1.0.0" } + s.source = { :git => "https://github.com/apache/thrift.git", :tag => "0.12.0" } s.source_files = "lib/swift/Sources/*.swift" end diff --git a/vendor/git.apache.org/thrift.git/Thrift.podspec b/vendor/git.apache.org/thrift.git/Thrift.podspec index 39d3780..e5b8149 100644 --- a/vendor/git.apache.org/thrift.git/Thrift.podspec +++ b/vendor/git.apache.org/thrift.git/Thrift.podspec @@ -1,18 +1,18 @@ Pod::Spec.new do |s| s.name = "Thrift" - s.version = "1.0.0" + s.version = "0.12.0" s.summary = "Apache Thrift is a lightweight, language-independent software stack with an associated code generation mechanism for RPC." s.description = <<-DESC The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages. DESC s.homepage = "http://thrift.apache.org" - s.license = { :type => 'Apache License, Version 2.0', :url => 'https://raw.github.com/apache/thrift/thrift-0.9.0/LICENSE' } - s.author = { "The Apache Software Foundation" => "apache@apache.org" } + s.license = { :type => 'Apache License, Version 2.0', :url => 'https://www.apache.org/licenses/LICENSE-2.0' } + s.author = { "Apache Thrift Developers" => "dev@thrift.apache.org" } s.requires_arc = true s.ios.deployment_target = '7.0' s.osx.deployment_target = '10.8' s.ios.framework = 'CFNetwork' s.osx.framework = 'CoreServices' - s.source = { :git => "https://github.com/apache/thrift.git", :tag => "thrift-1.0.0" } + s.source = { :git => "https://github.com/apache/thrift.git", :tag => "0.12.0" } s.source_files = 'lib/cocoa/src/**/*.{h,m,swift}' -end \ No newline at end of file +end diff --git a/vendor/git.apache.org/thrift.git/aclocal/ax_boost_base.m4 b/vendor/git.apache.org/thrift.git/aclocal/ax_boost_base.m4 index 19c71b6..d540395 100644 --- a/vendor/git.apache.org/thrift.git/aclocal/ax_boost_base.m4 +++ b/vendor/git.apache.org/thrift.git/aclocal/ax_boost_base.m4 @@ -33,7 +33,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 42 +#serial 45 # example boost program (need to pass version) m4_define([_AX_BOOST_BASE_PROGRAM], @@ -113,8 +113,8 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[ dnl are found, e.g. when only header-only libraries are installed! AS_CASE([${host_cpu}], [x86_64],[libsubdirs="lib64 libx32 lib lib64"], - [ppc64|s390x|sparc64|aarch64|ppc64le],[libsubdirs="lib64 lib lib64"], - [libsubdirs="lib"], + [ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"], + [libsubdirs="lib"] ) dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give diff --git a/vendor/git.apache.org/thrift.git/aclocal/ax_cxx_compile_stdcxx.m4 b/vendor/git.apache.org/thrift.git/aclocal/ax_cxx_compile_stdcxx.m4 index 5032bba..9e9eaed 100644 --- a/vendor/git.apache.org/thrift.git/aclocal/ax_cxx_compile_stdcxx.m4 +++ b/vendor/git.apache.org/thrift.git/aclocal/ax_cxx_compile_stdcxx.m4 @@ -33,19 +33,18 @@ # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler -# Copyright (c) 2016 Krzesimir Nowak +# Copyright (c) 2016, 2018 Krzesimir Nowak # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 10 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). -AX_REQUIRE_DEFINED([AC_MSG_WARN]) AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], [$1], [14], [ax_cxx_compile_alternatives="14 1y"], @@ -61,14 +60,6 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then @@ -139,7 +130,6 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl [define if the compiler supports basic C++$1 syntax]) fi AC_SUBST(HAVE_CXX$1) - m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])]) ]) @@ -587,20 +577,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ #error "This is not a C++ compiler" -#elif __cplusplus <= 201402L +#elif __cplusplus < 201703L #error "This is not a C++17 compiler" #else -#if defined(__clang__) - #define REALLY_CLANG -#else - #if defined(__GNUC__) - #define REALLY_GCC - #endif -#endif - #include #include #include @@ -608,16 +590,12 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ namespace cxx17 { -#if !defined(REALLY_CLANG) namespace test_constexpr_lambdas { - // TODO: test it with clang++ from git - constexpr int foo = [](){return 42;}(); } -#endif // !defined(REALLY_CLANG) namespace test::nested_namespace::definitions { @@ -852,12 +830,9 @@ namespace cxx17 } -#if !defined(REALLY_CLANG) namespace test_template_argument_deduction_for_class_templates { - // TODO: test it with clang++ from git - template struct pair { @@ -876,7 +851,6 @@ namespace cxx17 } } -#endif // !defined(REALLY_CLANG) namespace test_non_type_auto_template_parameters { @@ -890,12 +864,9 @@ namespace cxx17 } -#if !defined(REALLY_CLANG) namespace test_structured_bindings { - // TODO: test it with clang++ from git - int arr[2] = { 1, 2 }; std::pair pr = { 1, 2 }; @@ -927,14 +898,10 @@ namespace cxx17 const auto [ x3, y3 ] = f3(); } -#endif // !defined(REALLY_CLANG) -#if !defined(REALLY_CLANG) namespace test_exception_spec_type_system { - // TODO: test it with clang++ from git - struct Good {}; struct Bad {}; @@ -952,7 +919,6 @@ namespace cxx17 static_assert (std::is_same_v); } -#endif // !defined(REALLY_CLANG) namespace test_inline_variables { @@ -977,6 +943,6 @@ namespace cxx17 } // namespace cxx17 -#endif // __cplusplus <= 201402L +#endif // __cplusplus < 201703L ]]) diff --git a/vendor/git.apache.org/thrift.git/appveyor.yml b/vendor/git.apache.org/thrift.git/appveyor.yml index 121fe1c..b126dc9 100755 --- a/vendor/git.apache.org/thrift.git/appveyor.yml +++ b/vendor/git.apache.org/thrift.git/appveyor.yml @@ -19,7 +19,7 @@ # build Apache Thrift on AppVeyor - https://ci.appveyor.com -version: '1.0.0-dev.{build}' +version: '0.12.0.{build}' shallow_clone: true @@ -107,4 +107,4 @@ test_script: # # also need: # environment: -# APPVEYOR_RDP_PASSWORD: thr1FT2345$xyzZ \ No newline at end of file +# APPVEYOR_RDP_PASSWORD: thr1FT2345$xyzZ diff --git a/vendor/git.apache.org/thrift.git/bower.json b/vendor/git.apache.org/thrift.git/bower.json index 1092c65..5f40760 100644 --- a/vendor/git.apache.org/thrift.git/bower.json +++ b/vendor/git.apache.org/thrift.git/bower.json @@ -1,5 +1,6 @@ { "name": "thrift", + "version": "0.12.0", "homepage": "https://git-wip-us.apache.org/repos/asf/thrift.git", "authors": [ "Apache Thrift " diff --git a/vendor/git.apache.org/thrift.git/build/appveyor/MSVC-appveyor-build.bat b/vendor/git.apache.org/thrift.git/build/appveyor/MSVC-appveyor-build.bat index 31aac57..a4b92a2 100644 --- a/vendor/git.apache.org/thrift.git/build/appveyor/MSVC-appveyor-build.bat +++ b/vendor/git.apache.org/thrift.git/build/appveyor/MSVC-appveyor-build.bat @@ -21,8 +21,6 @@ CALL cl_setenv.bat || EXIT /B MKDIR "%BUILDDIR%" || EXIT /B CD "%BUILDDIR%" || EXIT /B -:: Haskell is disabled for cmake (Windows), see Jira THRIFT-4545 - @ECHO ON cmake "%SRCDIR%" ^ -G"%GENERATOR%" ^ @@ -38,7 +36,6 @@ CD "%BUILDDIR%" || EXIT /B -DOPENSSL_USE_STATIC_LIBS=OFF ^ -DZLIB_LIBRARY="%WIN3P%\zlib-inst\lib\zlib%ZLIB_LIB_SUFFIX%.lib" ^ -DZLIB_ROOT="%WIN3P%\zlib-inst" ^ - -DWITH_HASKELL=OFF ^ -DWITH_PYTHON=%WITH_PYTHON% ^ -DWITH_%THREADMODEL%THREADS=ON ^ -DWITH_SHARED_LIB=OFF ^ diff --git a/vendor/git.apache.org/thrift.git/build/appveyor/MSVC-appveyor-install.bat b/vendor/git.apache.org/thrift.git/build/appveyor/MSVC-appveyor-install.bat index f9eb0c6..f973d29 100644 --- a/vendor/git.apache.org/thrift.git/build/appveyor/MSVC-appveyor-install.bat +++ b/vendor/git.apache.org/thrift.git/build/appveyor/MSVC-appveyor-install.bat @@ -31,14 +31,14 @@ choco feature enable -n allowGlobalConfirmation || EXIT /B :: Things to install when NOT running in appveyor: IF "%APPVEYOR_BUILD_ID%" == "" ( cup -y chocolatey || EXIT /B - cinst -c "%BUILDCACHE%" -y curl || EXIT /B - cinst -c "%BUILDCACHE%" -y 7zip || EXIT /B - cinst -c "%BUILDCACHE%" -y python3 || EXIT /B - cinst -c "%BUILDCACHE%" -y openssl.light || EXIT /B + cinst -y curl || EXIT /B + cinst -y 7zip || EXIT /B + cinst -y python3 || EXIT /B + cinst -y openssl.light || EXIT /B ) -cinst -c "%BUILDCACHE%" -y jdk8 || EXIT /B -cinst -c "%BUILDCACHE%" -y winflexbison3 || EXIT /B +cinst -y jdk8 || EXIT /B +cinst -y winflexbison3 || EXIT /B :: zlib - not available through chocolatey CD "%APPVEYOR_SCRIPTS%" || EXIT /B @@ -56,5 +56,4 @@ pip.exe ^ tornado ^ twisted || EXIT /B -:: Haskell (GHC) and cabal (disabled: see Jira THRIFT-4545) -:: cinst -c "%BUILDCACHE%" -y ghc || EXIT /B +cinst -y ghc || EXIT /B diff --git a/vendor/git.apache.org/thrift.git/build/appveyor/cl_setenv.bat b/vendor/git.apache.org/thrift.git/build/appveyor/cl_setenv.bat index 10af2d3..62856cb 100644 --- a/vendor/git.apache.org/thrift.git/build/appveyor/cl_setenv.bat +++ b/vendor/git.apache.org/thrift.git/build/appveyor/cl_setenv.bat @@ -37,7 +37,6 @@ CALL cl_setcompiler.bat || EXIT /B CALL cl_setgenerator.bat || EXIT /B SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor -SET BUILDCACHE=%APPVEYOR_BUILD_FOLDER%\..\build\cache SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM% SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM% SET SRCDIR=%APPVEYOR_BUILD_FOLDER% diff --git a/vendor/git.apache.org/thrift.git/build/appveyor/cl_showenv.bat b/vendor/git.apache.org/thrift.git/build/appveyor/cl_showenv.bat index 3dda546..a70a490 100644 --- a/vendor/git.apache.org/thrift.git/build/appveyor/cl_showenv.bat +++ b/vendor/git.apache.org/thrift.git/build/appveyor/cl_showenv.bat @@ -38,7 +38,6 @@ ECHO BASH = %BASH% ECHO BOOST_ROOT = %BOOST_ROOT% ECHO BOOST_INCLUDEDIR = %BOOST_INCLUDEDIR% ECHO BOOST_LIBRARYDIR = %BOOST_LIBRARYDIR% -ECHO BUILDCACHE = %BUILDCACHE% ECHO BUILDDIR = %BUILDDIR% ECHO COMPILER = %COMPILER% ECHO GENERATOR = %GENERATOR% diff --git a/vendor/git.apache.org/thrift.git/build/cmake/DefineCMakeDefaults.cmake b/vendor/git.apache.org/thrift.git/build/cmake/DefineCMakeDefaults.cmake index 2899937..dc2cc29 100644 --- a/vendor/git.apache.org/thrift.git/build/cmake/DefineCMakeDefaults.cmake +++ b/vendor/git.apache.org/thrift.git/build/cmake/DefineCMakeDefaults.cmake @@ -35,7 +35,7 @@ set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) set(CMAKE_COLOR_MAKEFILE ON) # Define the generic version of the libraries here -set(GENERIC_LIB_VERSION "0.1.0") +set(GENERIC_LIB_VERSION "0.12.0") set(GENERIC_LIB_SOVERSION "0") # Set the default build type to release with debug info diff --git a/vendor/git.apache.org/thrift.git/build/cmake/DefinePlatformSpecifc.cmake b/vendor/git.apache.org/thrift.git/build/cmake/DefinePlatformSpecifc.cmake index 8af4b6c..a809c07 100644 --- a/vendor/git.apache.org/thrift.git/build/cmake/DefinePlatformSpecifc.cmake +++ b/vendor/git.apache.org/thrift.git/build/cmake/DefinePlatformSpecifc.cmake @@ -61,9 +61,6 @@ if(MSVC) set(STATIC_POSTFIX "md" CACHE STRING "Set static library postfix" FORCE) endif(WITH_MT) - # Disable Windows.h definition of macros for min and max - add_definitions("-DNOMINMAX") - # Disable boost auto linking pragmas - cmake includes the right files add_definitions("-DBOOST_ALL_NO_LIB") diff --git a/vendor/git.apache.org/thrift.git/build/docker/scripts/sca.sh b/vendor/git.apache.org/thrift.git/build/docker/scripts/sca.sh index f26ce95..16d5826 100755 --- a/vendor/git.apache.org/thrift.git/build/docker/scripts/sca.sh +++ b/vendor/git.apache.org/thrift.git/build/docker/scripts/sca.sh @@ -39,7 +39,7 @@ cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/c cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib # Python code style -flake8 --ignore=E501 --exclude=lib/py/build lib/py +flake8 --ignore=W504,E501 lib/py flake8 --exclude=tutorial/py/build tutorial/py # THRIFT-4371 : generated files are excluded because they haven't been scrubbed yet flake8 --ignore=E501 --exclude="*/gen-py*/*",test/py/build test/py diff --git a/vendor/git.apache.org/thrift.git/build/docker/ubuntu-bionic/Dockerfile b/vendor/git.apache.org/thrift.git/build/docker/ubuntu-bionic/Dockerfile index 795c086..a8c1417 100644 --- a/vendor/git.apache.org/thrift.git/build/docker/ubuntu-bionic/Dockerfile +++ b/vendor/git.apache.org/thrift.git/build/docker/ubuntu-bionic/Dockerfile @@ -89,7 +89,7 @@ RUN apt-get install -y --no-install-recommends \ `# csharp (mono) dependencies` \ mono-devel -ENV SBCL_VERSION 1.4.9 +ENV SBCL_VERSION 1.4.12 RUN \ `# Common Lisp (sbcl) dependencies` \ curl --version && \ @@ -101,8 +101,8 @@ RUN \ cd .. && \ rm -rf sbcl* -ENV D_VERSION 2.081.0 -ENV DMD_DEB dmd_2.081.0-0_amd64.deb +ENV D_VERSION 2.082.1 +ENV DMD_DEB dmd_2.082.1-0_amd64.deb RUN \ `# D dependencies` \ wget -q http://downloads.dlang.org/releases/2.x/${D_VERSION}/${DMD_DEB} && \ @@ -140,9 +140,9 @@ RUN apt-get install -y --no-install-recommends \ libglib2.0-dev # golang -ENV GOLANG_VERSION 1.10.3 +ENV GOLANG_VERSION 1.11.1 ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz -ENV GOLANG_DOWNLOAD_SHA256 fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035 +ENV GOLANG_DOWNLOAD_SHA256 2871270d8ff0c8c69f161aaae42f9f28739855ff5c5204752a8d92a1c9f63993 RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz && \ echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - && \ tar -C /usr/local -xzf golang.tar.gz && \ diff --git a/vendor/git.apache.org/thrift.git/compiler/cpp/CMakeLists.txt b/vendor/git.apache.org/thrift.git/compiler/cpp/CMakeLists.txt index e618877..0df790e 100644 --- a/vendor/git.apache.org/thrift.git/compiler/cpp/CMakeLists.txt +++ b/vendor/git.apache.org/thrift.git/compiler/cpp/CMakeLists.txt @@ -113,7 +113,7 @@ THRIFT_ADD_COMPILER(xml "Enable compiler for XML" ON) # we also add the current binary directory for generated files include_directories(${CMAKE_CURRENT_BINARY_DIR} src) -if(NOT ${WITH_PLUGIN}) +if(NOT DEFINED WITH_PLUGIN OR NOT ${WITH_PLUGIN}) list(APPEND thrift-compiler_SOURCES ${compiler_core}) endif() diff --git a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_csharp_generator.cc b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_csharp_generator.cc index bd6331d..37d6f9d 100644 --- a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_csharp_generator.cc +++ b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_csharp_generator.cc @@ -1690,6 +1690,7 @@ void t_csharp_generator::generate_service_client(t_service* tservice) { if (!async_) { indent(f_service_) << "#if SILVERLIGHT" << endl; + indent(f_service_) << endl; } // Begin_ indent(f_service_) << "public " << function_signature_async_begin(*f_iter, "Begin_") << endl; @@ -1766,51 +1767,52 @@ void t_csharp_generator::generate_service_client(t_service* tservice) { indent(f_service_) << "#endif" << endl << endl; } - // "Normal" Synchronous invoke generate_csharp_doc(f_service_, *f_iter); indent(f_service_) << "public " << function_signature(*f_iter) << endl; scope_up(f_service_); + // silverlight invoke if (!async_) { - indent(f_service_) << "#if !SILVERLIGHT" << endl; - indent(f_service_) << "send_" << funname << "("; + indent(f_service_) << "#if SILVERLIGHT" << endl; - first = true; + indent(f_service_) << "var asyncResult = Begin_" << funname << "(null, null"; for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) { - if (first) { - first = false; - } else { - f_service_ << ", "; - } - f_service_ << normalize_name((*fld_iter)->get_name()); + f_service_ << ", " << normalize_name((*fld_iter)->get_name()); } f_service_ << ");" << endl; - + if (!(*f_iter)->is_oneway()) { f_service_ << indent(); if (!(*f_iter)->get_returntype()->is_void()) { f_service_ << "return "; } - f_service_ << "recv_" << funname << "();" << endl; + f_service_ << "End_" << funname << "(asyncResult);" << endl; } f_service_ << endl; indent(f_service_) << "#else" << endl; } - // Silverlight synchronous invoke - indent(f_service_) << "var asyncResult = Begin_" << funname << "(null, null"; + // synchronous invoke + indent(f_service_) << "send_" << funname << "("; + + first = true; for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) { - f_service_ << ", " << normalize_name((*fld_iter)->get_name()); + if (first) { + first = false; + } else { + f_service_ << ", "; + } + f_service_ << normalize_name((*fld_iter)->get_name()); } f_service_ << ");" << endl; - + if (!(*f_iter)->is_oneway()) { f_service_ << indent(); if (!(*f_iter)->get_returntype()->is_void()) { f_service_ << "return "; } - f_service_ << "End_" << funname << "(asyncResult);" << endl; + f_service_ << "recv_" << funname << "();" << endl; } f_service_ << endl; @@ -1829,12 +1831,8 @@ void t_csharp_generator::generate_service_client(t_service* tservice) { if (!async_) { indent(f_service_) << "#if SILVERLIGHT" << endl; } + indent(f_service_) << "public " << function_signature_async_begin(&send_function) << endl; - if (!async_) { - indent(f_service_) << "#else" << endl; - indent(f_service_) << "public " << function_signature(&send_function) << endl; - indent(f_service_) << "#endif" << endl; - } scope_up(f_service_); f_service_ << indent() << "oprot_.WriteMessageBegin(new TMessage(\"" << funname << "\", " @@ -1849,20 +1847,40 @@ void t_csharp_generator::generate_service_client(t_service* tservice) { f_service_ << indent() << "args.Write(oprot_);" << endl << indent() << "oprot_.WriteMessageEnd();" << endl; - ; + indent(f_service_) << "return oprot_.Transport.BeginFlush(callback, state);" << endl; + + scope_down(f_service_); + f_service_ << endl; - if (!async_) { - indent(f_service_) << "#if SILVERLIGHT" << endl; - } - indent(f_service_) << "return oprot_.Transport.BeginFlush(callback, state);" << endl; if (!async_) { indent(f_service_) << "#else" << endl; - indent(f_service_) << "oprot_.Transport.Flush();" << endl; + f_service_ << endl; + } + + indent(f_service_) << "public " << function_signature(&send_function) << endl; + scope_up(f_service_); + + f_service_ << indent() << "oprot_.WriteMessageBegin(new TMessage(\"" << funname << "\", " + << ((*f_iter)->is_oneway() ? "TMessageType.Oneway" : "TMessageType.Call") + << ", seqid_));" << endl << indent() << argsname << " args = new " << argsname + << "();" << endl; + + for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) { + f_service_ << indent() << "args." << prop_name(*fld_iter) << " = " + << normalize_name((*fld_iter)->get_name()) << ";" << endl; + } + + f_service_ << indent() << "args.Write(oprot_);" << endl << indent() + << "oprot_.WriteMessageEnd();" << endl; + + indent(f_service_) << "oprot_.Transport.Flush();" << endl; + cleanup_member_name_mapping(arg_struct); + scope_down(f_service_); + + if (!async_) { indent(f_service_) << "#endif" << endl; } - cleanup_member_name_mapping(arg_struct); - scope_down(f_service_); f_service_ << endl; if (!(*f_iter)->is_oneway()) { diff --git a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_go_generator.cc b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_go_generator.cc index 0807efb..5ada4fa 100644 --- a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_go_generator.cc +++ b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_go_generator.cc @@ -61,7 +61,7 @@ static const string endl = "\n"; // avoid ostream << std::endl flushes */ bool format_go_output(const string& file_path); -const string DEFAULT_THRIFT_IMPORT = "git.apache.org/thrift.git/lib/go/thrift"; +const string DEFAULT_THRIFT_IMPORT = "github.com/apache/thrift/lib/go/thrift"; static std::string package_flag; /** @@ -1323,7 +1323,7 @@ void t_go_generator::generate_go_struct_definition(ostream& out, if (tstruct->is_union()) (*m_iter)->set_req(t_field::T_OPTIONAL); if (sorted_keys_pos != (*m_iter)->get_key()) { - int first_unused = std::max(1, sorted_keys_pos++); + int first_unused = (std::max)(1, sorted_keys_pos++); while (sorted_keys_pos != (*m_iter)->get_key()) { ++sorted_keys_pos; } diff --git a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_java_generator.cc b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_java_generator.cc index 67b4177..2c84551 100644 --- a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_java_generator.cc +++ b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_java_generator.cc @@ -498,6 +498,11 @@ void t_java_generator::generate_enum(t_enum* tenum) { f_enum << autogen_comment() << java_package() << endl; generate_java_doc(f_enum, tenum); + + if (!suppress_generated_annotations_) { + generate_javax_generated_annotation(f_enum); + } + if (is_deprecated) { indent(f_enum) << "@Deprecated" << endl; } @@ -544,6 +549,7 @@ void t_java_generator::generate_enum(t_enum* tenum) { << endl; indent(f_enum) << " * @return null if the value is not found." << endl; indent(f_enum) << " */" << endl; + indent(f_enum) << java_nullable_annotation() << endl; indent(f_enum) << "public static " + tenum->get_name() + " findByValue(int value) { " << endl; indent_up(); @@ -827,6 +833,10 @@ void t_java_generator::generate_java_union(t_struct* tstruct) { bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end()); bool is_deprecated = this->is_deprecated(tstruct->annotations_); + if (!suppress_generated_annotations_) { + generate_javax_generated_annotation(f_struct); + } + if (is_deprecated) { indent(f_struct) << "@Deprecated" << endl; } diff --git a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_js_generator.cc b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_js_generator.cc index 1ae8167..61782b9 100644 --- a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_js_generator.cc +++ b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_js_generator.cc @@ -64,7 +64,7 @@ public: bool with_ns_ = false; - for( iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) { + for (iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) { if( iter->first.compare("node") == 0) { gen_node_ = true; } else if( iter->first.compare("jquery") == 0) { @@ -80,10 +80,6 @@ public: } } - if (gen_node_ && gen_ts_) { - throw "Invalid switch: [-gen js:node,ts] options not compatible"; - } - if (gen_es6_ && gen_jquery_) { throw "Invalid switch: [-gen js:es6,jquery] options not compatible"; } @@ -203,6 +199,7 @@ public: */ std::string js_includes(); + std::string ts_includes(); std::string render_includes(); std::string declare_field(t_field* tfield, bool init = false, bool obj = false); std::string function_signature(t_function* tfunction, @@ -285,7 +282,7 @@ public: * TypeScript Definition File helper functions */ - string ts_function_signature(t_function* tfunction, bool include_callback); + string ts_function_signature(t_function* tfunction, bool include_callback, bool optional_callback); string ts_get_type(t_type* type); /** @@ -302,11 +299,11 @@ public: string ts_declare() { return (ts_module_.empty() ? "declare " : ""); } /** - * Returns "?" if the given field is optional. + * Returns "?" if the given field is optional or has a default value. * @param t_field The field to check * @return string */ - string ts_get_req(t_field* field) { return (field->get_req() == t_field::T_OPTIONAL ? "?" : ""); } + string ts_get_req(t_field* field) {return (field->get_req() == t_field::T_OPTIONAL || field->get_value() != NULL ? "?" : ""); } /** * Returns the documentation, if the provided documentable object has one. @@ -415,7 +412,7 @@ void t_js_generator::init_generator() { f_types_ << js_includes() << endl << render_includes() << endl; if (gen_ts_) { - f_types_ts_ << autogen_comment() << endl; + f_types_ts_ << autogen_comment() << ts_includes() << endl; } if (gen_node_) { @@ -457,6 +454,20 @@ string t_js_generator::js_includes() { return ""; } +/** + * Prints standard ts imports + */ +string t_js_generator::ts_includes() { + if (gen_node_) { + return string( + "import thrift = require('thrift');\n" + "import Thrift = thrift.Thrift;\n" + "import Q = thrift.Q;\n"); + } + + return ""; +} + /** * Renders all the imports necessary for including another Thrift program */ @@ -518,8 +529,8 @@ void t_js_generator::generate_enum(t_enum* tenum) { indent_up(); - vector constants = tenum->get_constants(); - vector::iterator c_iter; + vector const& constants = tenum->get_constants(); + vector::const_iterator c_iter; for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) { int value = (*c_iter)->get_value(); if (gen_ts_) { @@ -718,16 +729,15 @@ void t_js_generator::generate_js_struct_definition(ostream& out, if (gen_node_) { string prefix = has_js_namespace(tstruct->get_program()) ? js_namespace(tstruct->get_program()) : js_const_type_; - if (is_exported) { - out << prefix << tstruct->get_name() << " = " - << "module.exports." << tstruct->get_name() << " = function(args) {" << endl; - } else { - out << prefix << tstruct->get_name() << " = function(args) {" - << endl; + out << prefix << tstruct->get_name() << + (is_exported ? " = module.exports." + tstruct->get_name() : ""); + if (gen_ts_) { + f_types_ts_ << ts_print_doc(tstruct) << ts_indent() << ts_declare() << "class " + << tstruct->get_name() << (is_exception ? " extends Thrift.TException" : "") + << " {" << endl; } } else { - out << js_namespace(tstruct->get_program()) << tstruct->get_name() << " = function(args) {" - << endl; + out << js_namespace(tstruct->get_program()) << tstruct->get_name(); if (gen_ts_) { f_types_ts_ << ts_print_doc(tstruct) << ts_indent() << ts_declare() << "class " << tstruct->get_name() << (is_exception ? " extends Thrift.TException" : "") @@ -735,11 +745,28 @@ void t_js_generator::generate_js_struct_definition(ostream& out, } } + if (gen_es6_) { + if (gen_node_ && is_exception) { + out << " = class extends Thrift.TException {" << endl; + } else { + out << " = class {" << endl; + } + indent_up(); + indent(out) << "constructor(args) {" << endl; + } else { + out << " = function(args) {" << endl; + } + indent_up(); + // Call super() method on inherited Error class if (gen_node_ && is_exception) { - out << indent() << "Thrift.TException.call(this, \"" << js_namespace(tstruct->get_program()) + if (gen_es6_) { + indent(out) << "super(args);" << endl; + } else { + indent(out) << "Thrift.TException.call(this, \"" << js_namespace(tstruct->get_program()) << tstruct->get_name() << "\");" << endl; + } out << indent() << "this.name = \"" << js_namespace(tstruct->get_program()) << tstruct->get_name() << "\";" << endl; } @@ -755,8 +782,14 @@ void t_js_generator::generate_js_struct_definition(ostream& out, out << indent() << dval << ";" << endl; } if (gen_ts_) { - f_types_ts_ << ts_indent() << (*m_iter)->get_name() << ": " - << ts_get_type((*m_iter)->get_type()) << ";" << endl; + if (gen_node_) { + f_types_ts_ << ts_indent() << "public " << (*m_iter)->get_name() << ": " + << ts_get_type((*m_iter)->get_type()) << ";" << endl; + } else { + f_types_ts_ << ts_indent() << (*m_iter)->get_name() << ": " + << ts_get_type((*m_iter)->get_type()) << ";" << endl; + } + } } @@ -782,15 +815,17 @@ void t_js_generator::generate_js_struct_definition(ostream& out, } } - out << indent() << "if (args) {" << endl; + indent(out) << "if (args) {" << endl; + indent_up(); if (gen_ts_) { f_types_ts_ << endl << ts_indent() << "constructor(args?: { "; } for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) { t_type* t = get_true_type((*m_iter)->get_type()); - out << indent() << indent() << "if (args." << (*m_iter)->get_name() << " !== undefined && args." << (*m_iter)->get_name() << " !== null) {" - << endl << indent() << indent() << indent() << "this." << (*m_iter)->get_name(); + indent(out) << "if (args." << (*m_iter)->get_name() << " !== undefined && args." << (*m_iter)->get_name() << " !== null) {" << endl; + indent_up(); + indent(out) << "this." << (*m_iter)->get_name(); if (t->is_struct()) { out << (" = new " + js_type_namespace(t->get_program()) + t->get_name() + @@ -829,43 +864,60 @@ void t_js_generator::generate_js_struct_definition(ostream& out, out << " = args." << (*m_iter)->get_name() << ";" << endl; } + indent_down(); if (!(*m_iter)->get_req()) { - out << indent() << indent() << "} else {" << endl << indent() << indent() << indent() - << "throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, " + indent(out) << "} else {" << endl; + indent(out) + << " throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, " "'Required field " << (*m_iter)->get_name() << " is unset!');" << endl; } - out << indent() << indent() << "}" << endl; + indent(out) << "}" << endl; if (gen_ts_) { f_types_ts_ << (*m_iter)->get_name() << ts_get_req(*m_iter) << ": " << ts_get_type((*m_iter)->get_type()) << "; "; } } - + indent_down(); out << indent() << "}" << endl; if (gen_ts_) { f_types_ts_ << "});" << endl; } } + // Done with constructor indent_down(); - out << "};" << endl; + if (gen_es6_) { + indent(out) << "}" << endl << endl; + } else { + indent(out) << "};" << endl; + } + if (gen_ts_) { f_types_ts_ << ts_indent() << "}" << endl; } - if (is_exception) { - out << "Thrift.inherits(" << js_namespace(tstruct->get_program()) << tstruct->get_name() - << ", Thrift.TException);" << endl; - out << js_namespace(tstruct->get_program()) << tstruct->get_name() << ".prototype.name = '" - << tstruct->get_name() << "';" << endl; - } else { - // init prototype - out << js_namespace(tstruct->get_program()) << tstruct->get_name() << ".prototype = {};" - << endl; + if (!gen_es6_) { + if (is_exception) { + out << "Thrift.inherits(" << js_namespace(tstruct->get_program()) << tstruct->get_name() + << ", Thrift.TException);" << endl; + out << js_namespace(tstruct->get_program()) << tstruct->get_name() << ".prototype.name = '" + << tstruct->get_name() << "';" << endl; + } else { + // init prototype manually if we aren't using es6 + out << js_namespace(tstruct->get_program()) << tstruct->get_name() << ".prototype = {};" + << endl; + } + } generate_js_struct_reader(out, tstruct); generate_js_struct_writer(out, tstruct); + + // Close out the class definition + if (gen_es6_) { + indent_down(); + indent(out) << "};" << endl; + } } /** @@ -875,8 +927,12 @@ void t_js_generator::generate_js_struct_reader(ostream& out, t_struct* tstruct) const vector& fields = tstruct->get_members(); vector::const_iterator f_iter; - out << js_namespace(tstruct->get_program()) << tstruct->get_name() - << ".prototype.read = function(input) {" << endl; + if (gen_es6_) { + indent(out) << "read (input) {" << endl; + } else { + indent(out) << js_namespace(tstruct->get_program()) << tstruct->get_name() + << ".prototype.read = function(input) {" << endl; + } indent_up(); @@ -945,7 +1001,12 @@ void t_js_generator::generate_js_struct_reader(ostream& out, t_struct* tstruct) indent(out) << "return;" << endl; indent_down(); - out << indent() << "};" << endl << endl; + + if (gen_es6_) { + indent(out) << "}" << endl << endl; + } else { + indent(out) << "};" << endl << endl; + } } /** @@ -956,8 +1017,12 @@ void t_js_generator::generate_js_struct_writer(ostream& out, t_struct* tstruct) const vector& fields = tstruct->get_members(); vector::const_iterator f_iter; - out << js_namespace(tstruct->get_program()) << tstruct->get_name() - << ".prototype.write = function(output) {" << endl; + if (gen_es6_) { + indent(out) << "write (output) {" << endl; + } else { + indent(out) << js_namespace(tstruct->get_program()) << tstruct->get_name() + << ".prototype.write = function(output) {" << endl; + } indent_up(); @@ -987,7 +1052,11 @@ void t_js_generator::generate_js_struct_writer(ostream& out, t_struct* tstruct) out << indent() << "return;" << endl; indent_down(); - out << indent() << "};" << endl << endl; + if (gen_es6_) { + out << indent() << "}" << endl << endl; + } else { + out << indent() << "};" << endl << endl; + } } /** @@ -1018,6 +1087,39 @@ void t_js_generator::generate_service(t_service* tservice) { << ".d.ts\" />" << endl; } f_service_ts_ << autogen_comment() << endl; + if (gen_node_) { + f_service_ts_ << ts_includes() << endl; + f_service_ts_ << "import ttypes = require('./" + program_->get_name() + "_types');" << endl; + // Generate type aliases + // enum + vector const& enums = program_->get_enums(); + vector::const_iterator e_iter; + for (e_iter = enums.begin(); e_iter != enums.end(); ++e_iter) { + f_service_ts_ << "import " << (*e_iter)->get_name() << " = ttypes." + << js_namespace(program_) << (*e_iter)->get_name() << endl; + } + // const + vector const& consts = program_->get_consts(); + vector::const_iterator c_iter; + for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) { + f_service_ts_ << "import " << (*c_iter)->get_name() << " = ttypes." + << js_namespace(program_) << (*c_iter)->get_name() << endl; + } + // exception + vector const& exceptions = program_->get_xceptions(); + vector::const_iterator x_iter; + for (x_iter = exceptions.begin(); x_iter != exceptions.end(); ++x_iter) { + f_service_ts_ << "import " << (*x_iter)->get_name() << " = ttypes." + << js_namespace(program_) << (*x_iter)->get_name() << endl; + } + // structs + vector const& structs = program_->get_structs(); + vector::const_iterator s_iter; + for (s_iter = structs.begin(); s_iter != structs.end(); ++s_iter) { + f_service_ts_ << "import " << (*s_iter)->get_name() << " = ttypes." + << js_namespace(program_) << (*s_iter)->get_name() << endl; + } + } if (!ts_module_.empty()) { f_service_ts_ << "declare module " << ts_module_ << " {"; } @@ -1064,26 +1166,67 @@ void t_js_generator::generate_service_processor(t_service* tservice) { if (gen_node_) { string prefix = has_js_namespace(tservice->get_program()) ? js_namespace(tservice->get_program()) : js_const_type_; - f_service_ << prefix << service_name_ << "Processor = " << "exports.Processor = function(handler) {" << endl; + f_service_ << prefix << service_name_ << "Processor = " << "exports.Processor"; + if (gen_ts_) { + f_service_ts_ << endl << "declare class Processor "; + if (tservice->get_extends() != NULL) { + f_service_ts_ << "extends " << tservice->get_extends()->get_name() << "Processor "; + } + f_service_ts_ << "{" << endl; + indent_up(); + f_service_ts_ << ts_indent() << "private _handler: Object;" << endl << endl; + f_service_ts_ << ts_indent() << "constructor(handler: Object);" << endl; + f_service_ts_ << ts_indent() << "process(input: Thrift.TJSONProtocol, output: Thrift.TJSONProtocol): void;" << endl; + indent_down(); + } } else { f_service_ << js_namespace(tservice->get_program()) << service_name_ << "Processor = " - << "exports.Processor = function(handler) {" << endl; + << "exports.Processor"; + } + + bool is_subclass_service = tservice->get_extends() != NULL; + + // ES6 Constructor + if (gen_es6_) { + if (is_subclass_service) { + f_service_ << " = class extends " << tservice->get_extends()->get_name() << "Processor {" << endl; + } else { + f_service_ << " = class {" << endl; + } + indent_up(); + indent(f_service_) << "constructor(handler) {" << endl; + } else { + f_service_ << " = function(handler) {" << endl; } indent_up(); + if (gen_es6_ && is_subclass_service) { + indent(f_service_) << "super(handler);" << endl; + } indent(f_service_) << "this._handler = handler;" << endl; indent_down(); - f_service_ << "};" << endl; - if (tservice->get_extends() != NULL) { + // Done with constructor + if (gen_es6_) { + indent(f_service_) << "}" << endl; + } else { + indent(f_service_) << "};" << endl; + } + + // ES5 service inheritance + if (!gen_es6_ && is_subclass_service) { indent(f_service_) << "Thrift.inherits(" << js_namespace(tservice->get_program()) << service_name_ << "Processor, " << tservice->get_extends()->get_name() << "Processor);" << endl; } // Generate the server implementation - indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ - << "Processor.prototype.process = function(input, output) {" << endl; + if (gen_es6_) { + indent(f_service_) << "process (input, output) {" << endl; + } else { + indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ + << "Processor.prototype.process = function(input, output) {" << endl; + } indent_up(); @@ -1101,12 +1244,25 @@ void t_js_generator::generate_service_processor(t_service* tservice) { << indent() << "}" << endl; indent_down(); - f_service_ << "};" << endl; + if (gen_es6_) { + indent(f_service_) << "}" << endl; + } else { + indent(f_service_) << "};" << endl; + } // Generate the process subfunctions for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) { generate_process_function(tservice, *f_iter); } + + // Close off the processor class definition + if (gen_es6_) { + indent_down(); + indent(f_service_) << "};" << endl; + } + if (gen_node_ && gen_ts_) { + f_service_ts_ << "}" << endl; + } } /** @@ -1115,9 +1271,18 @@ void t_js_generator::generate_service_processor(t_service* tservice) { * @param tfunction The function to write a dispatcher for */ void t_js_generator::generate_process_function(t_service* tservice, t_function* tfunction) { - indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ - << "Processor.prototype.process_" + tfunction->get_name() - + " = function(seqid, input, output) {" << endl; + if (gen_es6_) { + indent(f_service_) << "process_" + tfunction->get_name() + " (seqid, input, output) {" << endl; + } else { + indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ + << "Processor.prototype.process_" + tfunction->get_name() + + " = function(seqid, input, output) {" << endl; + } + if (gen_ts_) { + indent_up(); + f_service_ts_ << ts_indent() << "process_" << tfunction->get_name() << "(seqid: number, input: Thrift.TJSONProtocol, output: Thrift.TJSONProtocol): void;" << endl; + indent_down(); + } indent_up(); @@ -1149,10 +1314,16 @@ void t_js_generator::generate_process_function(t_service* tservice, t_function* f_service_ << ");" << endl; indent_down(); - f_service_ << "};" << endl; + + if (gen_es6_) { + indent(f_service_) << "}" << endl; + } else { + indent(f_service_) << "};" << endl; + } return; } + // Promise style invocation indent(f_service_) << "if (this._handler." << tfunction->get_name() << ".length === " << fields.size() << ") {" << endl; indent_up(); @@ -1173,7 +1344,7 @@ void t_js_generator::generate_process_function(t_service* tservice, t_function* indent_down(); if (gen_es6_) { - indent(f_service_) << ")).then(function(result) {" << endl; + indent(f_service_) << ")).then(result => {" << endl; } else { indent(f_service_) << ").then(function(result) {" << endl; } @@ -1186,7 +1357,11 @@ void t_js_generator::generate_process_function(t_service* tservice, t_function* << indent() << "output.flush();" << endl; indent_down(); - indent(f_service_) << "}).catch(function (err) {" << endl; + if (gen_es6_) { + indent(f_service_) << "}).catch(err => {" << endl; + } else { + indent(f_service_) << "}).catch(function (err) {" << endl; + } indent_up(); indent(f_service_) << js_let_type_ << "result;" << endl; @@ -1236,6 +1411,9 @@ void t_js_generator::generate_process_function(t_service* tservice, t_function* indent_down(); indent(f_service_) << "});" << endl; indent_down(); + // End promise style invocation + + // Callback style invocation indent(f_service_) << "} else {" << endl; indent_up(); indent(f_service_) << "this._handler." << tfunction->get_name() << "("; @@ -1244,7 +1422,11 @@ void t_js_generator::generate_process_function(t_service* tservice, t_function* f_service_ << "args." << (*f_iter)->get_name() << ", "; } - f_service_ << "function (err, result) {" << endl; + if (gen_es6_) { + f_service_ << "(err, result) => {" << endl; + } else { + f_service_ << "function (err, result) {" << endl; + } indent_up(); indent(f_service_) << js_let_type_ << "result_obj;" << endl; @@ -1279,8 +1461,15 @@ void t_js_generator::generate_process_function(t_service* tservice, t_function* indent(f_service_) << "});" << endl; indent_down(); indent(f_service_) << "}" << endl; + // End callback style invocation + indent_down(); - indent(f_service_) << "};" << endl; + + if (gen_es6_) { + indent(f_service_) << "}" << endl; + } else { + indent(f_service_) << "};" << endl; + } } /** @@ -1354,33 +1543,73 @@ void t_js_generator::generate_service_rest(t_service* tservice) { * @param tservice The service to generate a server for. */ void t_js_generator::generate_service_client(t_service* tservice) { + + bool is_subclass_service = tservice->get_extends() != NULL; + if (gen_node_) { string prefix = has_js_namespace(tservice->get_program()) ? js_namespace(tservice->get_program()) : js_const_type_; - f_service_ << prefix << service_name_ << "Client = " - << "exports.Client = function(output, pClass) {" << endl; + f_service_ << prefix << service_name_ << "Client = " << "exports.Client"; + if (gen_ts_) { + f_service_ts_ << ts_print_doc(tservice) << ts_indent() << ts_declare() << "class " + << "Client "; + if (tservice->get_extends() != NULL) { + f_service_ts_ << "extends " << tservice->get_extends()->get_name() << "Client "; + } + f_service_ts_ << "{" << endl; + } } else { f_service_ << js_namespace(tservice->get_program()) << service_name_ - << "Client = function(input, output) {" << endl; + << "Client"; if (gen_ts_) { f_service_ts_ << ts_print_doc(tservice) << ts_indent() << ts_declare() << "class " << service_name_ << "Client "; - if (tservice->get_extends() != NULL) { + if (is_subclass_service) { f_service_ts_ << "extends " << tservice->get_extends()->get_name() << "Client "; } f_service_ts_ << "{" << endl; } } + // ES6 Constructor + if (gen_es6_) { + if (is_subclass_service) { + f_service_ << " = class extends " << js_namespace(tservice->get_extends()->get_program()) + << tservice->get_extends()->get_name() << "Client {" << endl; + } else { + f_service_ << " = class {" << endl; + } + indent_up(); + if (gen_node_) { + indent(f_service_) << "constructor(output, pClass) {" << endl; + } else { + indent(f_service_) << "constructor(input, output) {" << endl; + } + } else { + if (gen_node_) { + f_service_ << " = function(output, pClass) {" << endl; + } else { + f_service_ << " = function(input, output) {" << endl; + } + } + indent_up(); if (gen_node_) { - f_service_ << indent() << " this.output = output;" << endl << indent() - << " this.pClass = pClass;" << endl << indent() << " this._seqid = 0;" << endl - << indent() << " this._reqs = {};" << endl; + indent(f_service_) << "this.output = output;" << endl; + indent(f_service_) << "this.pClass = pClass;" << endl; + indent(f_service_) << "this._seqid = 0;" << endl; + indent(f_service_) << "this._reqs = {};" << endl; + if (gen_ts_) { + f_service_ts_ << ts_indent() << "private input: Thrift.TJSONProtocol;" << endl << ts_indent() + << "private output: Thrift.TJSONProtocol;" << endl << ts_indent() << "private seqid: number;" + << endl << endl << ts_indent() + << "constructor(input: Thrift.TJSONProtocol, output?: Thrift.TJSONProtocol);" + << endl; + } } else { - f_service_ << indent() << " this.input = input;" << endl << indent() - << " this.output = (!output) ? input : output;" << endl << indent() - << " this.seqid = 0;" << endl; + indent(f_service_) << "this.input = input;" << endl; + indent(f_service_) << "this.output = (!output) ? input : output;" << endl; + indent(f_service_) << "this.seqid = 0;" << endl; if (gen_ts_) { f_service_ts_ << ts_indent() << "input: Thrift.TJSONProtocol;" << endl << ts_indent() << "output: Thrift.TJSONProtocol;" << endl << ts_indent() << "seqid: number;" @@ -1392,27 +1621,36 @@ void t_js_generator::generate_service_client(t_service* tservice) { indent_down(); - f_service_ << indent() << "};" << endl; - - if (tservice->get_extends() != NULL) { - indent(f_service_) << "Thrift.inherits(" << js_namespace(tservice->get_program()) - << service_name_ << "Client, " - << js_namespace(tservice->get_extends()->get_program()) - << tservice->get_extends()->get_name() << "Client);" << endl; + if (gen_es6_) { + indent(f_service_) << "}" << endl; } else { - // init prototype - indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ - << "Client.prototype = {};" << endl; + indent(f_service_) << "};" << endl; + if (is_subclass_service) { + indent(f_service_) << "Thrift.inherits(" << js_namespace(tservice->get_program()) + << service_name_ << "Client, " + << js_namespace(tservice->get_extends()->get_program()) + << tservice->get_extends()->get_name() << "Client);" << endl; + } else { + // init prototype + indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ + << "Client.prototype = {};" << endl; + } } // utils for multiplexed services if (gen_node_) { - indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ - << "Client.prototype.seqid = function() { return this._seqid; };" << endl - << js_namespace(tservice->get_program()) << service_name_ - << "Client.prototype.new_seqid = function() { return this._seqid += 1; };" - << endl; + if (gen_es6_) { + indent(f_service_) << "seqid () { return this._seqid; }" << endl; + indent(f_service_) << "new_seqid () { return this._seqid += 1; }" << endl; + } else { + indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ + << "Client.prototype.seqid = function() { return this._seqid; };" << endl + << js_namespace(tservice->get_program()) << service_name_ + << "Client.prototype.new_seqid = function() { return this._seqid += 1; };" + << endl; + } } + // Generate client method implementations vector functions = tservice->get_functions(); vector::const_iterator f_iter; @@ -1424,42 +1662,41 @@ void t_js_generator::generate_service_client(t_service* tservice) { string arglist = argument_list(arg_struct); // Open function - f_service_ << js_namespace(tservice->get_program()) << service_name_ << "Client.prototype." - << function_signature(*f_iter, "", !gen_es6_) << " {" << endl; + f_service_ << endl; + if (gen_es6_) { + indent(f_service_) << funname << " (" << arglist << ") {" << endl; + } else { + indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ << "Client.prototype." + << function_signature(*f_iter, "", !gen_es6_) << " {" << endl; + } indent_up(); if (gen_ts_) { // function definition without callback - f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, false) << endl; - + f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, false, false) << endl; if (!gen_es6_) { // overload with callback - f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true) << endl; + f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true, false) << endl; + } else { + // overload with callback + f_service_ts_ << ts_print_doc(*f_iter) << ts_indent() << ts_function_signature(*f_iter, true, true) << endl; } } if (gen_es6_ && gen_node_) { - f_service_ << indent() << "this._seqid = this.new_seqid();" << endl; - f_service_ << indent() << js_const_type_ << "self = this;" << endl << indent() - << "return new Promise(function(resolve, reject) {" << endl; + indent(f_service_) << "this._seqid = this.new_seqid();" << endl; + indent(f_service_) << js_const_type_ << "self = this;" << endl << indent() + << "return new Promise((resolve, reject) => {" << endl; indent_up(); - f_service_ << indent() << "self._reqs[self.seqid()] = function(error, result) {" << endl; + indent(f_service_) << "self._reqs[self.seqid()] = (error, result) => {" << endl; indent_up(); - indent(f_service_) << "if (error) {" << endl; - indent_up(); - indent(f_service_) << "reject(error);" << endl; - indent_down(); - indent(f_service_) << "} else {" << endl; - indent_up(); - indent(f_service_) << "resolve(result);" << endl; - indent_down(); - indent(f_service_) << "}" << endl; + indent(f_service_) << "return error ? reject(error) : resolve(result);" << endl; indent_down(); indent(f_service_) << "};" << endl; - f_service_ << indent() << "self.send_" << funname << "(" << arglist << ");" << endl; + indent(f_service_) << "self.send_" << funname << "(" << arglist << ");" << endl; indent_down(); - f_service_ << indent() << "});" << endl; + indent(f_service_) << "});" << endl; } else if (gen_node_) { // Node.js output ./gen-nodejs f_service_ << indent() << "this._seqid = this.new_seqid();" << endl << indent() << "if (callback === undefined) {" << endl; @@ -1489,16 +1726,12 @@ void t_js_generator::generate_service_client(t_service* tservice) { indent(f_service_) << "}" << endl; } else if (gen_es6_) { f_service_ << indent() << js_const_type_ << "self = this;" << endl << indent() - << "return new Promise(function(resolve, reject) {" << endl; + << "return new Promise((resolve, reject) => {" << endl; indent_up(); f_service_ << indent() << "self.send_" << funname << "(" << arglist - << (arglist.empty() ? "" : ", ") << "function(error, result) {" << endl; + << (arglist.empty() ? "" : ", ") << "(error, result) => {" << endl; indent_up(); - f_service_ << indent() << "if (error) {" << endl; - f_service_ << indent() << " reject(error);" << endl; - f_service_ << indent() << "} else {" << endl; - f_service_ << indent() << " resolve(result);" << endl; - f_service_ << indent() << "}" << endl; + indent(f_service_) << "return error ? reject(error) : resolve(result);" << endl; indent_down(); f_service_ << indent() << "});" << endl; indent_down(); @@ -1543,11 +1776,24 @@ void t_js_generator::generate_service_client(t_service* tservice) { indent_down(); - f_service_ << "};" << endl << endl; + if (gen_es6_) { + indent(f_service_) << "}" << endl << endl; + } else { + indent(f_service_) << "};" << endl << endl; + } // Send function - f_service_ << js_namespace(tservice->get_program()) << service_name_ << "Client.prototype.send_" - << function_signature(*f_iter, "", !gen_node_) << " {" << endl; + if (gen_es6_) { + if (gen_node_) { + indent(f_service_) << "send_" << funname << " (" << arglist << ") {" << endl; + } else { + // ES6 js still uses callbacks here. Should refactor this to promise style later.. + indent(f_service_) << "send_" << funname << " (" << argument_list(arg_struct, true) << ") {" << endl; + } + } else { + indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ << "Client.prototype.send_" + << function_signature(*f_iter, "", !gen_node_) << " {" << endl; + } indent_up(); @@ -1567,23 +1813,25 @@ void t_js_generator::generate_service_client(t_service* tservice) { // Build args if (fields.size() > 0){ f_service_ << indent() << js_const_type_ << "params = {" << endl; + indent_up(); for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) { - f_service_ << indent() << indent() << (*fld_iter)->get_name() << ": " << (*fld_iter)->get_name(); + indent(f_service_) << (*fld_iter)->get_name() << ": " << (*fld_iter)->get_name(); if (fld_iter != fields.end()-1) { f_service_ << "," << endl; } else { f_service_ << endl; } } - f_service_ << indent() << "};" << endl; - f_service_ << indent() << js_const_type_ << "args = new " << argsname << "(params);" << endl; + indent_down(); + indent(f_service_) << "};" << endl; + indent(f_service_) << js_const_type_ << "args = new " << argsname << "(params);" << endl; } else { - f_service_ << indent() << js_const_type_ << "args = new " << argsname << "();" << endl; + indent(f_service_) << js_const_type_ << "args = new " << argsname << "();" << endl; } // Serialize the request header within try/catch - f_service_ << indent() << "try {" << endl; + indent(f_service_) << "try {" << endl; indent_up(); if (gen_node_) { @@ -1617,7 +1865,7 @@ void t_js_generator::generate_service_client(t_service* tservice) { f_service_ << indent() << "this.output.getTransport().flush(true, null);" << endl; f_service_ << indent() << "callback();" << endl; } else { - f_service_ << indent() << "this.output.getTransport().flush(true, function() {" << endl; + f_service_ << indent() << "this.output.getTransport().flush(true, () => {" << endl; indent_up(); f_service_ << indent() << js_let_type_ << "error = null, result = null;" << endl; f_service_ << indent() << "try {" << endl; @@ -1627,7 +1875,7 @@ void t_js_generator::generate_service_client(t_service* tservice) { f_service_ << indent() << "}" << endl; f_service_ << indent() << "callback(error, result);" << endl; indent_down(); - f_service_ << indent() << "});"; + f_service_ << indent() << "});" << endl; } } else { f_service_ << indent() << "if (callback) {" << endl; @@ -1678,26 +1926,40 @@ void t_js_generator::generate_service_client(t_service* tservice) { indent_down(); - f_service_ << "};" << endl; + // Close send function + if (gen_es6_) { + indent(f_service_) << "}" << endl; + } else { + indent(f_service_) << "};" << endl; + } + // Receive function if (!(*f_iter)->is_oneway()) { std::string resultname = js_namespace(tservice->get_program()) + service_name_ + "_" + (*f_iter)->get_name() + "_result"; + f_service_ << endl; + // Open receive function if (gen_node_) { - // Open function - f_service_ << endl << js_namespace(tservice->get_program()) << service_name_ - << "Client.prototype.recv_" << (*f_iter)->get_name() - << " = function(input,mtype,rseqid) {" << endl; + if (gen_es6_) { + indent(f_service_) << "recv_" << (*f_iter)->get_name() << " (input, mtype, rseqid) {" << endl; + } else { + indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ + << "Client.prototype.recv_" << (*f_iter)->get_name() + << " = function(input,mtype,rseqid) {" << endl; + } } else { - t_struct noargs(program_); + if (gen_es6_) { + indent(f_service_) << "recv_" << (*f_iter)->get_name() << " () {" << endl; + } else { + t_struct noargs(program_); - t_function recv_function((*f_iter)->get_returntype(), - string("recv_") + (*f_iter)->get_name(), - &noargs); - // Open function - f_service_ << endl << js_namespace(tservice->get_program()) << service_name_ - << "Client.prototype." << function_signature(&recv_function) << " {" << endl; + t_function recv_function((*f_iter)->get_returntype(), + string("recv_") + (*f_iter)->get_name(), + &noargs); + indent(f_service_) << js_namespace(tservice->get_program()) << service_name_ + << "Client.prototype." << function_signature(&recv_function) << " {" << endl; + } } indent_up(); @@ -1755,15 +2017,24 @@ void t_js_generator::generate_service_client(t_service* tservice) { } } - // Close function + // Close receive function indent_down(); - f_service_ << "};" << endl; + if (gen_es6_) { + indent(f_service_) << "}" << endl; + } else { + indent(f_service_) << "};" << endl; + } } } + // Finish class definitions if (gen_ts_) { f_service_ts_ << ts_indent() << "}" << endl; } + if (gen_es6_) { + indent_down(); + f_service_ << "};" << endl; + } } std::string t_js_generator::render_recv_throw(std::string var) { @@ -2351,7 +2622,7 @@ string t_js_generator::ts_get_type(t_type* type) { * @param bool in-/exclude the callback argument * @return String of rendered function definition */ -std::string t_js_generator::ts_function_signature(t_function* tfunction, bool include_callback) { +std::string t_js_generator::ts_function_signature(t_function* tfunction, bool include_callback, bool optional_callback) { string str; const vector& fields = tfunction->get_arglist()->get_members(); vector::const_iterator f_iter; @@ -2367,7 +2638,29 @@ std::string t_js_generator::ts_function_signature(t_function* tfunction, bool in } if (include_callback) { - str += "callback: (data: " + ts_get_type(tfunction->get_returntype()) + ")=>void): "; + string callback_optional_string = optional_callback ? "?" : ""; + if (gen_node_) { + t_struct* exceptions = tfunction->get_xceptions(); + string exception_types; + if (exceptions) { + const vector& members = exceptions->get_members(); + for (vector::const_iterator it = members.begin(); it != members.end(); ++it) { + t_type* t = get_true_type((*it)->get_type()); + if (it == members.begin()) { + exception_types = t->get_name(); + } else { + exception_types += " | " + t->get_name(); + } + } + } + if (exception_types == "") { + str += "callback" + callback_optional_string + ": (error: void, response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): "; + } else { + str += "callback" + callback_optional_string + ": (error: " + exception_types + ", response: " + ts_get_type(tfunction->get_returntype()) + ")=>void): "; + } + } else { + str += "callback" + callback_optional_string + ": (data: " + ts_get_type(tfunction->get_returntype()) + ")=>void): "; + } if (gen_jquery_) { str += "JQueryPromise<" + ts_get_type(tfunction->get_returntype()) +">;"; diff --git a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_perl_generator.cc b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_perl_generator.cc index 5a308cf..8924a76 100644 --- a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_perl_generator.cc +++ b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_perl_generator.cc @@ -354,7 +354,7 @@ string t_perl_generator::render_const_value(t_type* type, t_const_value* value) } else if (type->is_enum()) { out << value->get_integer(); } else if (type->is_struct() || type->is_xception()) { - out << "new " << perl_namespace(type->get_program()) << type->get_name() << "({" << endl; + out << perl_namespace(type->get_program()) << type->get_name() << "->new({" << endl; indent_up(); const vector& fields = ((t_struct*)type)->get_members(); @@ -546,7 +546,7 @@ void t_perl_generator::generate_perl_struct_reader(ostream& out, t_struct* tstru indent(out) << "$xfer += $input->readStructBegin(\\$fname);" << endl; // Loop over reading in fields - indent(out) << "while (1) " << endl; + indent(out) << "while (1)" << endl; scope_up(out); @@ -758,7 +758,7 @@ void t_perl_generator::generate_service_processor(t_service* tservice) { f_service_ << indent() << "$input->skip(Thrift::TType::STRUCT);" << endl << indent() << "$input->readMessageEnd();" << endl << indent() - << "my $x = new Thrift::TApplicationException('Function '.$fname.' not implemented.', " + << "my $x = Thrift::TApplicationException->new('Function '.$fname.' not implemented.', " "Thrift::TApplicationException::UNKNOWN_METHOD);" << endl << indent() << "$output->writeMessageBegin($fname, Thrift::TMessageType::EXCEPTION, $rseqid);" << endl << indent() << "$x->write($output);" << endl << indent() @@ -798,7 +798,7 @@ void t_perl_generator::generate_process_function(t_service* tservice, t_function string resultname = perl_namespace(tservice->get_program()) + service_name_ + "_" + tfunction->get_name() + "_result"; - f_service_ << indent() << "my $args = new " << argsname << "();" << endl << indent() + f_service_ << indent() << "my $args = " << argsname << "->new();" << endl << indent() << "$args->read($input);" << endl; f_service_ << indent() << "$input->readMessageEnd();" << endl; @@ -809,7 +809,7 @@ void t_perl_generator::generate_process_function(t_service* tservice, t_function // Declare result for non oneway function if (!tfunction->is_oneway()) { - f_service_ << indent() << "my $result = new " << resultname << "();" << endl; + f_service_ << indent() << "my $result = " << resultname << "->new();" << endl; } // Try block for a function with exceptions @@ -858,7 +858,7 @@ void t_perl_generator::generate_process_function(t_service* tservice, t_function f_service_ << indent() << "if ($@) {" << endl; indent_up(); f_service_ << indent() << "$@ =~ s/^\\s+|\\s+$//g;" << endl - << indent() << "my $err = new Thrift::TApplicationException(\"Unexpected Exception: \" . $@, Thrift::TApplicationException::INTERNAL_ERROR);" << endl + << indent() << "my $err = Thrift::TApplicationException->new(\"Unexpected Exception: \" . $@, Thrift::TApplicationException::INTERNAL_ERROR);" << endl << indent() << "$output->writeMessageBegin('" << tfunction->get_name() << "', Thrift::TMessageType::EXCEPTION, $seqid);" << endl << indent() << "$err->write($output);" << endl << indent() << "$output->writeMessageEnd();" << endl @@ -1106,7 +1106,7 @@ void t_perl_generator::generate_service_client(t_service* tservice) { << "', " << ((*f_iter)->is_oneway() ? "Thrift::TMessageType::ONEWAY" : "Thrift::TMessageType::CALL") << ", $self->{seqid});" << endl; - f_service_ << indent() << "my $args = new " << argsname << "();" << endl; + f_service_ << indent() << "my $args = " << argsname << "->new();" << endl; for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) { f_service_ << indent() << "$args->{" << (*fld_iter)->get_name() << "} = $" @@ -1140,12 +1140,12 @@ void t_perl_generator::generate_service_client(t_service* tservice) { f_service_ << indent() << "$self->{input}->readMessageBegin(\\$fname, \\$mtype, \\$rseqid);" << endl << indent() << "if ($mtype == Thrift::TMessageType::EXCEPTION) {" << endl - << indent() << " my $x = new Thrift::TApplicationException();" << endl << indent() + << indent() << " my $x = Thrift::TApplicationException->new();" << endl << indent() << " $x->read($self->{input});" << endl << indent() << " $self->{input}->readMessageEnd();" << endl << indent() << " die $x;" << endl << indent() << "}" << endl; - f_service_ << indent() << "my $result = new " << resultname << "();" << endl << indent() + f_service_ << indent() << "my $result = " << resultname << "->new();" << endl << indent() << "$result->read($self->{input});" << endl; f_service_ << indent() << "$self->{input}->readMessageEnd();" << endl << endl; @@ -1586,7 +1586,7 @@ string t_perl_generator::declare_field(t_field* tfield, bool init, bool obj) { result += " = []"; } else if (type->is_struct() || type->is_xception()) { if (obj) { - result += " = new " + perl_namespace(type->get_program()) + type->get_name() + "()"; + result += " = " + perl_namespace(type->get_program()) + type->get_name() + "->new()"; } else { result += " = undef"; } diff --git a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_py_generator.cc b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_py_generator.cc index 9c82b6c..f0a153c 100644 --- a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_py_generator.cc +++ b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_py_generator.cc @@ -1961,8 +1961,10 @@ void t_py_generator::generate_process_function(t_service* tservice, t_function* indent(f_service_) << "def write_results_success_" << tfunction->get_name() << "(self, success, result, seqid, oprot):" << endl; indent_up(); - f_service_ << indent() << "result.success = success" << endl - << indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name() + if (!tfunction->get_returntype()->is_void()) { + f_service_ << indent() << "result.success = success" << endl; + } + f_service_ << indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name() << "\", TMessageType.REPLY, seqid)" << endl << indent() << "result.write(oprot)" << endl << indent() << "oprot.writeMessageEnd()" << endl diff --git a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_rs_generator.cc b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_rs_generator.cc index dc11fd3..9843d7a 100644 --- a/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_rs_generator.cc +++ b/vendor/git.apache.org/thrift.git/compiler/cpp/src/thrift/generate/t_rs_generator.cc @@ -127,7 +127,7 @@ private: void render_const_value_holder(const string& name, t_type* ttype, t_const_value* tvalue); // Write the actual const value - the right side of a const definition. - void render_const_value(t_type* ttype, t_const_value* tvalue); + void render_const_value(t_type* ttype, t_const_value* tvalue, bool is_owned = true); // Write a const struct (returned from `const_value` method). void render_const_struct(t_type* ttype, t_const_value* tvalue); @@ -355,8 +355,8 @@ private: string handler_successful_return_struct(t_function* tfunc); - // Writes the result of `render_rift_error_struct` wrapped in an `Err(thrift::Error(...))`. - void render_rift_error( + // Writes the result of `render_thrift_error_struct` wrapped in an `Err(thrift::Error(...))`. + void render_thrift_error( const string& error_kind, const string& error_struct, const string& sub_error_kind, @@ -377,7 +377,7 @@ private: // message: "This is some error message", // } // ``` - void render_rift_error_struct( + void render_thrift_error_struct( const string& error_struct, const string& sub_error_kind, const string& error_message @@ -411,6 +411,9 @@ private: // Return a string representing the rust type given a `t_type`. string to_rust_type(t_type* ttype, bool ordered_float = true); + // Return a string representing the `const` rust type given a `t_type` + string to_rust_const_type(t_type* ttype, bool ordered_float = true); + // Return a string representing the rift `protocol::TType` given a `t_type`. string to_rust_field_type_enum(t_type* ttype); @@ -499,6 +502,9 @@ private: // the server half of a Thrift service. string rust_sync_processor_impl_name(t_service *tservice); + // Return the variant name for an enum variant + string rust_enum_variant_name(const string& name); + // Properly uppercase names for use in Rust. string rust_upper_case(const string& name); @@ -645,8 +651,8 @@ void t_rs_generator::render_const_value(const string& name, t_type* ttype, t_con throw "cannot generate simple rust constant for " + ttype->get_name(); } - f_gen_ << "pub const " << rust_upper_case(name) << ": " << to_rust_type(ttype) << " = "; - render_const_value(ttype, tvalue); + f_gen_ << "pub const " << rust_upper_case(name) << ": " << to_rust_const_type(ttype) << " = "; + render_const_value(ttype, tvalue, false); f_gen_ << ";" << endl; f_gen_ << endl; } @@ -673,15 +679,22 @@ void t_rs_generator::render_const_value_holder(const string& name, t_type* ttype f_gen_ << endl; } -void t_rs_generator::render_const_value(t_type* ttype, t_const_value* tvalue) { +void t_rs_generator::render_const_value(t_type* ttype, t_const_value* tvalue, bool is_owned) { if (ttype->is_base_type()) { t_base_type* tbase_type = (t_base_type*)ttype; switch (tbase_type->get_base()) { case t_base_type::TYPE_STRING: if (tbase_type->is_binary()) { - f_gen_ << "\"" << tvalue->get_string() << "\""<< ".to_owned().into_bytes()"; + if (is_owned) { + f_gen_ << "\"" << tvalue->get_string() << "\""<< ".to_owned().into_bytes()"; + } else { + f_gen_ << "b\"" << tvalue->get_string() << "\""; + } } else { - f_gen_ << "\"" << tvalue->get_string() << "\""<< ".to_owned()"; + f_gen_ << "\"" << tvalue->get_string() << "\""; + if (is_owned) { + f_gen_ << ".to_owned()"; + } } break; case t_base_type::TYPE_BOOL: @@ -873,7 +886,7 @@ void t_rs_generator::render_enum_definition(t_enum* tenum, const string& enum_na render_rustdoc((t_doc*) val); f_gen_ << indent() - << uppercase(val->get_name()) + << rust_enum_variant_name(val->get_name()) << " = " << val->get_value() << "," @@ -934,12 +947,12 @@ void t_rs_generator::render_enum_conversion(t_enum* tenum, const string& enum_na f_gen_ << indent() << val->get_value() - << " => Ok(" << enum_name << "::" << uppercase(val->get_name()) << ")," + << " => Ok(" << enum_name << "::" << rust_enum_variant_name(val->get_name()) << ")," << endl; } f_gen_ << indent() << "_ => {" << endl; indent_up(); - render_rift_error( + render_thrift_error( "Protocol", "ProtocolError", "ProtocolErrorKind::InvalidData", @@ -1320,7 +1333,7 @@ void t_rs_generator::render_result_struct_to_result_method(t_struct* tstruct) { indent_up(); // if we haven't found a valid return value *or* a user exception // then we're in trouble; return a default error - render_rift_error( + render_thrift_error( "Application", "ApplicationError", "ApplicationErrorKind::MissingResult", @@ -1854,7 +1867,7 @@ void t_rs_generator::render_union_sync_read(const string &union_name, t_struct * // return the value or an error f_gen_ << indent() << "if received_field_count == 0 {" << endl; indent_up(); - render_rift_error( + render_thrift_error( "Protocol", "ProtocolError", "ProtocolErrorKind::InvalidData", @@ -1863,7 +1876,7 @@ void t_rs_generator::render_union_sync_read(const string &union_name, t_struct * indent_down(); f_gen_ << indent() << "} else if received_field_count > 1 {" << endl; indent_up(); - render_rift_error( + render_thrift_error( "Protocol", "ProtocolError", "ProtocolErrorKind::InvalidData", @@ -2565,7 +2578,7 @@ void t_rs_generator::render_sync_processor_definition_and_impl(t_service *tservi render_process_match_statements(tservice); f_gen_ << indent() << "method => {" << endl; indent_up(); - render_rift_error( + render_thrift_error( "Application", "ApplicationError", "ApplicationErrorKind::UnknownMethod", @@ -2844,7 +2857,7 @@ void t_rs_generator::render_sync_handler_failed_user_exception_branch(t_function f_gen_ << indent() << "let ret_err = {" << endl; indent_up(); - render_rift_error_struct("ApplicationError", "ApplicationErrorKind::Unknown", "usr_err.description()"); + render_thrift_error_struct("ApplicationError", "ApplicationErrorKind::Unknown", "usr_err.description()"); indent_down(); f_gen_ << indent() << "};" << endl; render_sync_handler_send_exception_response(tfunc, "ret_err"); @@ -2867,7 +2880,7 @@ void t_rs_generator::render_sync_handler_failed_application_exception_branch( void t_rs_generator::render_sync_handler_failed_default_exception_branch(t_function *tfunc) { f_gen_ << indent() << "let ret_err = {" << endl; indent_up(); - render_rift_error_struct("ApplicationError", "ApplicationErrorKind::Unknown", "e.description()"); + render_thrift_error_struct("ApplicationError", "ApplicationErrorKind::Unknown", "e.description()"); indent_down(); f_gen_ << indent() << "};" << endl; if (tfunc->is_oneway()) { @@ -2944,7 +2957,7 @@ void t_rs_generator::render_rustdoc(t_doc* tdoc) { generate_docstring_comment(f_gen_, "", "/// ", tdoc->get_doc(), ""); } -void t_rs_generator::render_rift_error( +void t_rs_generator::render_thrift_error( const string& error_kind, const string& error_struct, const string& sub_error_kind, @@ -2954,14 +2967,14 @@ void t_rs_generator::render_rift_error( indent_up(); f_gen_ << indent() << "thrift::Error::" << error_kind << "(" << endl; indent_up(); - render_rift_error_struct(error_struct, sub_error_kind, error_message); + render_thrift_error_struct(error_struct, sub_error_kind, error_message); indent_down(); f_gen_ << indent() << ")" << endl; indent_down(); f_gen_ << indent() << ")" << endl; } -void t_rs_generator::render_rift_error_struct( +void t_rs_generator::render_thrift_error_struct( const string& error_struct, const string& sub_error_kind, const string& error_message @@ -3022,7 +3035,7 @@ string t_rs_generator::to_rust_type(t_type* ttype, bool ordered_float) { rust_type = ttypedef->is_forward_typedef() ? "Box<" + rust_type + ">" : rust_type; return rust_type; } else if (ttype->is_enum()) { - return rust_namespace(ttype) + ttype->get_name(); + return rust_namespace(ttype) + rust_camel_case(ttype->get_name()); } else if (ttype->is_struct() || ttype->is_xception()) { return rust_namespace(ttype) + rust_camel_case(ttype->get_name()); } else if (ttype->is_map()) { @@ -3039,6 +3052,21 @@ string t_rs_generator::to_rust_type(t_type* ttype, bool ordered_float) { throw "cannot find rust type for " + ttype->get_name(); } +string t_rs_generator::to_rust_const_type(t_type* ttype, bool ordered_float) { + if (ttype->is_base_type()) { + t_base_type* tbase_type = ((t_base_type*)ttype); + if (tbase_type->get_base() == t_base_type::TYPE_STRING) { + if (tbase_type->is_binary()) { + return "&[u8]"; + } else { + return "&str"; + } + } + } + + return to_rust_type(ttype, ordered_float); +} + string t_rs_generator::to_rust_field_type_enum(t_type* ttype) { ttype = get_true_type(ttype); if (ttype->is_base_type()) { @@ -3254,6 +3282,23 @@ string t_rs_generator::rust_sync_processor_impl_name(t_service *tservice) { return "T" + rust_camel_case(tservice->get_name()) + "ProcessFunctions"; } +string t_rs_generator::rust_enum_variant_name(const string &name) { + bool all_uppercase = true; + + for (size_t i = 0; i < name.size(); i++) { + if (isalnum(name[i]) && islower(name[i])) { + all_uppercase = false; + break; + } + } + + if (all_uppercase) { + return capitalize(camelcase(lowercase(name))); + } else { + return capitalize(camelcase(name)); + } +} + string t_rs_generator::rust_upper_case(const string& name) { string str(uppercase(underscore(name))); string_replace(str, "__", "_"); diff --git a/vendor/git.apache.org/thrift.git/composer.json b/vendor/git.apache.org/thrift.git/composer.json index 9a38331..3695b8c 100644 --- a/vendor/git.apache.org/thrift.git/composer.json +++ b/vendor/git.apache.org/thrift.git/composer.json @@ -1,9 +1,11 @@ { "name": "apache/thrift", "description": "Apache Thrift RPC system", - "homepage": "http://thrift.apache.org/", + "homepage": "https://thrift.apache.org/", "type": "library", + "keywords": ["RPC"], "license": "Apache-2.0", + "readme": "README.md", "authors": [ { "name": "Apache Thrift Developers", @@ -28,10 +30,10 @@ "autoload-dev": { "psr-4": {"Test\\Thrift\\": "lib/php/test/"} }, - "minimum-stability": "dev", + "minimum-stability": "stable", "extra": { "branch-alias": { - "dev-master": "1.0.0-dev" + "dev-master": "1.0.x-dev" } } } diff --git a/vendor/git.apache.org/thrift.git/configure.ac b/vendor/git.apache.org/thrift.git/configure.ac index 14a8c2e..b07b5de 100755 --- a/vendor/git.apache.org/thrift.git/configure.ac +++ b/vendor/git.apache.org/thrift.git/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ(2.65) AC_CONFIG_MACRO_DIR([./aclocal]) -AC_INIT([thrift], [1.0.0-dev]) +AC_INIT([thrift], [0.12.0]) AC_CONFIG_AUX_DIR([.]) @@ -109,6 +109,8 @@ fi AM_EXTRA_RECURSIVE_TARGETS([style]) AC_SUBST(CPPSTYLE_CMD, 'find . -type f \( -iname "*.h" -or -iname "*.cpp" -or -iname "*.cc" -or -iname "*.tcc" \) -printf "Reformatting: %h/%f\n" -exec clang-format -i {} \;') +# ' +# The above comment is to fix editor syntax highlighting AC_ARG_ENABLE([libs], AS_HELP_STRING([--enable-libs], [build the Apache Thrift libraries [default=yes]]), @@ -136,6 +138,7 @@ if test "$enable_libs" = "no"; then with_go="no" with_d="no" with_nodejs="no" + with_nodets="no" with_lua="no" with_rs="no" fi @@ -279,6 +282,18 @@ fi AM_CONDITIONAL(WITH_NODEJS, [test "$have_nodejs" = "yes"]) AM_CONDITIONAL(HAVE_NPM, [test "x$NPM" != "x"]) +AX_THRIFT_LIB(nodets, [Nodets], yes) +have_nodets=no +if test "$with_nodets" = "yes"; then + AC_PATH_PROGS([NODETS], [nodets node]) + AC_PATH_PROG([NPM], [npm]) + if test "x$NODETS" != "x" -a "x$NPM" != "x"; then + have_nodets="yes" + fi +fi +AM_CONDITIONAL(WITH_NODETS, [test "$have_nodets" = "yes"]) +AM_CONDITIONAL(HAVE_NPM, [test "x$NPM" != "x"]) + AX_THRIFT_LIB(lua, [Lua], yes) have_lua=no if test "$with_lua" = "yes"; then @@ -825,6 +840,7 @@ AC_CONFIG_FILES([ lib/json/test/Makefile lib/netcore/Makefile lib/nodejs/Makefile + lib/nodets/Makefile lib/perl/Makefile lib/perl/test/Makefile lib/php/Makefile @@ -905,6 +921,8 @@ if test "$have_go" = "yes" ; then MAYBE_GO="go" ; else MAYBE_GO="" ; fi AC_SUBST([MAYBE_GO]) if test "$have_nodejs" = "yes" ; then MAYBE_NODEJS="nodejs" ; else MAYBE_NODEJS="" ; fi AC_SUBST([MAYBE_NODEJS]) +if test "$have_nodets" = "yes" ; then MAYBE_NODETS="nodets" ; else MAYBE_NODETS="" ; fi +AC_SUBST([MAYBE_NODETS]) if test "$have_erlang" = "yes" ; then MAYBE_ERLANG="erl" ; else MAYBE_ERLANG="" ; fi AC_SUBST([MAYBE_ERLANG]) if test "$have_lua" = "yes" ; then MAYBE_LUA="lua" ; else MAYBE_LUA="" ; fi diff --git a/vendor/git.apache.org/thrift.git/contrib/Rebus/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/contrib/Rebus/Properties/AssemblyInfo.cs index e476eab..dde7813 100644 --- a/vendor/git.apache.org/thrift.git/contrib/Rebus/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/contrib/Rebus/Properties/AssemblyInfo.cs @@ -34,5 +34,5 @@ using System.Runtime.InteropServices; [assembly: Guid("0af10984-40d3-453d-b1e5-421529e8c7e2")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.12.0.0")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/vendor/git.apache.org/thrift.git/contrib/fb303/py/setup.py b/vendor/git.apache.org/thrift.git/contrib/fb303/py/setup.py index 4321ce2..12d2d5c 100644 --- a/vendor/git.apache.org/thrift.git/contrib/fb303/py/setup.py +++ b/vendor/git.apache.org/thrift.git/contrib/fb303/py/setup.py @@ -26,7 +26,7 @@ except: from distutils.core import setup, Extension, Command setup(name='thrift_fb303', - version='1.0.0-dev', + version='0.12.0', description='Python bindings for the Apache Thrift FB303', author=['Thrift Developers'], author_email=['dev@thrift.apache.org'], diff --git a/vendor/git.apache.org/thrift.git/contrib/thrift-maven-plugin/pom.xml b/vendor/git.apache.org/thrift.git/contrib/thrift-maven-plugin/pom.xml index 0af5957..e11fbbf 100644 --- a/vendor/git.apache.org/thrift.git/contrib/thrift-maven-plugin/pom.xml +++ b/vendor/git.apache.org/thrift.git/contrib/thrift-maven-plugin/pom.xml @@ -27,7 +27,7 @@ thrift-maven-plugin maven-plugin thrift-maven-plugin - 1.0-SNAPSHOT + 0.12.0 diff --git a/vendor/git.apache.org/thrift.git/contrib/thrift.spec b/vendor/git.apache.org/thrift.git/contrib/thrift.spec index 034ebc8..1fe0f9c 100644 --- a/vendor/git.apache.org/thrift.git/contrib/thrift.spec +++ b/vendor/git.apache.org/thrift.git/contrib/thrift.spec @@ -28,7 +28,7 @@ Name: thrift License: Apache License v2.0 Group: Development Summary: RPC and serialization framework -Version: 0.11.0 +Version: 0.12.0 Release: 0 URL: http://thrift.apache.org Packager: Thrift Developers diff --git a/vendor/git.apache.org/thrift.git/contrib/zeromq/csharp/ThriftZMQ.csproj b/vendor/git.apache.org/thrift.git/contrib/zeromq/csharp/ThriftZMQ.csproj index 6b46530..9143a69 100755 --- a/vendor/git.apache.org/thrift.git/contrib/zeromq/csharp/ThriftZMQ.csproj +++ b/vendor/git.apache.org/thrift.git/contrib/zeromq/csharp/ThriftZMQ.csproj @@ -25,7 +25,7 @@ false true 0 - 1.0.0.%2a + 0.12.0 false false true @@ -88,4 +88,4 @@ - \ No newline at end of file + diff --git a/vendor/git.apache.org/thrift.git/debian/changelog b/vendor/git.apache.org/thrift.git/debian/changelog index f2da232..5c8545f 100644 --- a/vendor/git.apache.org/thrift.git/debian/changelog +++ b/vendor/git.apache.org/thrift.git/debian/changelog @@ -1,8 +1,26 @@ -thrift (1.0.0-dev) stable; urgency=low - * update version - * fix libthrift0.install +thrift (0.12.0) stable; urgency=low - -- Roger Meier Tue, 08 Jan 2013 22:40:12 +0100 + * update to 0.12.0 + + -- Jake Farrell Wed, 15 Oct 2018 12:00:00 -0500 + +thrift (0.11.0) stable; urgency=low + + * update to 0.11.0 + + -- Jake Farrell Wed, 07 Dec 2017 20:07:00 -0500 + +thrift (0.10.0) stable; urgency=low + + * update to 0.10.0 + + -- Jake Farrell Wed, 03 Jan 2017 16:52:00 -0500 + +thrift (0.9.3) stable; urgency=low + + * update to 0.9.3 + + -- Jake Farrell Wed, 11 Oct 2015 17:22:00 -0500 thrift (0.9.0) stable; urgency=low diff --git a/vendor/git.apache.org/thrift.git/doap.rdf b/vendor/git.apache.org/thrift.git/doap.rdf index 75274aa..cd4aecc 100755 --- a/vendor/git.apache.org/thrift.git/doap.rdf +++ b/vendor/git.apache.org/thrift.git/doap.rdf @@ -58,6 +58,16 @@ + + Apache Thrift + 2018-10-15 + 0.12.0 + + + Apache Thrift + 2017-11-30 + 0.11.0 + Apache Thrift 2017-03-01 diff --git a/vendor/git.apache.org/thrift.git/lib/Makefile.am b/vendor/git.apache.org/thrift.git/lib/Makefile.am index 0401c99..b315609 100644 --- a/vendor/git.apache.org/thrift.git/lib/Makefile.am +++ b/vendor/git.apache.org/thrift.git/lib/Makefile.am @@ -87,6 +87,7 @@ endif if WITH_NODEJS SUBDIRS += nodejs PRECROSS_TARGET += precross-nodejs +SUBDIRS += nodets endif if WITH_LUA diff --git a/vendor/git.apache.org/thrift.git/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.c b/vendor/git.apache.org/thrift.git/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.c index 1433725..8296a8c 100644 --- a/vendor/git.apache.org/thrift.git/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.c +++ b/vendor/git.apache.org/thrift.git/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.c @@ -465,7 +465,7 @@ thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type, GError **error) } case T_STRUCT: { - guint32 result = 0; + gint32 result = 0; gchar *name; gint16 fid; ThriftType ftype; @@ -475,6 +475,10 @@ thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type, GError **error) { result += thrift_protocol_read_field_begin (protocol, &name, &ftype, &fid, error); + if (result < 0) + { + return result; + } if (ftype == T_STOP) { break; @@ -487,7 +491,7 @@ thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type, GError **error) } case T_SET: { - guint32 result = 0; + gint32 result = 0; ThriftType elem_type; guint32 i, size; result += thrift_protocol_read_set_begin (protocol, &elem_type, &size, @@ -501,7 +505,7 @@ thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type, GError **error) } case T_MAP: { - guint32 result = 0; + gint32 result = 0; ThriftType elem_type; ThriftType key_type; guint32 i, size; @@ -517,7 +521,7 @@ thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type, GError **error) } case T_LIST: { - guint32 result = 0; + gint32 result = 0; ThriftType elem_type; guint32 i, size; result += thrift_protocol_read_list_begin (protocol, &elem_type, &size, diff --git a/vendor/git.apache.org/thrift.git/lib/cocoa/src/Thrift.h b/vendor/git.apache.org/thrift.git/lib/cocoa/src/Thrift.h index 6fc594a..502ba17 100644 --- a/vendor/git.apache.org/thrift.git/lib/cocoa/src/Thrift.h +++ b/vendor/git.apache.org/thrift.git/lib/cocoa/src/Thrift.h @@ -17,4 +17,4 @@ * under the License. */ -#define ThriftVersion @"1.0.0-dev" +#define ThriftVersion @"0.12.0" diff --git a/vendor/git.apache.org/thrift.git/lib/cpp/libthrift.vcxproj b/vendor/git.apache.org/thrift.git/lib/cpp/libthrift.vcxproj index 307b121..d1097ec 100644 --- a/vendor/git.apache.org/thrift.git/lib/cpp/libthrift.vcxproj +++ b/vendor/git.apache.org/thrift.git/lib/cpp/libthrift.vcxproj @@ -53,12 +53,9 @@ - - - - - - + + + diff --git a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp index a49a148..80def7f 100644 --- a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp +++ b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp @@ -899,7 +899,7 @@ uint32_t TJSONProtocol::readJSONDouble(double& num) { } try { num = fromString(str); - } catch (std::runtime_error e) { + } catch (std::runtime_error& e) { throw TProtocolException(TProtocolException::INVALID_DATA, "Expected numeric value; got \"" + str + "\""); } @@ -912,7 +912,7 @@ uint32_t TJSONProtocol::readJSONDouble(double& num) { result += readJSONNumericChars(str); try { num = fromString(str); - } catch (std::runtime_error e) { + } catch (std::runtime_error& e) { throw TProtocolException(TProtocolException::INVALID_DATA, "Expected numeric value; got \"" + str + "\""); } diff --git a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp index cd38b01..0e46f11 100644 --- a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp +++ b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp @@ -91,7 +91,7 @@ uint32_t TQIODeviceTransport::read(uint8_t* buf, uint32_t len) { "read(): underlying QIODevice is not open"); } - actualSize = (uint32_t)std::min((qint64)len, dev_->bytesAvailable()); + actualSize = (uint32_t)(std::min)((qint64)len, dev_->bytesAvailable()); readSize = dev_->read(reinterpret_cast(buf), actualSize); if (readSize < 0) { diff --git a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TBufferTransports.h b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TBufferTransports.h index 53d895f..79aace6 100644 --- a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TBufferTransports.h +++ b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TBufferTransports.h @@ -449,7 +449,7 @@ private: // Common initialization done by all constructors. void initCommon(uint8_t* buf, uint32_t size, bool owner, uint32_t wPos) { - maxBufferSize_ = std::numeric_limits::max(); + maxBufferSize_ = (std::numeric_limits::max)(); if (buf == NULL && size != 0) { assert(owner); diff --git a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TFileTransport.cpp b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TFileTransport.cpp index 9c408ac..b08a5f1 100644 --- a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TFileTransport.cpp +++ b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TFileTransport.cpp @@ -65,7 +65,6 @@ using stdcxx::shared_ptr; using std::cerr; using std::cout; using std::endl; -using std::min; using std::string; using namespace apache::thrift::protocol; using namespace apache::thrift::concurrency; @@ -705,8 +704,8 @@ eventInfo* TFileTransport::readEvent() { readState_.event_->eventBuffPos_ = 0; } // take either the entire event or the remaining bytes in the buffer - int reclaimBuffer = min((uint32_t)(readState_.bufferLen_ - readState_.bufferPtr_), - readState_.event_->eventSize_ - readState_.event_->eventBuffPos_); + int reclaimBuffer = (std::min)((uint32_t)(readState_.bufferLen_ - readState_.bufferPtr_), + readState_.event_->eventSize_ - readState_.event_->eventBuffPos_); // copy data from read buffer into event buffer memcpy(readState_.event_->eventBuff_ + readState_.event_->eventBuffPos_, diff --git a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/THeaderTransport.cpp b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/THeaderTransport.cpp index 1a687da..ea16591 100644 --- a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/THeaderTransport.cpp +++ b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/THeaderTransport.cpp @@ -511,7 +511,7 @@ void THeaderTransport::flush() { // Pkt size ptrdiff_t szHbp = (headerStart - pktStart - 4); - if (static_cast(szHbp) > static_cast(std::numeric_limits().max()) - (headerSize + haveBytes)) { + if (static_cast(szHbp) > static_cast((std::numeric_limits().max)()) - (headerSize + haveBytes)) { throw TTransportException(TTransportException::CORRUPTED_DATA, "Header section size is unreasonable"); } diff --git a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TSocketPool.cpp b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TSocketPool.cpp index 0cec259..a34d135 100644 --- a/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TSocketPool.cpp +++ b/vendor/git.apache.org/thrift.git/lib/cpp/src/thrift/transport/TSocketPool.cpp @@ -21,6 +21,9 @@ #include #include +#if __cplusplus >= 201703L +#include +#endif #include @@ -188,7 +191,13 @@ void TSocketPool::open() { } if (randomize_ && numServers > 1) { - random_shuffle(servers_.begin(), servers_.end()); +#if __cplusplus >= 201703L + std::random_device rng; + std::mt19937 urng(rng()); + std::shuffle(servers_.begin(), servers_.end(), urng); +#else + std::random_shuffle(servers_.begin(), servers_.end()); +#endif } for (size_t i = 0; i < numServers; ++i) { diff --git a/vendor/git.apache.org/thrift.git/lib/cpp/test/TMemoryBufferTest.cpp b/vendor/git.apache.org/thrift.git/lib/cpp/test/TMemoryBufferTest.cpp index 9492f69..d81b1d8 100644 --- a/vendor/git.apache.org/thrift.git/lib/cpp/test/TMemoryBufferTest.cpp +++ b/vendor/git.apache.org/thrift.git/lib/cpp/test/TMemoryBufferTest.cpp @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(test_exceptions) { BOOST_AUTO_TEST_CASE(test_default_maximum_buffer_size) { - BOOST_CHECK_EQUAL(std::numeric_limits::max(), TMemoryBuffer().getMaxBufferSize()); + BOOST_CHECK_EQUAL((std::numeric_limits::max)(), TMemoryBuffer().getMaxBufferSize()); } BOOST_AUTO_TEST_CASE(test_default_buffer_size) diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs index 974cf27..19abcf7 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs @@ -56,5 +56,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.11.0.*")] -[assembly: AssemblyFileVersion("0.11.0.*")] +[assembly: AssemblyVersion("0.12.0.*")] +[assembly: AssemblyFileVersion("0.12.0.*")] diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj b/vendor/git.apache.org/thrift.git/lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj index ae86081..68427c3 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj +++ b/vendor/git.apache.org/thrift.git/lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj @@ -45,7 +45,7 @@ false true 0 - 1.0.0.%2a + 0.12.0.%2a false false true @@ -115,4 +115,4 @@ --> - \ No newline at end of file + diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/src/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/lib/csharp/src/Properties/AssemblyInfo.cs index dcbe747..23fbc73 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/src/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/lib/csharp/src/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.1")] -[assembly: AssemblyFileVersion("1.0.0.1")] +[assembly: AssemblyVersion("0.12.0.1")] +[assembly: AssemblyFileVersion("0.12.0.1")] diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/src/Thrift.csproj b/vendor/git.apache.org/thrift.git/lib/csharp/src/Thrift.csproj index 83bc4f7..ede152d 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/src/Thrift.csproj +++ b/vendor/git.apache.org/thrift.git/lib/csharp/src/Thrift.csproj @@ -45,7 +45,7 @@ false true 0 - 1.0.0.%2a + 0.12.0.%2a false false true @@ -153,4 +153,4 @@ - \ No newline at end of file + diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/src/Transport/TBufferedTransport.cs b/vendor/git.apache.org/thrift.git/lib/csharp/src/Transport/TBufferedTransport.cs index 76c6b1a..8870988 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/src/Transport/TBufferedTransport.cs +++ b/vendor/git.apache.org/thrift.git/lib/csharp/src/Transport/TBufferedTransport.cs @@ -81,7 +81,7 @@ namespace Thrift.Transport inputBuffer.Capacity = bufSize; while (true) - { + { int got = inputBuffer.Read(buf, off, len); if (got > 0) return got; @@ -129,9 +129,8 @@ namespace Thrift.Transport } } - public override void Flush() + private void InternalFlush() { - CheckNotDisposed(); if (!IsOpen) throw new TTransportException(TTransportException.ExceptionType.NotOpen); if (outputBuffer.Length > 0) @@ -139,9 +138,31 @@ namespace Thrift.Transport transport.Write(outputBuffer.GetBuffer(), 0, (int)outputBuffer.Length); outputBuffer.SetLength(0); } + } + + public override void Flush() + { + CheckNotDisposed(); + InternalFlush(); + transport.Flush(); } + public override IAsyncResult BeginFlush(AsyncCallback callback, object state) + { + CheckNotDisposed(); + InternalFlush(); + + return transport.BeginFlush( callback, state); + } + + public override void EndFlush(IAsyncResult asyncResult) + { + transport.EndFlush( asyncResult); + } + + + protected void CheckNotDisposed() { if (_IsDisposed) diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/src/Transport/TFramedTransport.cs b/vendor/git.apache.org/thrift.git/lib/csharp/src/Transport/TFramedTransport.cs index 3436cc6..a746a32 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/src/Transport/TFramedTransport.cs +++ b/vendor/git.apache.org/thrift.git/lib/csharp/src/Transport/TFramedTransport.cs @@ -108,7 +108,7 @@ namespace Thrift.Transport writeBuffer.Write(buf, off, len); } - public override void Flush() + private void InternalFlush() { CheckNotDisposed(); if (!IsOpen) @@ -126,10 +126,29 @@ namespace Thrift.Transport transport.Write(buf, 0, len); InitWriteBuffer(); + } + + public override void Flush() + { + CheckNotDisposed(); + InternalFlush(); transport.Flush(); } + public override IAsyncResult BeginFlush(AsyncCallback callback, object state) + { + CheckNotDisposed(); + InternalFlush(); + + return transport.BeginFlush( callback, state); + } + + public override void EndFlush(IAsyncResult asyncResult) + { + transport.EndFlush( asyncResult); + } + private void InitWriteBuffer() { // Reserve space for message header to be put right before sending it out diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Client/MultiplexClient.csproj b/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Client/MultiplexClient.csproj index 6221e14..4df1cbc 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Client/MultiplexClient.csproj +++ b/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Client/MultiplexClient.csproj @@ -46,7 +46,7 @@ false true 0 - 1.0.0.%2a + 0.12.0.%2a false true @@ -145,4 +145,4 @@ for %25%25I in ("%25THRIFT_FILE%25") do set THRIFT_SHORT=%25%25~fsI - \ No newline at end of file + diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Client/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Client/Properties/AssemblyInfo.cs index f686ded..5ee34a1 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Client/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Client/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.12.0.0")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj b/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj index dc1d123..57ef76d 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj +++ b/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Server/MultiplexServer.csproj @@ -46,7 +46,7 @@ false true 0 - 1.0.0.%2a + 0.12.0.%2a false true @@ -145,4 +145,4 @@ for %25%25I in ("%25THRIFT_FILE%25") do set THRIFT_SHORT=%25%25~fsI - \ No newline at end of file + diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs index 5d40546..65fb4ce 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/lib/csharp/test/Multiplex/Server/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.12.0.0")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/vendor/git.apache.org/thrift.git/lib/csharp/test/ThriftMVCTest/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/lib/csharp/test/ThriftMVCTest/Properties/AssemblyInfo.cs index 1b1b833..186257d 100644 --- a/vendor/git.apache.org/thrift.git/lib/csharp/test/ThriftMVCTest/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/lib/csharp/test/ThriftMVCTest/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.1")] -[assembly: AssemblyFileVersion("1.0.0.1")] +[assembly: AssemblyVersion("0.12.0.0")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/vendor/git.apache.org/thrift.git/lib/d/src/thrift/base.d b/vendor/git.apache.org/thrift.git/lib/d/src/thrift/base.d index 38034a7..260e155 100644 --- a/vendor/git.apache.org/thrift.git/lib/d/src/thrift/base.d +++ b/vendor/git.apache.org/thrift.git/lib/d/src/thrift/base.d @@ -50,7 +50,7 @@ class TCompoundOperationException : TException { /// The Thrift version string, used for informative purposes. // Note: This is currently hardcoded, but will likely be filled in by the build // system in future versions. -enum VERSION = "1.0.0 dev"; +enum VERSION = "0.12.0"; /** * Functions used for logging inside Thrift. diff --git a/vendor/git.apache.org/thrift.git/lib/d/test/client_pool_test.d b/vendor/git.apache.org/thrift.git/lib/d/test/client_pool_test.d index 52207d9..b24c97a 100644 --- a/vendor/git.apache.org/thrift.git/lib/d/test/client_pool_test.d +++ b/vendor/git.apache.org/thrift.git/lib/d/test/client_pool_test.d @@ -18,6 +18,7 @@ */ module client_pool_test; +import core.sync.semaphore : Semaphore; import core.time : Duration, dur; import core.thread : Thread; import std.algorithm; @@ -28,6 +29,7 @@ import std.getopt; import std.range; import std.stdio; import std.typecons; +import std.variant : Variant; import thrift.base; import thrift.async.libevent; import thrift.async.socket; @@ -37,9 +39,12 @@ import thrift.codegen.async_client_pool; import thrift.codegen.client; import thrift.codegen.client_pool; import thrift.codegen.processor; +import thrift.protocol.base; import thrift.protocol.binary; +import thrift.server.base; import thrift.server.simple; import thrift.server.transport.socket; +import thrift.transport.base; import thrift.transport.buffered; import thrift.transport.socket; import thrift.util.cancellation; @@ -108,11 +113,29 @@ private: } } +class ServerPreServeHandler : TServerEventHandler { + this(Semaphore sem) { + sem_ = sem; + } + + override void preServe() { + sem_.notify(); + } + + Variant createContext(TProtocol input, TProtocol output) { return Variant.init; } + void deleteContext(Variant serverContext, TProtocol input, TProtocol output) {} + void preProcess(Variant serverContext, TTransport transport) {} + +private: + Semaphore sem_; +} + class ServerThread : Thread { - this(ExTestHandler handler, TCancellation cancellation) { + this(ExTestHandler handler, ServerPreServeHandler serverHandler, TCancellation cancellation) { super(&run); handler_ = handler; cancellation_ = cancellation; + serverHandler_ = serverHandler; } private: void run() { @@ -123,16 +146,17 @@ private: serverTransport.recvTimeout = dur!"seconds"(3); auto transportFactory = new TBufferedTransportFactory; - auto server = new TSimpleServer( - processor, serverTransport, transportFactory, protocolFactory); + auto server = new TSimpleServer(processor, serverTransport, transportFactory, protocolFactory); + server.eventHandler = serverHandler_; server.serve(cancellation_); } catch (Exception e) { writefln("Server thread on port %s failed: %s", handler_.port, e); } } - TCancellation cancellation_; ExTestHandler handler_; + ServerPreServeHandler serverHandler_; + TCancellation cancellation_; } void main(string[] args) { @@ -145,6 +169,9 @@ void main(string[] args) { immutable ports = cast(immutable)array(map!"cast(ushort)a"(iota(port, port + 6))); + // semaphore that will be incremented whenever each server thread has bound and started listening + Semaphore sem = new Semaphore(0); + version (none) { // Cannot use this due to multiple DMD @@BUG@@s: // 1. »function D main is a nested function and cannot be accessed from array« @@ -174,11 +201,10 @@ version (none) { } // Fire up the server threads. - foreach (h; handlers) (new ServerThread(h, serverCancellation)).start(); + foreach (h; handlers) (new ServerThread(h, new ServerPreServeHandler(sem), serverCancellation)).start(); - // Give the servers some time to get up. This should really be accomplished - // via a barrier here and in the preServe() hook. - Thread.sleep(dur!"msecs"(10)); + // wait until all the handlers signal that they're ready to serve + foreach (h; handlers) (sem.wait(dur!`seconds`(1))); syncClientPoolTest(ports, handlers); asyncClientPoolTest(ports, handlers); diff --git a/vendor/git.apache.org/thrift.git/lib/dart/pubspec.yaml b/vendor/git.apache.org/thrift.git/lib/dart/pubspec.yaml index f7aa876..365b2cd 100644 --- a/vendor/git.apache.org/thrift.git/lib/dart/pubspec.yaml +++ b/vendor/git.apache.org/thrift.git/lib/dart/pubspec.yaml @@ -16,7 +16,7 @@ # under the License. name: thrift -version: 1.0.0-dev +version: 0.12.0 description: > A Dart library for Apache Thrift author: Apache Thrift Developers diff --git a/vendor/git.apache.org/thrift.git/lib/delphi/src/Thrift.pas b/vendor/git.apache.org/thrift.git/lib/delphi/src/Thrift.pas index ddd4c11..8293d07 100644 --- a/vendor/git.apache.org/thrift.git/lib/delphi/src/Thrift.pas +++ b/vendor/git.apache.org/thrift.git/lib/delphi/src/Thrift.pas @@ -27,7 +27,7 @@ uses Thrift.Protocol; const - Version = '1.0.0-dev'; + Version = '0.12.0'; type TException = Thrift.Exception.TException; // compatibility alias diff --git a/vendor/git.apache.org/thrift.git/lib/go/README.md b/vendor/git.apache.org/thrift.git/lib/go/README.md index debc9ac..ce6d5ed 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/README.md +++ b/vendor/git.apache.org/thrift.git/lib/go/README.md @@ -29,7 +29,7 @@ Thrift supports Go 1.7+ In following Go conventions, we recommend you use the 'go' tool to install Thrift for go. - $ go get git.apache.org/thrift.git/lib/go/thrift/... + $ go get github.com/apache/thrift/lib/go/thrift/... Will retrieve and install the most recent version of the package. diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/serializer_types_test.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/serializer_types_test.go index c8e3b3b..ef7cc3a 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/serializer_types_test.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/serializer_types_test.go @@ -19,7 +19,7 @@ package thrift -// Autogenerated by Thrift Compiler (1.0.0-dev) +// Autogenerated by Thrift Compiler (0.12.0) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING /* THE FOLLOWING THRIFT FILE WAS USED TO CREATE THIS diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/server_socket.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/server_socket.go index 80313c4..7dd24ae 100644 --- a/vendor/git.apache.org/thrift.git/lib/go/thrift/server_socket.go +++ b/vendor/git.apache.org/thrift.git/lib/go/thrift/server_socket.go @@ -75,7 +75,9 @@ func (p *TServerSocket) Accept() (TTransport, error) { return nil, errTransportInterrupted } + p.mu.Lock() listener := p.listener + p.mu.Unlock() if listener == nil { return nil, NewTTransportException(NOT_OPEN, "No underlying server socket") } @@ -115,19 +117,20 @@ func (p *TServerSocket) Addr() net.Addr { } func (p *TServerSocket) Close() error { - defer func() { - p.listener = nil - }() + var err error + p.mu.Lock() if p.IsListening() { - return p.listener.Close() + err = p.listener.Close() + p.listener = nil } - return nil + p.mu.Unlock() + return err } func (p *TServerSocket) Interrupt() error { p.mu.Lock() - defer p.mu.Unlock() p.interrupted = true + p.mu.Unlock() p.Close() return nil diff --git a/vendor/git.apache.org/thrift.git/lib/haxe/README.md b/vendor/git.apache.org/thrift.git/lib/haxe/README.md index 19bbbaa..02e6919 100644 --- a/vendor/git.apache.org/thrift.git/lib/haxe/README.md +++ b/vendor/git.apache.org/thrift.git/lib/haxe/README.md @@ -71,8 +71,8 @@ either from the official ASF repo, or via the github mirror. - To set up any **stable version**, choose the appropriate branch (e.g. `0.10.0`): - - `haxelib git thrift https://git.apache.org/thrift.git 0.10.0 lib/haxe` - - `haxelib git thrift https://github.com/apache/thrift.git 0.10.0 lib/haxe` + - `haxelib git thrift https://git.apache.org/thrift.git 0.12.0 lib/haxe` + - `haxelib git thrift https://github.com/apache/thrift.git 0.12.0 lib/haxe` - To set up the current **development version**, use the `master` branch: diff --git a/vendor/git.apache.org/thrift.git/lib/haxe/haxelib.json b/vendor/git.apache.org/thrift.git/lib/haxe/haxelib.json index f76990e..8d1bb11 100644 --- a/vendor/git.apache.org/thrift.git/lib/haxe/haxelib.json +++ b/vendor/git.apache.org/thrift.git/lib/haxe/haxelib.json @@ -4,7 +4,7 @@ "license": "Apache", "tags": ["thrift", "rpc", "serialization", "cross", "framework"], "description": "Haxe bindings for the Apache Thrift RPC and serialization framework", - "version": "1.0.0-dev", + "version": "0.12.0", "releasenote": "Licensed under Apache License, Version 2.0. The Apache Thrift compiler needs to be installed separately.", "contributors": ["Apache Software Foundation (ASF)"], "dependencies": { }, diff --git a/vendor/git.apache.org/thrift.git/lib/hs/Thrift.cabal b/vendor/git.apache.org/thrift.git/lib/hs/Thrift.cabal index 03a9814..c136480 100644 --- a/vendor/git.apache.org/thrift.git/lib/hs/Thrift.cabal +++ b/vendor/git.apache.org/thrift.git/lib/hs/Thrift.cabal @@ -18,8 +18,8 @@ -- Name: thrift -Version: 1.0.0-dev -Cabal-Version: >= 1.24 +Version: 0.12.0 +Cabal-Version: 1.24 License: OtherLicense Category: Foreign Build-Type: Simple @@ -63,8 +63,7 @@ Library Thrift.Transport.IOBuffer, Thrift.Transport.Memory, Thrift.Types - Default-Language: - Haskell2010 + Default-Language: Haskell2010 Default-Extensions: DeriveDataTypeable, ExistentialQuantification, @@ -82,3 +81,4 @@ Test-Suite spec Ghc-Options: -Wall main-is: Spec.hs Build-Depends: base, thrift, hspec, QuickCheck >= 2.8.2, bytestring >= 0.10, unordered-containers >= 0.2.6 + Default-Language: Haskell2010 diff --git a/vendor/git.apache.org/thrift.git/lib/java/gradle.properties b/vendor/git.apache.org/thrift.git/lib/java/gradle.properties index e99788f..4955b4c 100644 --- a/vendor/git.apache.org/thrift.git/lib/java/gradle.properties +++ b/vendor/git.apache.org/thrift.git/lib/java/gradle.properties @@ -1,9 +1,9 @@ # This file is shared currently between this Gradle build and the # Ant builds for fd303 and JavaScript. Keep the dotted notation for # the properties to minimize the changes in the dependencies. -thrift.version=1.0.0 +thrift.version=0.12.0 thrift.groupid=org.apache.thrift -release=false +release=true # Local Install paths install.path=/usr/local/lib diff --git a/vendor/git.apache.org/thrift.git/lib/js/Gruntfile.js b/vendor/git.apache.org/thrift.git/lib/js/Gruntfile.js index fd290d2..bb7691a 100644 --- a/vendor/git.apache.org/thrift.git/lib/js/Gruntfile.js +++ b/vendor/git.apache.org/thrift.git/lib/js/Gruntfile.js @@ -221,31 +221,37 @@ module.exports = function(grunt) { // The main thrift library file. not es6 yet :( lib: { src: ['src/**/*.js'], - options: { - // options here to override JSHint defaults - globals: { - jQuery: true, - console: true, - module: true, - document: true, - }, - } }, // The test files use es6 test: { src: ['Gruntfile.js', 'test/*.js'], options: { - // options here to override JSHint defaults - globals: { - jQuery: true, - console: true, - module: true, - document: true, - }, esversion: 6, } }, - } + gen_js_code: { + src: ['test/gen-js/*.js', 'test/gen-js-jquery/*.js'], + }, + gen_es6_code: { + src: ['test/gen-js-es6/*.js'], + options: { + esversion: 6, + } + }, + gen_node_code: { + src: ['test/gen-nodejs/*.js'], + options: { + node: true, + } + }, + gen_node_es6_code: { + src: ['test/gen-nodejs-es6/*.js'], + options: { + node: true, + esversion: 6, + } + } + }, }); grunt.loadNpmTasks('grunt-contrib-uglify'); @@ -269,8 +275,8 @@ module.exports = function(grunt) { ]); grunt.registerTask('test', [ - 'jshint', 'installAndGenerate', + 'jshint', 'shell:ThriftTestServer', 'shell:ThriftTestServer_TLS', 'shell:ThriftTestServerES6', 'shell:ThriftTestServerES6_TLS', 'wait', diff --git a/vendor/git.apache.org/thrift.git/lib/js/package-lock.json b/vendor/git.apache.org/thrift.git/lib/js/package-lock.json index f0943b0..63d81c3 100644 --- a/vendor/git.apache.org/thrift.git/lib/js/package-lock.json +++ b/vendor/git.apache.org/thrift.git/lib/js/package-lock.json @@ -7,7 +7,7 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "agent-base": { "version": "4.2.1", @@ -15,7 +15,20 @@ "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", "dev": true, "requires": { - "es6-promisify": "5.0.0" + "es6-promisify": "^5.0.0" + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "optional": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "align-text": { @@ -24,9 +37,20 @@ "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "ansi-regex": { @@ -36,10 +60,13 @@ "dev": true }, "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } }, "argparse": { "version": "1.0.10", @@ -47,7 +74,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" }, "dependencies": { "sprintf-js": { @@ -58,15 +85,73 @@ } } }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true + }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, "async": { "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, @@ -76,10 +161,37 @@ "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", "dev": true }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true, + "optional": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true, + "optional": true + }, "babylon": { "version": "7.0.0-beta.19", "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", - "integrity": "sha1-6SjH6AfpcOBTaweKs+DEj54FJQM=" + "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==" }, "balanced-match": { "version": "1.0.0", @@ -87,10 +199,75 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha1-2VUfnemPH82h5oPRfukaBgLuLrk=" + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", + "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==" }, "brace-expansion": { "version": "1.1.11", @@ -98,17 +275,46 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "browserify-zlib": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", "dev": true, "requires": { - "pako": "0.2.9" + "pako": "~0.2.0" } }, "buffer-from": { @@ -129,6 +335,23 @@ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, "camelcase": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", @@ -137,20 +360,27 @@ }, "camelcase-keys": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" } }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true, + "optional": true + }, "catharsis": { "version": "0.8.9", "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", "requires": { - "underscore-contrib": "0.3.0" + "underscore-contrib": "~0.3.0" } }, "center-align": { @@ -159,21 +389,42 @@ "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", "dev": true, "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } } }, "cli": { @@ -183,30 +434,21 @@ "dev": true, "requires": { "exit": "0.1.2", - "glob": "7.1.2" + "glob": "^7.1.1" }, "dependencies": { "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", - "dev": true, - "requires": { - "brace-expansion": "1.1.11" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } } } @@ -217,23 +459,70 @@ "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", "dev": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" } }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true, + "optional": true + }, "coffeescript": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.10.0.tgz", "integrity": "sha1-56qDAZF+9iGzXYo580jc3R234z4=", "dev": true }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "colors": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -241,44 +530,39 @@ "dev": true }, "concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.5", - "typedarray": "0.0.6" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" }, "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "readable-stream": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", - "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } } } @@ -289,9 +573,15 @@ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "dev": true, "requires": { - "date-now": "0.1.4" + "date-now": "^0.1.4" } }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -299,34 +589,16 @@ "dev": true }, "cross-spawn": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", - "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "lru-cache": "4.1.1", - "which": "1.3.0" - }, - "dependencies": { - "lru-cache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", - "dev": true, - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" - } - }, - "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", - "dev": true, - "requires": { - "isexe": "2.0.0" - } - } + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "currently-unhandled": { @@ -335,7 +607,24 @@ "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "dev": true, "requires": { - "array-find-index": "1.0.2" + "array-find-index": "^1.0.1" + } + }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", + "dev": true, + "optional": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "^1.0.0" } }, "date-now": { @@ -350,14 +639,14 @@ "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", "dev": true, "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" + "get-stdin": "^4.0.1", + "meow": "^3.3.0" } }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -369,14 +658,73 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, "dom-serializer": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", "dev": true, "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" + "domelementtype": "~1.1.1", + "entities": "~1.1.1" }, "dependencies": { "domelementtype": { @@ -405,7 +753,7 @@ "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", "dev": true, "requires": { - "domelementtype": "1.3.0" + "domelementtype": "1" } }, "domutils": { @@ -414,8 +762,19 @@ "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "dev": true, "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "entities": { @@ -425,27 +784,27 @@ "dev": true }, "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "es6-promise": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", - "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", + "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==", "dev": true }, "es6-promisify": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, "requires": { - "es6-promise": "4.2.4" + "es6-promise": "^4.0.3" } }, "escape-string-regexp": { @@ -461,7 +820,7 @@ }, "eventemitter2": { "version": "0.4.14", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "resolved": "http://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", "dev": true }, @@ -471,6 +830,142 @@ "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "dev": true }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "extract-zip": { "version": "1.6.7", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", @@ -481,68 +976,42 @@ "debug": "2.6.9", "mkdirp": "0.5.1", "yauzl": "2.4.1" - }, - "dependencies": { - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "1.1.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - } } }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "dev": true, + "optional": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true, + "optional": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true, + "optional": true + }, "fd-slicer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", "dev": true, "requires": { - "pend": "1.2.0" + "pend": "~1.2.0" } }, "figures": { @@ -551,8 +1020,31 @@ "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "find-up": { @@ -561,8 +1053,8 @@ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "findup-sync": { @@ -571,7 +1063,7 @@ "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", "dev": true, "requires": { - "glob": "5.0.15" + "glob": "~5.0.0" }, "dependencies": { "glob": { @@ -580,11 +1072,97 @@ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "dev": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "fined": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", + "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + } + }, + "flagged-respawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.0.tgz", + "integrity": "sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c=", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "optional": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-extra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", + "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0" + }, + "dependencies": { + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.9" } } } @@ -601,24 +1179,64 @@ "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", "dev": true }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, "getobject": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=", "dev": true }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, "glob": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" } }, "graceful-fs": { @@ -627,92 +1245,64 @@ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, "grunt": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.2.tgz", - "integrity": "sha1-TmpeaVtwRy/VME9fqeNCNoNqc7w=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.3.tgz", + "integrity": "sha512-/JzmZNPfKorlCrrmxWqQO4JVodO+DVd5XX4DkocL/1WlLlKVLE9+SdEIempOAxDhWPysLle6afvn/hg7Ck2k9g==", "dev": true, "requires": { - "coffeescript": "1.10.0", - "dateformat": "1.0.12", - "eventemitter2": "0.4.14", - "exit": "0.1.2", - "findup-sync": "0.3.0", - "glob": "7.0.6", - "grunt-cli": "1.2.0", - "grunt-known-options": "1.1.0", - "grunt-legacy-log": "1.0.1", - "grunt-legacy-util": "1.0.0", - "iconv-lite": "0.4.19", - "js-yaml": "3.5.5", - "minimatch": "3.0.4", - "nopt": "3.0.6", - "path-is-absolute": "1.0.1", - "rimraf": "2.2.8" + "coffeescript": "~1.10.0", + "dateformat": "~1.0.12", + "eventemitter2": "~0.4.13", + "exit": "~0.1.1", + "findup-sync": "~0.3.0", + "glob": "~7.0.0", + "grunt-cli": "~1.2.0", + "grunt-known-options": "~1.1.0", + "grunt-legacy-log": "~2.0.0", + "grunt-legacy-util": "~1.1.1", + "iconv-lite": "~0.4.13", + "js-yaml": "~3.5.2", + "minimatch": "~3.0.2", + "mkdirp": "~0.5.1", + "nopt": "~3.0.6", + "path-is-absolute": "~1.0.0", + "rimraf": "~2.6.2" }, "dependencies": { + "grunt-cli": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", + "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", + "dev": true, + "requires": { + "findup-sync": "~0.3.0", + "grunt-known-options": "~1.1.0", + "nopt": "~3.0.6", + "resolve": "~1.1.0" + } + }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1.1.1" + "abbrev": "1" } } } }, "grunt-cli": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", - "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.1.tgz", + "integrity": "sha512-UwBRu/QpAjDc53DRLEkyilFdL0zenpxu+fddTIlsF/KJqdNcHaQmvyu1W3cDesZ9rqqZdKK5A8+QDIyLUEWoZQ==", "dev": true, "requires": { - "findup-sync": "0.3.0", - "grunt-known-options": "1.1.0", - "nopt": "3.0.6", - "resolve": "1.1.7" - }, - "dependencies": { - "findup-sync": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", - "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", - "dev": true, - "requires": { - "glob": "5.0.15" - } - }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1.1.1" - } - } + "grunt-known-options": "~1.1.0", + "interpret": "~1.1.0", + "liftoff": "~2.5.0", + "nopt": "~4.0.1", + "v8flags": "~3.0.2" } }, "grunt-contrib-concat": { @@ -721,19 +1311,73 @@ "integrity": "sha1-YVCYYwhOhx1+ht5IwBUlntl3Rb0=", "dev": true, "requires": { - "chalk": "1.1.3", - "source-map": "0.5.7" + "chalk": "^1.0.0", + "source-map": "^0.5.3" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } } }, "grunt-contrib-jshint": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-1.1.0.tgz", "integrity": "sha1-Np2QmyWTxA6L55lAshNAhQx5Oaw=", "dev": true, "requires": { - "chalk": "1.1.3", - "hooker": "0.2.3", - "jshint": "2.9.5" + "chalk": "^1.1.1", + "hooker": "^0.2.3", + "jshint": "~2.9.4" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } } }, "grunt-contrib-qunit": { @@ -742,8 +1386,8 @@ "integrity": "sha512-s994+ipKwc+oUUIWaGIw1soyID4pExSGMd/cHQN5h0p8KbIjR1Le3ZC3giSDDKXtZFE0i+Obf0uIjNvjftX2Cw==", "dev": true, "requires": { - "eventemitter2": "5.0.1", - "p-each-series": "1.0.0", + "eventemitter2": "^5.0.1", + "p-each-series": "^1.0.0", "puppeteer": "1.7.0" }, "dependencies": { @@ -757,100 +1401,104 @@ }, "grunt-contrib-uglify": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-1.0.2.tgz", "integrity": "sha1-rmekb5FT7dTLEYE6Vetpxw19svs=", "dev": true, "requires": { - "chalk": "1.1.3", - "lodash": "4.17.5", - "maxmin": "1.1.0", - "uglify-js": "2.6.4", - "uri-path": "1.0.0" + "chalk": "^1.0.0", + "lodash": "^4.0.1", + "maxmin": "^1.1.0", + "uglify-js": "~2.6.2", + "uri-path": "^1.0.0" }, "dependencies": { - "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true } } }, "grunt-jsdoc": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/grunt-jsdoc/-/grunt-jsdoc-2.2.1.tgz", - "integrity": "sha512-33QZYBYjv2Ph3H2ygqXHn/o0ttfptw1f9QciOTgvzhzUeiPrnvzMNUApTPtw22T6zgReE5FZ1RR58U2wnK/l+w==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/grunt-jsdoc/-/grunt-jsdoc-2.3.0.tgz", + "integrity": "sha512-gC66TCRXeQMj3HIyqVSBJm8zdUz43e5vaG/PLO/627A1edbJnzxhJV7nF0KqLwMM0RDNu1istC6fvfnYqFKi3w==", "dev": true, "requires": { - "cross-spawn": "3.0.1", - "jsdoc": "3.5.5", - "marked": "0.3.17" + "cross-spawn": "^6.0.5", + "jsdoc": "~3.5.5", + "marked": "^0.5.0" + }, + "dependencies": { + "marked": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.5.1.tgz", + "integrity": "sha512-iUkBZegCZou4AdwbKTwSW/lNDcz5OuRSl3qdcl31Ia0B2QPG0Jn+tKblh/9/eP9/6+4h27vpoh8wel/vQOV0vw==", + "dev": true + } } }, "grunt-known-options": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.0.tgz", - "integrity": "sha1-pCdO6zL6dl2lp6OxcSYXzjsUQUk=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz", + "integrity": "sha512-cHwsLqoighpu7TuYj5RonnEuxGVFnztcUqTqp5rXFGYL4OuPFofwC4Ycg7n9fYwvK6F5WbYgeVOwph9Crs2fsQ==", "dev": true }, "grunt-legacy-log": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-1.0.1.tgz", - "integrity": "sha512-rwuyqNKlI0IPz0DvxzJjcEiQEBaBNVeb1LFoZKxSmHLETFUwhwUrqOsPIxURTKSwNZHZ4ht1YLBYmVU0YZAzHQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-2.0.0.tgz", + "integrity": "sha512-1m3+5QvDYfR1ltr8hjiaiNjddxGdQWcH0rw1iKKiQnF0+xtgTazirSTGu68RchPyh1OBng1bBUjLmX8q9NpoCw==", "dev": true, "requires": { - "colors": "1.1.2", - "grunt-legacy-log-utils": "1.0.0", - "hooker": "0.2.3", - "lodash": "4.17.5", - "underscore.string": "3.3.4" + "colors": "~1.1.2", + "grunt-legacy-log-utils": "~2.0.0", + "hooker": "~0.2.3", + "lodash": "~4.17.5" } }, "grunt-legacy-log-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-1.0.0.tgz", - "integrity": "sha1-p7ji0Ps1taUPSvmG/BEnSevJbz0=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.0.1.tgz", + "integrity": "sha512-o7uHyO/J+i2tXG8r2bZNlVk20vlIFJ9IEYyHMCQGfWYru8Jv3wTqKZzvV30YW9rWEjq0eP3cflQ1qWojIe9VFA==", "dev": true, "requires": { - "chalk": "1.1.3", - "lodash": "4.3.0" - }, - "dependencies": { - "lodash": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz", - "integrity": "sha1-79nEpuxT87BUEkKZFcPkgk5NJaQ=", - "dev": true - } + "chalk": "~2.4.1", + "lodash": "~4.17.10" } }, "grunt-legacy-util": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.0.0.tgz", - "integrity": "sha1-OGqnjcbtUJhsKxiVcmWxtIq7m4Y=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.1.1.tgz", + "integrity": "sha512-9zyA29w/fBe6BIfjGENndwoe1Uy31BIXxTH3s8mga0Z5Bz2Sp4UCjkeyv2tI449ymkx3x26B+46FV4fXEddl5A==", "dev": true, "requires": { - "async": "1.5.2", - "exit": "0.1.2", - "getobject": "0.1.0", - "hooker": "0.2.3", - "lodash": "4.3.0", - "underscore.string": "3.2.3", - "which": "1.2.14" - }, - "dependencies": { - "lodash": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz", - "integrity": "sha1-79nEpuxT87BUEkKZFcPkgk5NJaQ=", - "dev": true - }, - "underscore.string": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.2.3.tgz", - "integrity": "sha1-gGmSYzZl1eX8tNsfs6hi62jp5to=", - "dev": true - } + "async": "~1.5.2", + "exit": "~0.1.1", + "getobject": "~0.1.0", + "hooker": "~0.2.3", + "lodash": "~4.17.10", + "underscore.string": "~3.3.4", + "which": "~1.3.0" } }, "grunt-shell-spawn": { @@ -859,8 +1507,8 @@ "integrity": "sha1-gbuNRX7EfTGCqH1jCO+EXd+5SI8=", "dev": true, "requires": { - "grunt": "1.0.2", - "sync-exec": "0.6.2" + "grunt": ">=0.4.x", + "sync-exec": "~0.6.2" } }, "gzip-size": { @@ -869,8 +1517,26 @@ "integrity": "sha1-Zs+LEBBHInuVus5uodoMF37Vwi8=", "dev": true, "requires": { - "browserify-zlib": "0.1.4", - "concat-stream": "1.6.0" + "browserify-zlib": "^0.1.4", + "concat-stream": "^1.4.1" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true, + "optional": true + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "dev": true, + "optional": true, + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" } }, "has-ansi": { @@ -879,7 +1545,65 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hasha": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", + "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", + "dev": true, + "optional": true, + "requires": { + "is-stream": "^1.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" } }, "hooker": { @@ -889,9 +1613,9 @@ "dev": true }, "hosted-git-info": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, "htmlparser2": { @@ -900,11 +1624,23 @@ "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", "dev": true, "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.3.0", - "domutils": "1.5.1", - "entities": "1.0.0", - "readable-stream": "1.1.14" + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "https-proxy-agent": { @@ -913,15 +1649,35 @@ "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", "dev": true, "requires": { - "agent-base": "4.2.1", - "debug": "3.1.0" + "agent-base": "^4.1.0", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } } }, "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } }, "indent-string": { "version": "2.1.0", @@ -929,7 +1685,7 @@ "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", "dev": true, "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, "inflight": { @@ -938,8 +1694,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -948,6 +1704,48 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -957,25 +1755,146 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-builtin-module": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, "is-finite": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "optional": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true, + "optional": true + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" } }, "is-utf8": { @@ -984,10 +1903,16 @@ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "isexe": { @@ -996,14 +1921,26 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, "js-yaml": { "version": "3.5.5", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz", "integrity": "sha1-A3fDgBfKvHMisNH7zSWkkWQfL74=", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "2.7.3" + "argparse": "^1.0.2", + "esprima": "^2.6.0" } }, "js2xmlparser": { @@ -1011,59 +1948,53 @@ "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", "requires": { - "xmlcreate": "1.0.2" + "xmlcreate": "^1.0.1" } }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, "jsdoc": { "version": "3.5.5", "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", - "integrity": "sha1-SEUhsSboGQTWMv+D7JqqCWcI+k0=", + "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", "requires": { "babylon": "7.0.0-beta.19", - "bluebird": "3.5.1", - "catharsis": "0.8.9", - "escape-string-regexp": "1.0.5", - "js2xmlparser": "3.0.0", - "klaw": "2.0.0", - "marked": "0.3.17", - "mkdirp": "0.5.1", - "requizzle": "0.2.1", - "strip-json-comments": "2.0.1", + "bluebird": "~3.5.0", + "catharsis": "~0.8.9", + "escape-string-regexp": "~1.0.5", + "js2xmlparser": "~3.0.0", + "klaw": "~2.0.0", + "marked": "~0.3.6", + "mkdirp": "~0.5.1", + "requizzle": "~0.2.1", + "strip-json-comments": "~2.0.1", "taffydb": "2.6.2", - "underscore": "1.8.3" + "underscore": "~1.8.3" } }, "jshint": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz", - "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", + "version": "2.9.6", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.6.tgz", + "integrity": "sha512-KO9SIAKTlJQOM4lE64GQUtGBRpTOuvbrRrSZw3AhUxMNG266nX9hK2cKA4SBhXOj0irJGyNyGSLT62HGOVDEOA==", "dev": true, "requires": { - "cli": "1.0.1", - "console-browserify": "1.1.0", - "exit": "0.1.2", - "htmlparser2": "3.8.3", - "lodash": "3.7.0", - "minimatch": "3.0.4", - "shelljs": "0.3.0", - "strip-json-comments": "1.0.4" + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.10", + "minimatch": "~3.0.2", + "phantom": "~4.0.1", + "phantomjs-prebuilt": "~2.1.7", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x", + "unicode-5.2.0": "^0.7.5" }, "dependencies": { - "lodash": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz", - "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, "strip-json-comments": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", @@ -1078,39 +2009,33 @@ "integrity": "sha512-RoCsyICcKA+6TFsbys9DpKTfPVaC71Mm5QSjvrWA0lDVN+LIvx6apa42FFisMqmCTvJ8DxkcoQGJ0j7m3kTVow==", "dev": true, "requires": { - "exit": "0.1.2", - "glob": "7.1.2", - "nopt": "3.0.6", - "readable-stream": "2.1.5" + "exit": "~0.1.2", + "glob": "~7.1.2", + "nopt": "~3.0.1", + "readable-stream": "~2.1.5" }, "dependencies": { "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1.1.1" + "abbrev": "1" } }, "process-nextick-args": { @@ -1121,36 +2046,84 @@ }, "readable-stream": { "version": "2.1.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", "integrity": "sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA=", "dev": true, "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" + "buffer-shims": "^1.0.0", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" } } } }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", "dev": true, + "optional": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true, + "optional": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true, + "optional": true + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "optional": true, "requires": { - "is-buffer": "1.1.6" + "graceful-fs": "^4.1.6" } }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kew": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", + "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", + "dev": true, + "optional": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, "klaw": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.9" } }, "lazy-cache": { @@ -1159,23 +2132,53 @@ "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", "dev": true }, + "liftoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", + "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "findup-sync": "^2.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + }, + "dependencies": { + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + } + } + }, "load-json-file": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, "longest": { @@ -1190,20 +2193,44 @@ "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", "dev": true, "requires": { - "currently-unhandled": "0.4.1", - "signal-exit": "3.0.2" + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" } }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, "map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", "dev": true }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, "marked": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.17.tgz", - "integrity": "sha512-+AKbNsjZl6jFfLPwHhWmGTqE009wTKn3RTmn9K8oUKHrX/abPJjtcRtXpYB/FFrwPJRUA86LX/de3T0knkPCmQ==" + "version": "0.3.19", + "resolved": "http://registry.npmjs.org/marked/-/marked-0.3.19.tgz", + "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==" }, "maxmin": { "version": "1.1.0", @@ -1211,61 +2238,145 @@ "integrity": "sha1-cTZehKmd2Piz99X94vANHn9zvmE=", "dev": true, "requires": { - "chalk": "1.1.3", - "figures": "1.7.0", - "gzip-size": "1.0.0", - "pretty-bytes": "1.0.4" + "chalk": "^1.0.0", + "figures": "^1.0.1", + "gzip-size": "^1.0.0", + "pretty-bytes": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } } }, "meow": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.4.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" }, "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, "mime": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==", "dev": true }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "dev": true + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "dev": true, + "requires": { + "mime-db": "~1.37.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -1277,25 +2388,50 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "nopt": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" + "abbrev": "1", + "osenv": "^0.1.4" } }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { - "hosted-git-info": "2.5.0", - "is-builtin-module": "1.0.0", - "semver": "5.5.0", - "validate-npm-package-license": "3.0.3" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "number-is-nan": { @@ -1304,19 +2440,97 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, + "optional": true + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "os-homedir": { @@ -1334,8 +2548,8 @@ "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, "p-each-series": { @@ -1344,7 +2558,7 @@ "integrity": "sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=", "dev": true, "requires": { - "p-reduce": "1.0.0" + "p-reduce": "^1.0.0" } }, "p-reduce": { @@ -1359,22 +2573,45 @@ "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", "dev": true }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + } + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "1.3.1" + "error-ex": "^1.2.0" } }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-is-absolute": { @@ -1383,15 +2620,36 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true + }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pend": { @@ -1400,6 +2658,43 @@ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "dev": true }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true, + "optional": true + }, + "phantom": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/phantom/-/phantom-4.0.12.tgz", + "integrity": "sha512-Tz82XhtPmwCk1FFPmecy7yRGZG2btpzY2KI9fcoPT7zT9det0CcMyfBFPp1S8DqzsnQnm8ZYEfdy528mwVtksA==", + "dev": true, + "optional": true, + "requires": { + "phantomjs-prebuilt": "^2.1.16", + "split": "^1.0.1", + "winston": "^2.4.0" + } + }, + "phantomjs-prebuilt": { + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", + "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", + "dev": true, + "optional": true, + "requires": { + "es6-promise": "^4.0.3", + "extract-zip": "^1.6.5", + "fs-extra": "^1.0.0", + "hasha": "^2.2.0", + "kew": "^0.7.0", + "progress": "^1.1.8", + "request": "^2.81.0", + "request-progress": "^2.0.1", + "which": "^1.2.10" + } + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -1418,17 +2713,23 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, "pretty-bytes": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", "dev": true, "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" + "get-stdin": "^4.0.1", + "meow": "^3.1.0" } }, "process-nextick-args": { @@ -1438,10 +2739,11 @@ "dev": true }, "progress": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", - "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", - "dev": true + "version": "1.1.8", + "resolved": "http://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true, + "optional": true }, "proxy-from-env": { "version": "1.0.0", @@ -1449,11 +2751,19 @@ "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=", "dev": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true, + "optional": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true, + "optional": true }, "puppeteer": { "version": "1.7.0", @@ -1461,36 +2771,55 @@ "integrity": "sha512-f+1DxKHPqce6CXUBz2eVO2WcATeVeQSOPG9GYaGObEZDCiCEUwG+gogjMsrvn7he2wHTqNVb5p6RUrwmr8XFBA==", "dev": true, "requires": { - "debug": "3.1.0", - "extract-zip": "1.6.7", - "https-proxy-agent": "2.2.1", - "mime": "2.3.1", - "progress": "2.0.0", - "proxy-from-env": "1.0.0", - "rimraf": "2.6.2", - "ws": "5.2.2" + "debug": "^3.1.0", + "extract-zip": "^1.6.6", + "https-proxy-agent": "^2.2.1", + "mime": "^2.0.3", + "progress": "^2.0.0", + "proxy-from-env": "^1.0.0", + "rimraf": "^2.6.1", + "ws": "^5.1.1" }, "dependencies": { - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "glob": "7.0.6" + "ms": "^2.1.1" } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", + "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", + "dev": true } } }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true, + "optional": true + }, "read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -1499,20 +2828,37 @@ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" } }, "readable-stream": { "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" } }, "redent": { @@ -1521,10 +2867,26 @@ "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", "dev": true, "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" } }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -1537,7 +2899,46 @@ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "dev": true, "requires": { - "is-finite": "1.0.2" + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "request-progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", + "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", + "dev": true, + "optional": true, + "requires": { + "throttleit": "^1.0.0" } }, "requizzle": { @@ -1545,7 +2946,7 @@ "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", "requires": { - "underscore": "1.6.0" + "underscore": "~1.6.0" }, "dependencies": { "underscore": { @@ -1561,31 +2962,109 @@ "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, "right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", "dev": true, "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, "rimraf": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", - "dev": true + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "shelljs": { @@ -1600,26 +3079,152 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, - "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spdx-correct": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", + "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", "dev": true }, "spdx-expression-parse": { @@ -1628,22 +3233,87 @@ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", + "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==", "dev": true }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "optional": true, + "requires": { + "through": "2" + } + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, "sprintf-js": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.1.tgz", "integrity": "sha1-Nr54Mgr+WAH2zqPueLblqrlA6gw=", "dev": true }, + "sshpk": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.1.tgz", + "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", + "dev": true, + "optional": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true, + "optional": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -1652,11 +3322,11 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -1665,7 +3335,7 @@ "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } }, "strip-indent": { @@ -1674,7 +3344,7 @@ "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", "dev": true, "requires": { - "get-stdin": "4.0.1" + "get-stdin": "^4.0.1" } }, "strip-json-comments": { @@ -1683,10 +3353,13 @@ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } }, "sync-exec": { "version": "0.6.2", @@ -1699,12 +3372,95 @@ "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=" }, + "throttleit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", + "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", + "dev": true, + "optional": true + }, + "through": { + "version": "2.3.8", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true, + "optional": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "optional": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + }, "trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", "dev": true }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -1713,19 +3469,19 @@ }, "uglify-js": { "version": "2.6.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.6.4.tgz", + "resolved": "http://registry.npmjs.org/uglify-js/-/uglify-js-2.6.4.tgz", "integrity": "sha1-ZeovswWck5RpLxX+2HwrNsFrmt8=", "dev": true, "requires": { - "async": "0.2.10", - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "async": "~0.2.6", + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" }, "dependencies": { "async": { "version": "0.2.10", - "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "resolved": "http://registry.npmjs.org/async/-/async-0.2.10.tgz", "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", "dev": true } @@ -1737,6 +3493,12 @@ "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", "dev": true }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, "underscore": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", @@ -1758,13 +3520,94 @@ } }, "underscore.string": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz", - "integrity": "sha1-LCo/n4PmR2L9xF5s6sZRQoZCE9s=", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", + "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", "dev": true, "requires": { - "sprintf-js": "1.1.1", - "util-deprecate": "1.0.2" + "sprintf-js": "^1.0.3", + "util-deprecate": "^1.0.2" + } + }, + "unicode-5.2.0": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/unicode-5.2.0/-/unicode-5.2.0-0.7.5.tgz", + "integrity": "sha512-KVGLW1Bri30x00yv4HNM8kBxoqFXr0Sbo55735nvrlsx4PYBZol3UtoWgO492fSwmsetzPEZzy73rbU8OGXJcA==", + "dev": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } } }, "uri-path": { @@ -1773,29 +3616,69 @@ "integrity": "sha1-l0fwGDWJM8Md4PzP2C0TjmcmLjI=", "dev": true }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true, + "optional": true + }, + "v8flags": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.0.2.tgz", + "integrity": "sha512-6sgSKoFw1UpUPd3cFdF7QGnrH6tDeBgW1F3v9gy8gLY0mlbiBXq8soy8aQpY6xeeCjH5K+JvC62Acp7gtl7wWA==", "dev": true, "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" + "homedir-polyfill": "^1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" } }, "which": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", - "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "window-size": { @@ -1804,6 +3687,37 @@ "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", "dev": true }, + "winston": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.4.tgz", + "integrity": "sha512-NBo2Pepn4hK4V01UfcWcDlmiVTs7VTB1h7bgnB0rgP146bYhMxX0ypCz3lBOfNxCO4Zuek7yeT+y/zM1OfMw4Q==", + "dev": true, + "optional": true, + "requires": { + "async": "~1.0.0", + "colors": "1.0.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "stack-trace": "0.0.x" + }, + "dependencies": { + "async": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=", + "dev": true, + "optional": true + }, + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true, + "optional": true + } + } + }, "wordwrap": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", @@ -1822,7 +3736,7 @@ "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", "dev": true, "requires": { - "async-limiter": "1.0.0" + "async-limiter": "~1.0.0" } }, "xmlcreate": { @@ -1830,21 +3744,15 @@ "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=" }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, "yargs": { "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", "dev": true, "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", "window-size": "0.1.0" }, "dependencies": { @@ -1862,7 +3770,7 @@ "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", "dev": true, "requires": { - "fd-slicer": "1.0.1" + "fd-slicer": "~1.0.1" } } } diff --git a/vendor/git.apache.org/thrift.git/lib/js/package.json b/vendor/git.apache.org/thrift.git/lib/js/package.json index a59cdc4..2ddd238 100644 --- a/vendor/git.apache.org/thrift.git/lib/js/package.json +++ b/vendor/git.apache.org/thrift.git/lib/js/package.json @@ -1,6 +1,6 @@ { "name": "thrift", - "version": "1.0.0", + "version": "0.12.0", "devDependencies": { "grunt": "^1.0.2", "grunt-cli": "^1.2.0", diff --git a/vendor/git.apache.org/thrift.git/lib/js/src/thrift.js b/vendor/git.apache.org/thrift.git/lib/js/src/thrift.js index 39e6db1..9418ca3 100644 --- a/vendor/git.apache.org/thrift.git/lib/js/src/thrift.js +++ b/vendor/git.apache.org/thrift.git/lib/js/src/thrift.js @@ -46,7 +46,7 @@ var Thrift = { * @const {string} Version * @memberof Thrift */ - Version: '1.0.0-dev', + Version: '0.12.0', /** * Thrift IDL type string to Id mapping. diff --git a/vendor/git.apache.org/thrift.git/lib/lua/THttpTransport.lua b/vendor/git.apache.org/thrift.git/lib/lua/THttpTransport.lua index 5bbfece..060a8ab 100644 --- a/vendor/git.apache.org/thrift.git/lib/lua/THttpTransport.lua +++ b/vendor/git.apache.org/thrift.git/lib/lua/THttpTransport.lua @@ -25,7 +25,7 @@ THttpTransport = TTransportBase:new{ wBuf = '', rBuf = '', CRLF = '\r\n', - VERSION = '1.0.0', + VERSION = '0.12.0', isServer = true } diff --git a/vendor/git.apache.org/thrift.git/lib/lua/Thrift.lua b/vendor/git.apache.org/thrift.git/lib/lua/Thrift.lua index a9a9078..d495729 100644 --- a/vendor/git.apache.org/thrift.git/lib/lua/Thrift.lua +++ b/vendor/git.apache.org/thrift.git/lib/lua/Thrift.lua @@ -48,7 +48,7 @@ function ttable_size(t) return count end -version = 1.0 +version = '0.12.0' TType = { STOP = 0, diff --git a/vendor/git.apache.org/thrift.git/lib/netcore/Thrift/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/lib/netcore/Thrift/Properties/AssemblyInfo.cs index e3118ab..68cd49c 100644 --- a/vendor/git.apache.org/thrift.git/lib/netcore/Thrift/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/lib/netcore/Thrift/Properties/AssemblyInfo.cs @@ -52,5 +52,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.1")] -[assembly: AssemblyFileVersion("1.0.0.1")] \ No newline at end of file +[assembly: AssemblyVersion("0.12.0.0")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/vendor/git.apache.org/thrift.git/lib/netcore/Thrift/Transports/Client/THttpClientTransport.cs b/vendor/git.apache.org/thrift.git/lib/netcore/Thrift/Transports/Client/THttpClientTransport.cs index 16754b2..6067141 100644 --- a/vendor/git.apache.org/thrift.git/lib/netcore/Thrift/Transports/Client/THttpClientTransport.cs +++ b/vendor/git.apache.org/thrift.git/lib/netcore/Thrift/Transports/Client/THttpClientTransport.cs @@ -149,7 +149,7 @@ namespace Thrift.Transports.Client } httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/x-thrift")); - httpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("THttpClientTransport", "1.0.0")); + httpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("THttpClientTransport", "0.12.0")); if (CustomHeaders != null) { @@ -223,4 +223,4 @@ namespace Thrift.Transports.Client _isDisposed = true; } } -} \ No newline at end of file +} diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/Makefile.am b/vendor/git.apache.org/thrift.git/lib/nodejs/Makefile.am index 9a7b4eb..68ea3ea 100755 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/Makefile.am +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/Makefile.am @@ -27,8 +27,9 @@ all-local: deps precross: deps stubs +# TODO: Lint nodejs lib and gen-code as part of build check: deps - cd $(top_srcdir) && $(NPM) test && cd lib/nodejs + cd $(top_srcdir) && $(NPM) test && $(NPM) run lint-tests && cd lib/nodejs clean-local: $(RM) -r test/gen-nodejs diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/lib/thrift/json_protocol.js b/vendor/git.apache.org/thrift.git/lib/nodejs/lib/thrift/json_protocol.js index d960be9..727a3b2 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/lib/thrift/json_protocol.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/lib/thrift/json_protocol.js @@ -18,7 +18,6 @@ */ var Int64 = require('node-int64'); -var InputBufferUnderrunError = require('./transport').InputBufferUnderrunError; var Thrift = require('./thrift'); var Type = Thrift.Type; var util = require("util"); diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/binary.test.js b/vendor/git.apache.org/thrift.git/lib/nodejs/test/binary.test.js index 38ba634..187cd18 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/binary.test.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/binary.test.js @@ -17,19 +17,19 @@ * under the License. */ -var test = require('tape'); -var binary = require('thrift/binary'); +const test = require("tape"); +const binary = require("thrift/binary"); -var cases = { - "Should read signed byte": function(assert){ +const cases = { + "Should read signed byte": function(assert) { assert.equal(1, binary.readByte(0x01)); - assert.equal(-1, binary.readByte(0xFF)); + assert.equal(-1, binary.readByte(0xff)); - assert.equal(127, binary.readByte(0x7F)); + assert.equal(127, binary.readByte(0x7f)); assert.equal(-128, binary.readByte(0x80)); assert.end(); }, - "Should write byte": function(assert){ + "Should write byte": function(assert) { //Protocol simply writes to the buffer. Nothing to test.. yet. assert.ok(true); assert.end(); @@ -76,58 +76,135 @@ var cases = { assert.deepEqual([0xff, 0xff, 0xff, 0xff], binary.writeI32([], -1)); // Min I32 - assert.deepEqual([0x80, 0x00, 0x00, 0x00], binary.writeI32([], -2147483648)); + assert.deepEqual( + [0x80, 0x00, 0x00, 0x00], + binary.writeI32([], -2147483648) + ); // Max I32 assert.deepEqual([0x7f, 0xff, 0xff, 0xff], binary.writeI32([], 2147483647)); assert.end(); }, "Should read doubles": function(assert) { - assert.equal(0, binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) - assert.equal(0, binary.readDouble([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) - assert.equal(1, binary.readDouble([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) - assert.equal(2, binary.readDouble([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) - assert.equal(-2, binary.readDouble([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) + assert.equal( + 0, + binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) + ); + assert.equal( + 0, + binary.readDouble([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) + ); + assert.equal( + 1, + binary.readDouble([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) + ); + assert.equal( + 2, + binary.readDouble([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) + ); + assert.equal( + -2, + binary.readDouble([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) + ); - assert.equal(Math.PI, binary.readDouble([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18])) + assert.equal( + Math.PI, + binary.readDouble([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18]) + ); - assert.equal(Infinity, binary.readDouble([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) - assert.equal(-Infinity, binary.readDouble([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) + assert.equal( + Infinity, + binary.readDouble([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) + ); + assert.equal( + -Infinity, + binary.readDouble([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) + ); - assert.ok(isNaN(binary.readDouble([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))) + assert.ok( + isNaN(binary.readDouble([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) + ); - assert.equal(1/3, binary.readDouble([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55])) + assert.equal( + 1 / 3, + binary.readDouble([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55]) + ); // Min subnormal positive double - assert.equal(4.9406564584124654e-324, binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])) + assert.equal( + 4.9406564584124654e-324, + binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]) + ); // Min normal positive double - assert.equal(2.2250738585072014e-308, binary.readDouble([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])) + assert.equal( + 2.2250738585072014e-308, + binary.readDouble([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) + ); // Max positive double - assert.equal(1.7976931348623157e308, binary.readDouble([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])) + assert.equal( + 1.7976931348623157e308, + binary.readDouble([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]) + ); assert.end(); }, "Should write doubles": function(assert) { - assert.deepEqual([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 0)); - assert.deepEqual([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 1)); - assert.deepEqual([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 2)); - assert.deepEqual([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], -2)); + assert.deepEqual( + [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + binary.writeDouble([], 0) + ); + assert.deepEqual( + [0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + binary.writeDouble([], 1) + ); + assert.deepEqual( + [0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + binary.writeDouble([], 2) + ); + assert.deepEqual( + [0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + binary.writeDouble([], -2) + ); - assert.deepEqual([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18], binary.writeDouble([], Math.PI)); + assert.deepEqual( + [0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18], + binary.writeDouble([], Math.PI) + ); - assert.deepEqual([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], Infinity)); - assert.deepEqual([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], -Infinity)); + assert.deepEqual( + [0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + binary.writeDouble([], Infinity) + ); + assert.deepEqual( + [0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + binary.writeDouble([], -Infinity) + ); - assert.deepEqual([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], NaN)); + assert.deepEqual( + [0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + binary.writeDouble([], NaN) + ); - assert.deepEqual([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55], binary.writeDouble([], 1/3)); + assert.deepEqual( + [0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55], + binary.writeDouble([], 1 / 3) + ); // Min subnormal positive double - assert.deepEqual([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], binary.writeDouble([], 4.9406564584124654e-324)); + assert.deepEqual( + [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], + binary.writeDouble([], 4.9406564584124654e-324) + ); // Min normal positive double - assert.deepEqual([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 2.2250738585072014e-308)); + assert.deepEqual( + [0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], + binary.writeDouble([], 2.2250738585072014e-308) + ); // Max positive double - assert.deepEqual([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], binary.writeDouble([], 1.7976931348623157e308)); + assert.deepEqual( + [0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], + binary.writeDouble([], 1.7976931348623157e308) + ); assert.end(); } }; diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/client.js b/vendor/git.apache.org/thrift.git/lib/nodejs/test/client.js index 55839f6..49e3a5e 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/client.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/client.js @@ -19,125 +19,149 @@ * under the License. */ -var fs = require('fs'); -var assert = require('assert'); -var thrift = require('thrift'); -var helpers = require('./helpers'); -var ThriftTest = require('./gen-nodejs/ThriftTest'); -var ThriftTestDriver = require('./test_driver').ThriftTestDriver; -var ThriftTestDriverPromise = require('./test_driver').ThriftTestDriverPromise; -var SecondService = require('./gen-nodejs/SecondService'); -var ttypes = require('./gen-nodejs/ThriftTest_types'); +const assert = require("assert"); +const thrift = require("thrift"); +const helpers = require("./helpers"); -var program = require('commander'); +const ThriftTest = require(`./${helpers.genPath}/ThriftTest`); +const ThriftTestDriver = require("./test_driver").ThriftTestDriver; +const ThriftTestDriverPromise = require("./test_driver") + .ThriftTestDriverPromise; +const SecondService = require(`./${helpers.genPath}/SecondService`); + +const program = require("commander"); program - .option('-p, --protocol ', 'Set thrift protocol (binary|compact|json) [protocol]') - .option('-t, --transport ', 'Set thrift transport (buffered|framed|http) [transport]') - .option('--port ', 'Set thrift server port number to connect', 9090) - .option('--host ', 'Set thrift server host to connect', 'localhost') - .option('--domain-socket ', 'Set thrift server unix domain socket to connect') - .option('--ssl', 'use SSL transport') - .option('--promise', 'test with promise style functions') - .option('-t, --type ', 'Select server type (http|multiplex|tcp|websocket)', 'tcp') + .option( + "-p, --protocol ", + "Set thrift protocol (binary|compact|json) [protocol]" + ) + .option( + "-t, --transport ", + "Set thrift transport (buffered|framed|http) [transport]" + ) + .option("--port ", "Set thrift server port number to connect", 9090) + .option("--host ", "Set thrift server host to connect", "localhost") + .option( + "--domain-socket ", + "Set thrift server unix domain socket to connect" + ) + .option("--ssl", "use SSL transport") + .option("--callback", "test with callback style functions") + .option( + "-t, --type ", + "Select server type (http|multiplex|tcp|websocket)", + "tcp" + ) + .option("--es6", "Use es6 code") + .option("--es5", "Use es5 code") .parse(process.argv); -var host = program.host; -var port = program.port; -var domainSocket = program.domainSocket; -var type = program.type; -var ssl = program.ssl; -var promise = program.promise; +const host = program.host; +const port = program.port; +const domainSocket = program.domainSocket; +const ssl = program.ssl; +let type = program.type; /* for compatibility with cross test invocation for http transport testing */ -if (program.transport === 'http') { - program.transport = 'buffered'; - type = 'http'; +if (program.transport === "http") { + program.transport = "buffered"; + type = "http"; } -var options = { +const options = { transport: helpers.transports[program.transport], protocol: helpers.protocols[program.protocol] }; -if (type === 'http' || type === 'websocket') { - options.path = '/test'; +if (type === "http" || type === "websocket") { + options.path = "/test"; } -if (type === 'http') { - options.headers = {"Connection": "close"}; +if (type === "http") { + options.headers = { Connection: "close" }; } if (ssl) { - if (type === 'tcp' || type === 'multiplex') { + if (type === "tcp" || type === "multiplex") { options.rejectUnauthorized = false; - } else if (type === 'http') { + } else if (type === "http") { options.nodeOptions = { rejectUnauthorized: false }; options.https = true; - } else if (type === 'websocket') { + } else if (type === "websocket") { options.wsOptions = { rejectUnauthorized: false }; options.secure = true; } } -var connection; -var client; -var testDriver = promise ? ThriftTestDriverPromise : ThriftTestDriver; +let connection; +let client; +const testDriver = program.callback + ? ThriftTestDriver + : ThriftTestDriverPromise; +if (helpers.ecmaMode === "es6" && program.callback) { + console.log("ES6 does not support callback style"); + process.exit(0); +} -if (type === 'tcp' || type === 'multiplex') { +if (type === "tcp" || type === "multiplex") { if (domainSocket) { connection = thrift.createUDSConnection(domainSocket, options); } else { - connection = ssl ? - thrift.createSSLConnection(host, port, options) : - thrift.createConnection(host, port, options); + connection = ssl + ? thrift.createSSLConnection(host, port, options) + : thrift.createConnection(host, port, options); } -} else if (type === 'http') { +} else if (type === "http") { if (domainSocket) { connection = thrift.createHttpUDSConnection(domainSocket, options); } else { connection = thrift.createHttpConnection(host, port, options); } -} else if (type === 'websocket') { +} else if (type === "websocket") { connection = thrift.createWSConnection(host, port, options); connection.open(); } -connection.on('error', function(err) { - assert(false, err); +connection.on("error", function(err) { + assert(false, err); }); -if (type === 'tcp') { +if (type === "tcp") { client = thrift.createClient(ThriftTest, connection); runTests(); -} else if (type === 'multiplex') { - var mp = new thrift.Multiplexer(); +} else if (type === "multiplex") { + const mp = new thrift.Multiplexer(); client = mp.createClient("ThriftTest", ThriftTest, connection); - secondclient = mp.createClient("SecondService", SecondService, connection); + const secondclient = mp.createClient( + "SecondService", + SecondService, + connection + ); - connection.on('connect', function() { + connection.on("connect", function() { secondclient.secondtestString("Test", function(err, response) { assert(!err); - assert.equal("testString(\"Test\")", response); + assert.equal('testString("Test")', response); }); runTests(); }); -} else if (type === 'http') { +} else if (type === "http") { client = thrift.createHttpClient(ThriftTest, connection); runTests(); -} else if (type === 'websocket') { +} else if (type === "websocket") { client = thrift.createWSClient(ThriftTest, connection); runTests(); } function runTests() { - testDriver(client, function (status) { + testDriver(client, function(status) { console.log(status); - if (type !== 'http' && type !== 'websocket') { + if (type !== "http" && type !== "websocket") { connection.end(); } - if (type !== 'multiplex') { + if (type !== "multiplex") { process.exit(0); } }); diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/deep-constructor.test.js b/vendor/git.apache.org/thrift.git/lib/nodejs/test/deep-constructor.test.js index 145b668..504dacf 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/deep-constructor.test.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/deep-constructor.test.js @@ -17,39 +17,36 @@ * under the License. */ -var ttypes = require('./gen-nodejs/JsDeepConstructorTest_types'); -var thrift = require('thrift'); -var test = require('tape'); -var bufferEquals = require('buffer-equals'); +const ttypes = require("./gen-nodejs/JsDeepConstructorTest_types"); +const thrift = require("thrift"); +const test = require("tape"); +const bufferEquals = require("buffer-equals"); function serializeBinary(data) { - var buff; - var transport = new thrift.TBufferedTransport(null, function(msg){ + let buff; + const transport = new thrift.TBufferedTransport(null, function(msg) { buff = msg; }); - var prot = new thrift.TBinaryProtocol(transport); + const prot = new thrift.TBinaryProtocol(transport); data.write(prot); prot.flush(); return buff; - } - function deserializeBinary(serialized, type) { - var t = new thrift.TFramedTransport(serialized); - var p = new thrift.TBinaryProtocol(t); - var data = new type(); + const t = new thrift.TFramedTransport(serialized); + const p = new thrift.TBinaryProtocol(t); + const data = new type(); data.read(p); return data; } - function serializeJSON(data) { - var buff; - var transport = new thrift.TBufferedTransport(null, function(msg){ + let buff; + const transport = new thrift.TBufferedTransport(null, function(msg) { buff = msg; }); - var protocol = new thrift.TJSONProtocol(transport); + const protocol = new thrift.TJSONProtocol(transport); protocol.writeMessageBegin("", 0, 0); data.write(protocol); protocol.writeMessageEnd(); @@ -57,45 +54,41 @@ function serializeJSON(data) { return buff; } - function deserializeJSON(serialized, type) { - var transport = new thrift.TFramedTransport(serialized); - var protocol = new thrift.TJSONProtocol(transport); + const transport = new thrift.TFramedTransport(serialized); + const protocol = new thrift.TJSONProtocol(transport); protocol.readMessageBegin(); - var data = new type(); + const data = new type(); data.read(protocol); protocol.readMessageEnd(); return data; } - function createThriftObj() { - return new ttypes.Complex({ - - struct_field: new ttypes.Simple({value: 'a'}), + struct_field: new ttypes.Simple({ value: "a" }), struct_list_field: [ - new ttypes.Simple({value: 'b'}), - new ttypes.Simple({value: 'c'}), + new ttypes.Simple({ value: "b" }), + new ttypes.Simple({ value: "c" }) ], struct_set_field: [ - new ttypes.Simple({value: 'd'}), - new ttypes.Simple({value: 'e'}), + new ttypes.Simple({ value: "d" }), + new ttypes.Simple({ value: "e" }) ], struct_map_field: { - A: new ttypes.Simple({value: 'f'}), - B: new ttypes.Simple({value: 'g'}) + A: new ttypes.Simple({ value: "f" }), + B: new ttypes.Simple({ value: "g" }) }, struct_nested_containers_field: [ [ { C: [ - new ttypes.Simple({value: 'h'}), - new ttypes.Simple({value: 'i'}) + new ttypes.Simple({ value: "h" }), + new ttypes.Simple({ value: "i" }) ] } ] @@ -104,59 +97,57 @@ function createThriftObj() { struct_nested_containers_field2: { D: [ { - DA: new ttypes.Simple({value: 'j'}) + DA: new ttypes.Simple({ value: "j" }) }, { - DB: new ttypes.Simple({value: 'k'}) + DB: new ttypes.Simple({ value: "k" }) } ] }, list_of_list_field: [ - ['l00', 'l01', 'l02'], - ['l10', 'l11', 'l12'], - ['l20', 'l21', 'l22'], + ["l00", "l01", "l02"], + ["l10", "l11", "l12"], + ["l20", "l21", "l22"] ], list_of_list_of_list_field: [ - [['m000', 'm001', 'm002'], ['m010', 'm011', 'm012'], ['m020', 'm021', 'm022']], - [['m100', 'm101', 'm102'], ['m110', 'm111', 'm112'], ['m120', 'm121', 'm122']], - [['m200', 'm201', 'm202'], ['m210', 'm211', 'm212'], ['m220', 'm221', 'm222']], - ], - - + [ + ["m000", "m001", "m002"], + ["m010", "m011", "m012"], + ["m020", "m021", "m022"] + ], + [ + ["m100", "m101", "m102"], + ["m110", "m111", "m112"], + ["m120", "m121", "m122"] + ], + [ + ["m200", "m201", "m202"], + ["m210", "m211", "m212"], + ["m220", "m221", "m222"] + ] + ] }); } - function createJsObj() { - return { + struct_field: { value: "a" }, - struct_field: {value: 'a'}, + struct_list_field: [{ value: "b" }, { value: "c" }], - struct_list_field: [ - {value: 'b'}, - {value: 'c'}, - ], - - struct_set_field: [ - {value: 'd'}, - {value: 'e'}, - ], + struct_set_field: [{ value: "d" }, { value: "e" }], struct_map_field: { - A: {value: 'f'}, - B: {value: 'g'} + A: { value: "f" }, + B: { value: "g" } }, struct_nested_containers_field: [ [ { - C: [ - {value: 'h'}, - {value: 'i'} - ] + C: [{ value: "h" }, { value: "i" }] } ] ], @@ -164,131 +155,142 @@ function createJsObj() { struct_nested_containers_field2: { D: [ { - DA: {value: 'j'} + DA: { value: "j" } }, { - DB: {value: 'k'} + DB: { value: "k" } } ] }, list_of_list_field: [ - ['l00', 'l01', 'l02'], - ['l10', 'l11', 'l12'], - ['l20', 'l21', 'l22'], + ["l00", "l01", "l02"], + ["l10", "l11", "l12"], + ["l20", "l21", "l22"] ], list_of_list_of_list_field: [ - [['m000', 'm001', 'm002'], ['m010', 'm011', 'm012'], ['m020', 'm021', 'm022']], - [['m100', 'm101', 'm102'], ['m110', 'm111', 'm112'], ['m120', 'm121', 'm122']], - [['m200', 'm201', 'm202'], ['m210', 'm211', 'm212'], ['m220', 'm221', 'm222']], - ], - + [ + ["m000", "m001", "m002"], + ["m010", "m011", "m012"], + ["m020", "m021", "m022"] + ], + [ + ["m100", "m101", "m102"], + ["m110", "m111", "m112"], + ["m120", "m121", "m122"] + ], + [ + ["m200", "m201", "m202"], + ["m210", "m211", "m212"], + ["m220", "m221", "m222"] + ] + ] }; } - function assertValues(obj, assert) { - assert.equals(obj.struct_field.value, 'a'); - assert.equals(obj.struct_list_field[0].value, 'b'); - assert.equals(obj.struct_list_field[1].value, 'c'); - assert.equals(obj.struct_set_field[0].value, 'd'); - assert.equals(obj.struct_set_field[1].value, 'e'); - assert.equals(obj.struct_map_field.A.value, 'f'); - assert.equals(obj.struct_map_field.B.value, 'g'); - assert.equals(obj.struct_nested_containers_field[0][0].C[0].value, 'h'); - assert.equals(obj.struct_nested_containers_field[0][0].C[1].value, 'i'); - assert.equals(obj.struct_nested_containers_field2.D[0].DA.value, 'j'); - assert.equals(obj.struct_nested_containers_field2.D[1].DB.value, 'k'); - assert.equals(obj.list_of_list_field[0][0], 'l00'); - assert.equals(obj.list_of_list_field[0][1], 'l01'); - assert.equals(obj.list_of_list_field[0][2], 'l02'); - assert.equals(obj.list_of_list_field[1][0], 'l10'); - assert.equals(obj.list_of_list_field[1][1], 'l11'); - assert.equals(obj.list_of_list_field[1][2], 'l12'); - assert.equals(obj.list_of_list_field[2][0], 'l20'); - assert.equals(obj.list_of_list_field[2][1], 'l21'); - assert.equals(obj.list_of_list_field[2][2], 'l22'); + assert.equals(obj.struct_field.value, "a"); + assert.equals(obj.struct_list_field[0].value, "b"); + assert.equals(obj.struct_list_field[1].value, "c"); + assert.equals(obj.struct_set_field[0].value, "d"); + assert.equals(obj.struct_set_field[1].value, "e"); + assert.equals(obj.struct_map_field.A.value, "f"); + assert.equals(obj.struct_map_field.B.value, "g"); + assert.equals(obj.struct_nested_containers_field[0][0].C[0].value, "h"); + assert.equals(obj.struct_nested_containers_field[0][0].C[1].value, "i"); + assert.equals(obj.struct_nested_containers_field2.D[0].DA.value, "j"); + assert.equals(obj.struct_nested_containers_field2.D[1].DB.value, "k"); + assert.equals(obj.list_of_list_field[0][0], "l00"); + assert.equals(obj.list_of_list_field[0][1], "l01"); + assert.equals(obj.list_of_list_field[0][2], "l02"); + assert.equals(obj.list_of_list_field[1][0], "l10"); + assert.equals(obj.list_of_list_field[1][1], "l11"); + assert.equals(obj.list_of_list_field[1][2], "l12"); + assert.equals(obj.list_of_list_field[2][0], "l20"); + assert.equals(obj.list_of_list_field[2][1], "l21"); + assert.equals(obj.list_of_list_field[2][2], "l22"); - assert.equals(obj.list_of_list_of_list_field[0][0][0], 'm000'); - assert.equals(obj.list_of_list_of_list_field[0][0][1], 'm001'); - assert.equals(obj.list_of_list_of_list_field[0][0][2], 'm002'); - assert.equals(obj.list_of_list_of_list_field[0][1][0], 'm010'); - assert.equals(obj.list_of_list_of_list_field[0][1][1], 'm011'); - assert.equals(obj.list_of_list_of_list_field[0][1][2], 'm012'); - assert.equals(obj.list_of_list_of_list_field[0][2][0], 'm020'); - assert.equals(obj.list_of_list_of_list_field[0][2][1], 'm021'); - assert.equals(obj.list_of_list_of_list_field[0][2][2], 'm022'); + assert.equals(obj.list_of_list_of_list_field[0][0][0], "m000"); + assert.equals(obj.list_of_list_of_list_field[0][0][1], "m001"); + assert.equals(obj.list_of_list_of_list_field[0][0][2], "m002"); + assert.equals(obj.list_of_list_of_list_field[0][1][0], "m010"); + assert.equals(obj.list_of_list_of_list_field[0][1][1], "m011"); + assert.equals(obj.list_of_list_of_list_field[0][1][2], "m012"); + assert.equals(obj.list_of_list_of_list_field[0][2][0], "m020"); + assert.equals(obj.list_of_list_of_list_field[0][2][1], "m021"); + assert.equals(obj.list_of_list_of_list_field[0][2][2], "m022"); - assert.equals(obj.list_of_list_of_list_field[1][0][0], 'm100'); - assert.equals(obj.list_of_list_of_list_field[1][0][1], 'm101'); - assert.equals(obj.list_of_list_of_list_field[1][0][2], 'm102'); - assert.equals(obj.list_of_list_of_list_field[1][1][0], 'm110'); - assert.equals(obj.list_of_list_of_list_field[1][1][1], 'm111'); - assert.equals(obj.list_of_list_of_list_field[1][1][2], 'm112'); - assert.equals(obj.list_of_list_of_list_field[1][2][0], 'm120'); - assert.equals(obj.list_of_list_of_list_field[1][2][1], 'm121'); - assert.equals(obj.list_of_list_of_list_field[1][2][2], 'm122'); + assert.equals(obj.list_of_list_of_list_field[1][0][0], "m100"); + assert.equals(obj.list_of_list_of_list_field[1][0][1], "m101"); + assert.equals(obj.list_of_list_of_list_field[1][0][2], "m102"); + assert.equals(obj.list_of_list_of_list_field[1][1][0], "m110"); + assert.equals(obj.list_of_list_of_list_field[1][1][1], "m111"); + assert.equals(obj.list_of_list_of_list_field[1][1][2], "m112"); + assert.equals(obj.list_of_list_of_list_field[1][2][0], "m120"); + assert.equals(obj.list_of_list_of_list_field[1][2][1], "m121"); + assert.equals(obj.list_of_list_of_list_field[1][2][2], "m122"); - assert.equals(obj.list_of_list_of_list_field[2][0][0], 'm200'); - assert.equals(obj.list_of_list_of_list_field[2][0][1], 'm201'); - assert.equals(obj.list_of_list_of_list_field[2][0][2], 'm202'); - assert.equals(obj.list_of_list_of_list_field[2][1][0], 'm210'); - assert.equals(obj.list_of_list_of_list_field[2][1][1], 'm211'); - assert.equals(obj.list_of_list_of_list_field[2][1][2], 'm212'); - assert.equals(obj.list_of_list_of_list_field[2][2][0], 'm220'); - assert.equals(obj.list_of_list_of_list_field[2][2][1], 'm221'); - assert.equals(obj.list_of_list_of_list_field[2][2][2], 'm222'); + assert.equals(obj.list_of_list_of_list_field[2][0][0], "m200"); + assert.equals(obj.list_of_list_of_list_field[2][0][1], "m201"); + assert.equals(obj.list_of_list_of_list_field[2][0][2], "m202"); + assert.equals(obj.list_of_list_of_list_field[2][1][0], "m210"); + assert.equals(obj.list_of_list_of_list_field[2][1][1], "m211"); + assert.equals(obj.list_of_list_of_list_field[2][1][2], "m212"); + assert.equals(obj.list_of_list_of_list_field[2][2][0], "m220"); + assert.equals(obj.list_of_list_of_list_field[2][2][1], "m221"); + assert.equals(obj.list_of_list_of_list_field[2][2][2], "m222"); } function createTestCases(serialize, deserialize) { - - var cases = { - - "Serialize/deserialize should return equal object": function(assert){ - var tObj = createThriftObj(); - var received = deserialize(serialize(tObj), ttypes.Complex); - assert.ok(tObj !== received, 'not the same object'); + const cases = { + "Serialize/deserialize should return equal object": function(assert) { + const tObj = createThriftObj(); + const received = deserialize(serialize(tObj), ttypes.Complex); + assert.ok(tObj !== received, "not the same object"); assert.deepEqual(tObj, received); assert.end(); }, - "Nested structs and containers initialized from plain js objects should serialize same as if initialized from thrift objects": function(assert) { - var tObj1 = createThriftObj(); - var tObj2 = new ttypes.Complex(createJsObj()); + "Nested structs and containers initialized from plain js objects should serialize same as if initialized from thrift objects": function( + assert + ) { + const tObj1 = createThriftObj(); + const tObj2 = new ttypes.Complex(createJsObj()); assertValues(tObj2, assert); - var s1 = serialize(tObj1); - var s2 = serialize(tObj2); + const s1 = serialize(tObj1); + const s2 = serialize(tObj2); assert.ok(bufferEquals(s1, s2)); assert.end(); }, - "Modifications to args object should not affect constructed Thrift object": function (assert) { - - var args = createJsObj(); + "Modifications to args object should not affect constructed Thrift object": function( + assert + ) { + const args = createJsObj(); assertValues(args, assert); - var tObj = new ttypes.Complex(args); + const tObj = new ttypes.Complex(args); assertValues(tObj, assert); - args.struct_field.value = 'ZZZ'; - args.struct_list_field[0].value = 'ZZZ'; - args.struct_list_field[1].value = 'ZZZ'; - args.struct_set_field[0].value = 'ZZZ'; - args.struct_set_field[1].value = 'ZZZ'; - args.struct_map_field.A.value = 'ZZZ'; - args.struct_map_field.B.value = 'ZZZ'; - args.struct_nested_containers_field[0][0].C[0] = 'ZZZ'; - args.struct_nested_containers_field[0][0].C[1] = 'ZZZ'; - args.struct_nested_containers_field2.D[0].DA = 'ZZZ'; - args.struct_nested_containers_field2.D[0].DB = 'ZZZ'; + args.struct_field.value = "ZZZ"; + args.struct_list_field[0].value = "ZZZ"; + args.struct_list_field[1].value = "ZZZ"; + args.struct_set_field[0].value = "ZZZ"; + args.struct_set_field[1].value = "ZZZ"; + args.struct_map_field.A.value = "ZZZ"; + args.struct_map_field.B.value = "ZZZ"; + args.struct_nested_containers_field[0][0].C[0] = "ZZZ"; + args.struct_nested_containers_field[0][0].C[1] = "ZZZ"; + args.struct_nested_containers_field2.D[0].DA = "ZZZ"; + args.struct_nested_containers_field2.D[0].DB = "ZZZ"; assertValues(tObj, assert); assert.end(); }, "nulls are ok": function(assert) { - var tObj = new ttypes.Complex({ + const tObj = new ttypes.Complex({ struct_field: null, struct_list_field: null, struct_set_field: null, @@ -296,7 +298,7 @@ function createTestCases(serialize, deserialize) { struct_nested_containers_field: null, struct_nested_containers_field2: null }); - var received = deserialize(serialize(tObj), ttypes.Complex); + const received = deserialize(serialize(tObj), ttypes.Complex); assert.strictEqual(tObj.struct_field, null); assert.ok(tObj !== received); assert.deepEqual(tObj, received); @@ -304,11 +306,11 @@ function createTestCases(serialize, deserialize) { }, "Can make list with objects": function(assert) { - var tObj = new ttypes.ComplexList({ - "struct_list_field": [new ttypes.Complex({})] + const tObj = new ttypes.ComplexList({ + struct_list_field: [new ttypes.Complex({})] }); - var innerObj = tObj.struct_list_field[0]; - assert.ok(innerObj instanceof ttypes.Complex) + const innerObj = tObj.struct_list_field[0]; + assert.ok(innerObj instanceof ttypes.Complex); assert.strictEqual(innerObj.struct_field, null); assert.strictEqual(innerObj.struct_list_field, null); assert.strictEqual(innerObj.struct_set_field, null); @@ -317,17 +319,15 @@ function createTestCases(serialize, deserialize) { assert.strictEqual(innerObj.struct_nested_containers_field2, null); assert.end(); } - }; return cases; } - -function run(name, cases){ +function run(name, cases) { Object.keys(cases).forEach(function(caseName) { - test(name + ': ' + caseName, cases[caseName]); + test(name + ": " + caseName, cases[caseName]); }); } -run('binary', createTestCases(serializeBinary, deserializeBinary)); -run('json', createTestCases(serializeJSON, deserializeJSON)); +run("binary", createTestCases(serializeBinary, deserializeBinary)); +run("json", createTestCases(serializeJSON, deserializeJSON)); diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/exceptions.js b/vendor/git.apache.org/thrift.git/lib/nodejs/test/exceptions.js index afb3f67..ab2798a 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/exceptions.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/exceptions.js @@ -17,72 +17,130 @@ * under the License. */ -'use strict'; -var test = require('tape'); -var thrift = require('../lib/thrift/thrift.js'); -var InputBufferUnderrunError = require('../lib/thrift/input_buffer_underrun_error'); +"use strict"; +const test = require("tape"); +const thrift = require("../lib/thrift/thrift.js"); +const InputBufferUnderrunError = require("../lib/thrift/input_buffer_underrun_error"); -test('TApplicationException', function t(assert) { - var e = new thrift.TApplicationException(1, 'foo'); - assert.ok(e instanceof thrift.TApplicationException, 'is instanceof TApplicationException'); - assert.ok(e instanceof thrift.TException, 'is instanceof TException'); - assert.ok(e instanceof Error, 'is instanceof Error'); - assert.equal(typeof e.stack, 'string', 'has stack trace'); - assert.ok(/^TApplicationException: foo/.test(e.stack), 'Stack trace has correct error name and message'); - assert.ok(e.stack.indexOf('test/exceptions.js:7:11') !== -1, 'stack trace starts on correct line and column'); - assert.equal(e.name, 'TApplicationException', 'has function name TApplicationException'); - assert.equal(e.message, 'foo', 'has error message "foo"'); - assert.equal(e.type, 1, 'has type 1'); +test("TApplicationException", function t(assert) { + const e = new thrift.TApplicationException(1, "foo"); + assert.ok( + e instanceof thrift.TApplicationException, + "is instanceof TApplicationException" + ); + assert.ok(e instanceof thrift.TException, "is instanceof TException"); + assert.ok(e instanceof Error, "is instanceof Error"); + assert.equal(typeof e.stack, "string", "has stack trace"); + assert.ok( + /^TApplicationException: foo/.test(e.stack), + "Stack trace has correct error name and message" + ); + assert.ok( + e.stack.indexOf("test/exceptions.js:7:11") !== -1, + "stack trace starts on correct line and column" + ); + assert.equal( + e.name, + "TApplicationException", + "has function name TApplicationException" + ); + assert.equal(e.message, "foo", 'has error message "foo"'); + assert.equal(e.type, 1, "has type 1"); assert.end(); }); -test('unexpected TApplicationException ', function t(assert) { - var e = new thrift.TApplicationException(1, 100); - assert.ok(e instanceof thrift.TApplicationException, 'is instanceof TApplicationException'); - assert.ok(e instanceof thrift.TException, 'is instanceof TException'); - assert.ok(e instanceof Error, 'is instanceof Error'); - assert.equal(typeof e.stack, 'string', 'has stack trace'); - assert.ok(/^TApplicationException: 100/.test(e.stack), 'Stack trace has correct error name and message'); - assert.ok(e.stack.indexOf('test/exceptions.js:7:11') !== -1, 'stack trace starts on correct line and column'); - assert.equal(e.name, 'TApplicationException', 'has function name TApplicationException'); - assert.equal(e.message, 100, 'has error message 100'); - assert.equal(e.type, 1, 'has type 1'); +test("unexpected TApplicationException ", function t(assert) { + const e = new thrift.TApplicationException(1, 100); + assert.ok( + e instanceof thrift.TApplicationException, + "is instanceof TApplicationException" + ); + assert.ok(e instanceof thrift.TException, "is instanceof TException"); + assert.ok(e instanceof Error, "is instanceof Error"); + assert.equal(typeof e.stack, "string", "has stack trace"); + assert.ok( + /^TApplicationException: 100/.test(e.stack), + "Stack trace has correct error name and message" + ); + assert.ok( + e.stack.indexOf("test/exceptions.js:7:11") !== -1, + "stack trace starts on correct line and column" + ); + assert.equal( + e.name, + "TApplicationException", + "has function name TApplicationException" + ); + assert.equal(e.message, 100, "has error message 100"); + assert.equal(e.type, 1, "has type 1"); assert.end(); }); -test('TException', function t(assert) { - var e = new thrift.TException('foo'); - assert.ok(e instanceof thrift.TException, 'is instanceof TException'); - assert.ok(e instanceof Error, 'is instanceof Error'); - assert.equal(typeof e.stack, 'string', 'has stack trace'); - assert.ok(/^TException: foo/.test(e.stack), 'Stack trace has correct error name and message'); - assert.ok(e.stack.indexOf('test/exceptions.js:21:11') !== -1, 'stack trace starts on correct line and column'); - assert.equal(e.name, 'TException', 'has function name TException'); - assert.equal(e.message, 'foo', 'has error message "foo"'); +test("TException", function t(assert) { + const e = new thrift.TException("foo"); + assert.ok(e instanceof thrift.TException, "is instanceof TException"); + assert.ok(e instanceof Error, "is instanceof Error"); + assert.equal(typeof e.stack, "string", "has stack trace"); + assert.ok( + /^TException: foo/.test(e.stack), + "Stack trace has correct error name and message" + ); + assert.ok( + e.stack.indexOf("test/exceptions.js:21:11") !== -1, + "stack trace starts on correct line and column" + ); + assert.equal(e.name, "TException", "has function name TException"); + assert.equal(e.message, "foo", 'has error message "foo"'); assert.end(); }); -test('TProtocolException', function t(assert) { - var e = new thrift.TProtocolException(1, 'foo'); - assert.ok(e instanceof thrift.TProtocolException, 'is instanceof TProtocolException'); - assert.ok(e instanceof Error, 'is instanceof Error'); - assert.equal(typeof e.stack, 'string', 'has stack trace'); - assert.ok(/^TProtocolException: foo/.test(e.stack), 'Stack trace has correct error name and message'); - assert.ok(e.stack.indexOf('test/exceptions.js:33:11') !== -1, 'stack trace starts on correct line and column'); - assert.equal(e.name, 'TProtocolException', 'has function name TProtocolException'); - assert.equal(e.message, 'foo', 'has error message "foo"'); - assert.equal(e.type, 1, 'has type 1'); +test("TProtocolException", function t(assert) { + const e = new thrift.TProtocolException(1, "foo"); + assert.ok( + e instanceof thrift.TProtocolException, + "is instanceof TProtocolException" + ); + assert.ok(e instanceof Error, "is instanceof Error"); + assert.equal(typeof e.stack, "string", "has stack trace"); + assert.ok( + /^TProtocolException: foo/.test(e.stack), + "Stack trace has correct error name and message" + ); + assert.ok( + e.stack.indexOf("test/exceptions.js:33:11") !== -1, + "stack trace starts on correct line and column" + ); + assert.equal( + e.name, + "TProtocolException", + "has function name TProtocolException" + ); + assert.equal(e.message, "foo", 'has error message "foo"'); + assert.equal(e.type, 1, "has type 1"); assert.end(); }); -test('InputBufferUnderrunError', function t(assert) { - var e = new InputBufferUnderrunError('foo'); - assert.ok(e instanceof InputBufferUnderrunError, 'is instanceof InputBufferUnderrunError'); - assert.ok(e instanceof Error, 'is instanceof Error'); - assert.equal(typeof e.stack, 'string', 'has stack trace'); - assert.ok(/^InputBufferUnderrunError: foo/.test(e.stack), 'Stack trace has correct error name and message'); - assert.ok(e.stack.indexOf('test/exceptions.js:46:11') !== -1, 'stack trace starts on correct line and column'); - assert.equal(e.name, 'InputBufferUnderrunError', 'has function name InputBufferUnderrunError'); - assert.equal(e.message, 'foo', 'has error message "foo"'); +test("InputBufferUnderrunError", function t(assert) { + const e = new InputBufferUnderrunError("foo"); + assert.ok( + e instanceof InputBufferUnderrunError, + "is instanceof InputBufferUnderrunError" + ); + assert.ok(e instanceof Error, "is instanceof Error"); + assert.equal(typeof e.stack, "string", "has stack trace"); + assert.ok( + /^InputBufferUnderrunError: foo/.test(e.stack), + "Stack trace has correct error name and message" + ); + assert.ok( + e.stack.indexOf("test/exceptions.js:46:11") !== -1, + "stack trace starts on correct line and column" + ); + assert.equal( + e.name, + "InputBufferUnderrunError", + "has function name InputBufferUnderrunError" + ); + assert.equal(e.message, "foo", 'has error message "foo"'); assert.end(); }); diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/helpers.js b/vendor/git.apache.org/thrift.git/lib/nodejs/test/helpers.js index 5f828b3..72d128d 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/helpers.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/helpers.js @@ -17,16 +17,21 @@ * under the License. */ -'use strict'; -var thrift = require('../lib/thrift'); +"use strict"; +const thrift = require("../lib/thrift"); module.exports.transports = { - 'buffered': thrift.TBufferedTransport, - 'framed': thrift.TFramedTransport + buffered: thrift.TBufferedTransport, + framed: thrift.TFramedTransport }; module.exports.protocols = { - 'json': thrift.TJSONProtocol, - 'binary': thrift.TBinaryProtocol, - 'compact': thrift.TCompactProtocol + json: thrift.TJSONProtocol, + binary: thrift.TBinaryProtocol, + compact: thrift.TCompactProtocol }; + +module.exports.ecmaMode = process.argv.includes("--es6") ? "es6" : "es5"; +module.exports.genPath = process.argv.includes("--es6") + ? "gen-nodejs-es6" + : "gen-nodejs"; diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/server.js b/vendor/git.apache.org/thrift.git/lib/nodejs/test/server.js index 030d28b..7402094 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/server.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/server.js @@ -19,96 +19,119 @@ * under the License. */ -var fs = require('fs'); -var path = require('path'); -var thrift = require('../lib/thrift'); -var program = require('commander'); -var helpers = require('./helpers'); - -var ThriftTest = require('./gen-nodejs/ThriftTest'); -var SecondService = require('./gen-nodejs/SecondService'); -var ThriftTestHandler = require('./test_handler').AsyncThriftTestHandler; -var ThriftTestHandlerPromise = require('./test_handler').SyncThriftTestHandler; -var ttypes = require('./gen-nodejs/ThriftTest_types'); +const fs = require("fs"); +const path = require("path"); +const thrift = require("../lib/thrift"); +const program = require("commander"); +const helpers = require("./helpers"); program - .option('-p, --protocol ', 'Set thrift protocol (binary|compact|json)', 'binary') - .option('-t, --transport ', 'Set thrift transport (buffered|framed|http)', 'buffered') - .option('--ssl', 'use ssl transport') - .option('--port ', 'Set thrift server port', 9090) - .option('--domain-socket ', 'Set thift server unix domain socket') - .option('--promise', 'test with promise style functions') - .option('-t, --type ', 'Select server type (http|multiplex|tcp|websocket)', 'tcp') + .option( + "-p, --protocol ", + "Set thrift protocol (binary|compact|json)", + "binary" + ) + .option( + "-t, --transport ", + "Set thrift transport (buffered|framed|http)", + "buffered" + ) + .option("--ssl", "use ssl transport") + .option("--port ", "Set thrift server port", 9090) + .option("--domain-socket ", "Set thift server unix domain socket") + .option( + "-t, --type ", + "Select server type (http|multiplex|tcp|websocket)", + "tcp" + ) + .option("--callback", "test with callback style functions") + .option("--es6", "Use es6 code") + .option("--es5", "Use es5 code") .parse(process.argv); -var port = program.port; -var domainSocket = program.domainSocket; -var type = program.type; -var ssl = program.ssl; -var promise = program.promise; +const ThriftTest = require(`./${helpers.genPath}/ThriftTest`); +const SecondService = require(`./${helpers.genPath}/SecondService`); +const { ThriftTestHandler } = require("./test_handler"); -var handler = program.promise ? ThriftTestHandler : ThriftTestHandlerPromise; +const port = program.port; +const domainSocket = program.domainSocket; +const ssl = program.ssl; -if (program.transport === 'http') { - program.transport = 'buffered'; - type = 'http'; +let type = program.type; +if (program.transport === "http") { + program.transport = "buffered"; + type = "http"; } -var options = { +let options = { transport: helpers.transports[program.transport], protocol: helpers.protocols[program.protocol] }; -if (type === 'http' || type ==='websocket') { - options.handler = handler; +if (type === "http" || type === "websocket") { + options.handler = ThriftTestHandler; options.processor = ThriftTest; options = { services: { "/test": options }, cors: { - '*': true + "*": true } - } + }; } -if (type === 'multiplex') { - var SecondServiceHandler = { +let processor; +if (type === "multiplex") { + const SecondServiceHandler = { secondtestString: function(thing, result) { console.log('testString("' + thing + '")'); result(null, 'testString("' + thing + '")'); } }; - var processor = new thrift.MultiplexedProcessor(); + processor = new thrift.MultiplexedProcessor(); - processor.registerProcessor("ThriftTest", - new ThriftTest.Processor(ThriftTestHandler)); - - processor.registerProcessor("SecondService", - new SecondService.Processor(SecondServiceHandler)); + processor.registerProcessor( + "ThriftTest", + new ThriftTest.Processor(ThriftTestHandler) + ); + processor.registerProcessor( + "SecondService", + new SecondService.Processor(SecondServiceHandler) + ); } if (ssl) { - if (type === 'tcp' || type === 'multiplex' || type === 'http' || type === 'websocket') { + if ( + type === "tcp" || + type === "multiplex" || + type === "http" || + type === "websocket" + ) { options.tls = { - key: fs.readFileSync(path.resolve(__dirname, 'server.key')), - cert: fs.readFileSync(path.resolve(__dirname, 'server.crt')) + key: fs.readFileSync(path.resolve(__dirname, "server.key")), + cert: fs.readFileSync(path.resolve(__dirname, "server.crt")) }; } } -var server; -if (type === 'tcp') { - server = thrift.createServer(ThriftTest, handler, options); -} else if (type === 'multiplex') { +let server; +if (type === "tcp") { + server = thrift.createServer(ThriftTest, ThriftTestHandler, options); +} else if (type === "multiplex") { server = thrift.createMultiplexServer(processor, options); -} else if (type === 'http' || type === 'websocket') { +} else if (type === "http" || type === "websocket") { server = thrift.createWebServer(options); } if (domainSocket) { server.listen(domainSocket); -} else if (type === 'tcp' || type === 'multiplex' || type === 'http' || type === 'websocket') { +} else if ( + type === "tcp" || + type === "multiplex" || + type === "http" || + type === "websocket" +) { server.listen(port); } diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/test-cases.js b/vendor/git.apache.org/thrift.git/lib/nodejs/test/test-cases.js index bd66dc4..02c566f 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/test-cases.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/test-cases.js @@ -17,139 +17,156 @@ * under the License. */ -'use strict'; +"use strict"; -var ttypes = require('./gen-nodejs/ThriftTest_types'); -var Int64 = require('node-int64'); +const helpers = require("./helpers"); +const ttypes = require(`./${helpers.genPath}/ThriftTest_types`); +const Int64 = require("node-int64"); //all Languages in UTF-8 /*jshint -W100 */ -var stringTest = module.exports.stringTest = "Afrikaans, Alemannisch, Aragonés, العربية, مصرى, " + - "Asturianu, Aymar aru, Azərbaycan, Башҡорт, Boarisch, Žemaitėška, " + - "Беларуская, Беларуская (тарашкевіца), Български, Bamanankan, " + - "বাংলা, Brezhoneg, Bosanski, Català, Mìng-dĕ̤ng-ngṳ̄, Нохчийн, " + - "Cebuano, ᏣᎳᎩ, Česky, Словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ, Чӑвашла, Cymraeg, " + - "Dansk, Zazaki, ދިވެހިބަސް, Ελληνικά, Emiliàn e rumagnòl, English, " + - "Esperanto, Español, Eesti, Euskara, فارسی, Suomi, Võro, Føroyskt, " + - "Français, Arpetan, Furlan, Frysk, Gaeilge, 贛語, Gàidhlig, Galego, " + - "Avañe'ẽ, ગુજરાતી, Gaelg, עברית, हिन्दी, Fiji Hindi, Hrvatski, " + - "Kreyòl ayisyen, Magyar, Հայերեն, Interlingua, Bahasa Indonesia, " + - "Ilokano, Ido, Íslenska, Italiano, 日本語, Lojban, Basa Jawa, " + - "ქართული, Kongo, Kalaallisut, ಕನ್ನಡ, 한국어, Къарачай-Малкъар, " + - "Ripoarisch, Kurdî, Коми, Kernewek, Кыргызча, Latina, Ladino, " + - "Lëtzebuergesch, Limburgs, Lingála, ລາວ, Lietuvių, Latviešu, Basa " + - "Banyumasan, Malagasy, Македонски, മലയാളം, मराठी, مازِرونی, Bahasa " + - "Melayu, Nnapulitano, Nedersaksisch, नेपाल भाषा, Nederlands, ‪" + - "Norsk (nynorsk)‬, ‪Norsk (bokmål)‬, Nouormand, Diné bizaad, " + - "Occitan, Иронау, Papiamentu, Deitsch, Polski, پنجابی, پښتو, " + - "Norfuk / Pitkern, Português, Runa Simi, Rumantsch, Romani, Română, " + - "Русский, Саха тыла, Sardu, Sicilianu, Scots, Sámegiella, Simple " + - "English, Slovenčina, Slovenščina, Српски / Srpski, Seeltersk, " + - "Svenska, Kiswahili, தமிழ், తెలుగు, Тоҷикӣ, ไทย, Türkmençe, Tagalog, " + - "Türkçe, Татарча/Tatarça, Українська, اردو, Tiếng Việt, Volapük, " + - "Walon, Winaray, 吴语, isiXhosa, ייִדיש, Yorùbá, Zeêuws, 中文, " + - "Bân-lâm-gú, 粵語"; +const stringTest = (module.exports.stringTest = + "Afrikaans, Alemannisch, Aragonés, العربية, مصرى, " + + "Asturianu, Aymar aru, Azərbaycan, Башҡорт, Boarisch, Žemaitėška, " + + "Беларуская, Беларуская (тарашкевіца), Български, Bamanankan, " + + "বাংলা, Brezhoneg, Bosanski, Català, Mìng-dĕ̤ng-ngṳ̄, Нохчийн, " + + "Cebuano, ᏣᎳᎩ, Česky, Словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ, Чӑвашла, Cymraeg, " + + "Dansk, Zazaki, ދިވެހިބަސް, Ελληνικά, Emiliàn e rumagnòl, English, " + + "Esperanto, Español, Eesti, Euskara, فارسی, Suomi, Võro, Føroyskt, " + + "Français, Arpetan, Furlan, Frysk, Gaeilge, 贛語, Gàidhlig, Galego, " + + "Avañe'ẽ, ગુજરાતી, Gaelg, עברית, हिन्दी, Fiji Hindi, Hrvatski, " + + "Kreyòl ayisyen, Magyar, Հայերեն, Interlingua, Bahasa Indonesia, " + + "Ilokano, Ido, Íslenska, Italiano, 日本語, Lojban, Basa Jawa, " + + "ქართული, Kongo, Kalaallisut, ಕನ್ನಡ, 한국어, Къарачай-Малкъар, " + + "Ripoarisch, Kurdî, Коми, Kernewek, Кыргызча, Latina, Ladino, " + + "Lëtzebuergesch, Limburgs, Lingála, ລາວ, Lietuvių, Latviešu, Basa " + + "Banyumasan, Malagasy, Македонски, മലയാളം, मराठी, مازِرونی, Bahasa " + + "Melayu, Nnapulitano, Nedersaksisch, नेपाल भाषा, Nederlands, ‪" + + "Norsk (nynorsk)‬, ‪Norsk (bokmål)‬, Nouormand, Diné bizaad, " + + "Occitan, Иронау, Papiamentu, Deitsch, Polski, پنجابی, پښتو, " + + "Norfuk / Pitkern, Português, Runa Simi, Rumantsch, Romani, Română, " + + "Русский, Саха тыла, Sardu, Sicilianu, Scots, Sámegiella, Simple " + + "English, Slovenčina, Slovenščina, Српски / Srpski, Seeltersk, " + + "Svenska, Kiswahili, தமிழ், తెలుగు, Тоҷикӣ, ไทย, Türkmençe, Tagalog, " + + "Türkçe, Татарча/Tatarça, Українська, اردو, Tiếng Việt, Volapük, " + + "Walon, Winaray, 吴语, isiXhosa, ייִדיש, Yorùbá, Zeêuws, 中文, " + + "Bân-lâm-gú, 粵語"); /*jshint +W100 */ -var specialCharacters = module.exports.specialCharacters = 'quote: \" backslash:' + - ' forwardslash-escaped: \/ ' + - ' backspace: \b formfeed: \f newline: \n return: \r tab: ' + - ' now-all-of-them-together: "\\\/\b\n\r\t' + - ' now-a-bunch-of-junk: !@#$%&()(&%$#{}{}<><><' + - ' char-to-test-json-parsing: ]] \"]] \\" }}}{ [[[ '; +const specialCharacters = (module.exports.specialCharacters = + 'quote: " backslash:' + + " forwardslash-escaped: / " + + " backspace: \b formfeed: \f newline: \n return: \r tab: " + + ' now-all-of-them-together: "\\/\b\n\r\t' + + " now-a-bunch-of-junk: !@#$%&()(&%$#{}{}<><><" + + ' char-to-test-json-parsing: ]] "]] \\" }}}{ [[[ '); -var mapTestInput = module.exports.mapTestInput = { - "a":"123", "a b":"with spaces ", "same":"same", "0":"numeric key", - "longValue":stringTest, stringTest:"long key" -}; +const mapTestInput = (module.exports.mapTestInput = { + a: "123", + "a b": "with spaces ", + same: "same", + "0": "numeric key", + longValue: stringTest, + stringTest: "long key" +}); -var simple = [ - ['testVoid', undefined], - ['testString', 'Test'], - ['testString', ''], - ['testString', stringTest], - ['testString', specialCharacters], - ['testBool', true], - ['testBool', false], - ['testByte', 1], - ['testByte', 0], - ['testByte', -1], - ['testByte', -127], - ['testI32', -1], - ['testDouble', -5.2098523], - ['testDouble', 7.012052175215044], - ['testEnum', ttypes.Numberz.ONE], - ['testI64', 5], - ['testI64', -5], - ['testI64', 734359738368], - ['testI64', -734359738368], - ['testI64', new Int64(new Buffer([0, 0x20, 0, 0, 0, 0, 0, 1]))], // 2^53+1 - ['testI64', new Int64( - new Buffer([0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]))], // -2^53-1 - ['testTypedef', 69] -] +const simple = [ + ["testVoid", undefined], + ["testString", "Test"], + ["testString", ""], + ["testString", stringTest], + ["testString", specialCharacters], + ["testBool", true], + ["testBool", false], + ["testByte", 1], + ["testByte", 0], + ["testByte", -1], + ["testByte", -127], + ["testI32", -1], + ["testDouble", -5.2098523], + ["testDouble", 7.012052175215044], + ["testEnum", ttypes.Numberz.ONE], + ["testI64", 5], + ["testI64", -5], + ["testI64", 734359738368], + ["testI64", -734359738368], + ["testI64", new Int64(new Buffer([0, 0x20, 0, 0, 0, 0, 0, 1]))], // 2^53+1 + [ + "testI64", + new Int64(new Buffer([0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])) + ], // -2^53-1 + ["testTypedef", 69] +]; -var mapout = {}; -for (var i = 0; i < 5; ++i) { - mapout[i] = i-10; +const mapout = {}; +for (let i = 0; i < 5; ++i) { + mapout[i] = i - 10; } -var deep = [ - ['testList', [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]], +const deep = [ + [ + "testList", + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] + ] ]; -var deepUnordered = [ - ['testMap', mapout], - ['testSet', [1,2,3]], - ['testStringMap', mapTestInput] +const deepUnordered = [ + ["testMap", mapout], + ["testSet", [1, 2, 3]], + ["testStringMap", mapTestInput] ]; -var out = new ttypes.Xtruct({ - string_thing: 'Zero', +const out = new ttypes.Xtruct({ + string_thing: "Zero", byte_thing: 1, i32_thing: -3, i64_thing: 1000000 }); -var out2 = new ttypes.Xtruct2(); +const out2 = new ttypes.Xtruct2(); out2.byte_thing = 1; out2.struct_thing = out; out2.i32_thing = 5; -var crazy = new ttypes.Insanity({ - "userMap":{ "5":5, "8":8 }, - "xtructs":[new ttypes.Xtruct({ - "string_thing":"Goodbye4", - "byte_thing":4, - "i32_thing":4, - "i64_thing":4 - }), new ttypes.Xtruct({ - "string_thing":"Hello2", - "byte_thing":2, - "i32_thing":2, - "i64_thing":2 - })] +const crazy = new ttypes.Insanity({ + userMap: { "5": 5, "8": 8 }, + xtructs: [ + new ttypes.Xtruct({ + string_thing: "Goodbye4", + byte_thing: 4, + i32_thing: 4, + i64_thing: 4 + }), + new ttypes.Xtruct({ + string_thing: "Hello2", + byte_thing: 2, + i32_thing: 2, + i64_thing: 2 + }) + ] }); -var crazy2 = new ttypes.Insanity({ - "userMap":{ "5":5, "8":8 }, - "xtructs":[{ - "string_thing":"Goodbye4", - "byte_thing":4, - "i32_thing":4, - "i64_thing":4 - }, { - "string_thing":"Hello2", - "byte_thing":2, - "i32_thing":2, - "i64_thing":2 - }] +const crazy2 = new ttypes.Insanity({ + userMap: { "5": 5, "8": 8 }, + xtructs: [ + { + string_thing: "Goodbye4", + byte_thing: 4, + i32_thing: 4, + i64_thing: 4 + }, + { + string_thing: "Hello2", + byte_thing: 2, + i32_thing: 2, + i64_thing: 2 + } + ] }); - -var insanity = { - "1":{ "2": crazy, "3": crazy }, - "2":{ "6":{ "userMap":{}, "xtructs":[] } } +const insanity = { + "1": { "2": crazy, "3": crazy }, + "2": { "6": { userMap: {}, xtructs: [] } } }; module.exports.simple = simple; diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/testAll.sh b/vendor/git.apache.org/thrift.git/lib/nodejs/test/testAll.sh index ac22b64..24f1f2e 100755 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/testAll.sh +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/testAll.sh @@ -33,21 +33,21 @@ export NODE_PATH="${DIR}:${DIR}/../lib:${NODE_PATH}" testServer() { - echo " Testing $1 Client/Server with protocol $2 and transport $3 $4"; + echo " [ECMA $1] Testing $2 Client/Server with protocol $3 and transport $4 $5"; RET=0 if [ -n "${COVER}" ]; then - ${ISTANBUL} cover ${DIR}/server.js --dir ${REPORT_PREFIX}${COUNT} --handle-sigint -- --type $1 -p $2 -t $3 $4 & + ${ISTANBUL} cover ${DIR}/server.js --dir ${REPORT_PREFIX}${COUNT} --handle-sigint -- --type $2 -p $3 -t $4 $5 & COUNT=$((COUNT+1)) else - node ${DIR}/server.js --type $1 -p $2 -t $3 $4 & + node ${DIR}/server.js --${1} --type $2 -p $3 -t $4 $5 & fi SERVERPID=$! sleep 0.1 if [ -n "${COVER}" ]; then - ${ISTANBUL} cover ${DIR}/client.js --dir ${REPORT_PREFIX}${COUNT} -- --type $1 -p $2 -t $3 $4 || RET=1 + ${ISTANBUL} cover ${DIR}/client.js --dir ${REPORT_PREFIX}${COUNT} -- --${1} --type $2 -p $3 -t $4 $5 || RET=1 COUNT=$((COUNT+1)) else - node ${DIR}/client.js --type $1 -p $2 -t $3 $4 || RET=1 + node ${DIR}/client.js --${1} --type $2 -p $3 -t $4 $5 || RET=1 fi kill -2 $SERVERPID || RET=1 wait $SERVERPID @@ -61,6 +61,9 @@ TESTOK=0 ${DIR}/../../../compiler/cpp/thrift -o ${DIR} --gen js:node ${DIR}/../../../test/ThriftTest.thrift ${DIR}/../../../compiler/cpp/thrift -o ${DIR} --gen js:node ${DIR}/../../../test/JsDeepConstructorTest.thrift +mkdir ${DIR}/gen-nodejs-es6 +${DIR}/../../../compiler/cpp/thrift -out ${DIR}/gen-nodejs-es6 --gen js:node,es6 ${DIR}/../../../test/ThriftTest.thrift +${DIR}/../../../compiler/cpp/thrift -out ${DIR}/gen-nodejs-es6 --gen js:node,es6 ${DIR}/../../../test/JsDeepConstructorTest.thrift #unit tests @@ -71,15 +74,16 @@ node ${DIR}/deep-constructor.test.js || TESTOK=1 for type in tcp multiplex websocket http do - for protocol in compact binary json do - for transport in buffered framed do - testServer $type $protocol $transport || TESTOK=1 - testServer $type $protocol $transport --ssl || TESTOK=1 - testServer $type $protocol $transport --promise || TESTOK=1 + for ecma_version in es5 es6 + do + testServer $ecma_version $type $protocol $transport || TESTOK=1 + testServer $ecma_version $type $protocol $transport --ssl || TESTOK=1 + testServer $ecma_version $type $protocol $transport --callback || TESTOK=1 + done done done done diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/test_driver.js b/vendor/git.apache.org/thrift.git/lib/nodejs/test/test_driver.js index 4612a32..7c9a919 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/test_driver.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/test_driver.js @@ -17,252 +17,279 @@ * under the License. */ - // This is the Node.js test driver for the standard Apache Thrift - // test service. The driver invokes every function defined in the - // Thrift Test service with a representative range of parameters. - // - // The ThriftTestDriver function requires a client object - // connected to a server hosting the Thrift Test service and - // supports an optional callback function which is called with - // a status message when the test is complete. +// This is the Node.js test driver for the standard Apache Thrift +// test service. The driver invokes every function defined in the +// Thrift Test service with a representative range of parameters. +// +// The ThriftTestDriver function requires a client object +// connected to a server hosting the Thrift Test service and +// supports an optional callback function which is called with +// a status message when the test is complete. -var test = require('tape'); -//var assert = require('assert'); -var ttypes = require('./gen-nodejs/ThriftTest_types'); -var TException = require('thrift').Thrift.TException; -var Int64 = require('node-int64'); -var testCases = require('./test-cases'); +const test = require("tape"); + +const helpers = require("./helpers"); +const ttypes = require(`./${helpers.genPath}/ThriftTest_types`); +const TException = require("thrift").Thrift.TException; +const Int64 = require("node-int64"); +const testCases = require("./test-cases"); exports.ThriftTestDriver = function(client, callback) { + test( + "NodeJS Style Callback Client Tests", + { skip: helpers.ecmaMode === "es6" }, + function(assert) { + const checkRecursively = makeRecursiveCheck(assert); - test('NodeJS Style Callback Client Tests', function(assert) { - - var checkRecursively = makeRecursiveCheck(assert); - - function makeAsserter(assertionFn) { - return function(c) { - var fnName = c[0]; - var expected = c[1]; - client[fnName](expected, function(err, actual) { - assert.error(err, fnName + ': no callback error'); - assertionFn(actual, expected, fnName); - }) - }; - } - - testCases.simple.forEach(makeAsserter(function(a, e, m){ - if (a instanceof Int64) { - var e64 = e instanceof Int64 ? e : new Int64(e); - assert.deepEqual(a.buffer, e64.buffer, m); - } else { - assert.equal(a, e, m); + function makeAsserter(assertionFn) { + return function(c) { + const fnName = c[0]; + const expected = c[1]; + client[fnName](expected, function(err, actual) { + assert.error(err, fnName + ": no callback error"); + assertionFn(actual, expected, fnName); + }); + }; } - })); - testCases.deep.forEach(makeAsserter(assert.deepEqual)); - testCases.deepUnordered.forEach(makeAsserter(makeUnorderedDeepEqual(assert))); - var arr = []; - for (var i = 0; i < 256; ++i) { - arr[i] = 255 - i; - } - var buf = new Buffer(arr); - client.testBinary(buf, function(err, response) { - assert.error(err, 'testBinary: no callback error'); - assert.equal(response.length, 256, 'testBinary'); - assert.deepEqual(response, buf, 'testBinary(Buffer)'); - }); - var buf = new Buffer(arr); - client.testBinary(buf.toString('binary'), function(err, response) { - assert.error(err, 'testBinary: no callback error'); - assert.equal(response.length, 256, 'testBinary'); - assert.deepEqual(response, buf, 'testBinary(string)'); - }); + testCases.simple.forEach( + makeAsserter(function(a, e, m) { + if (a instanceof Int64) { + const e64 = e instanceof Int64 ? e : new Int64(e); + assert.deepEqual(a.buffer, e64.buffer, m); + } else { + assert.equal(a, e, m); + } + }) + ); + testCases.deep.forEach(makeAsserter(assert.deepEqual)); + testCases.deepUnordered.forEach( + makeAsserter(makeUnorderedDeepEqual(assert)) + ); - client.testMapMap(42, function(err, response) { - var expected = { - "4": {"1":1, "2":2, "3":3, "4":4}, - "-4": {"-4":-4, "-3":-3, "-2":-2, "-1":-1} - }; - assert.error(err, 'testMapMap: no callback error'); - assert.deepEqual(expected, response, 'testMapMap'); - }); - - client.testStruct(testCases.out, function(err, response) { - assert.error(err, 'testStruct: no callback error'); - checkRecursively(testCases.out, response, 'testStruct'); - }); - - client.testNest(testCases.out2, function(err, response) { - assert.error(err, 'testNest: no callback error'); - checkRecursively(testCases.out2, response, 'testNest'); - }); - - client.testInsanity(testCases.crazy, function(err, response) { - assert.error(err, 'testInsanity: no callback error'); - checkRecursively(testCases.insanity, response, 'testInsanity'); - }); - - client.testInsanity(testCases.crazy2, function(err, response) { - assert.error(err, 'testInsanity2: no callback error'); - checkRecursively(testCases.insanity, response, 'testInsanity2'); - }); - - client.testException('TException', function(err, response) { - assert.ok(err instanceof TException, 'testException: correct error type'); - assert.ok(!response, 'testException: no response'); - }); - - client.testException('Xception', function(err, response) { - assert.ok(err instanceof ttypes.Xception, 'testException: correct error type'); - assert.ok(!response, 'testException: no response'); - assert.equal(err.errorCode, 1001, 'testException: correct error code'); - assert.equal('Xception', err.message, 'testException: correct error message'); - }); - - client.testException('no Exception', function(err, response) { - assert.error(err, 'testException: no callback error'); - assert.ok(!response, 'testException: no response'); - }); - - client.testOneway(0, function(err, response) { - assert.error(err, 'testOneway: no callback error'); - assert.strictEqual(response, undefined, 'testOneway: void response'); - }); - - checkOffByOne(function(done) { - client.testI32(-1, function(err, response) { - assert.error(err, 'checkOffByOne: no callback error'); - assert.equal(-1, response); - assert.end(); - done(); + const arr = []; + for (let i = 0; i < 256; ++i) { + arr[i] = 255 - i; + } + let buf = new Buffer(arr); + client.testBinary(buf, function(err, response) { + assert.error(err, "testBinary: no callback error"); + assert.equal(response.length, 256, "testBinary"); + assert.deepEqual(response, buf, "testBinary(Buffer)"); + }); + buf = new Buffer(arr); + client.testBinary(buf.toString("binary"), function(err, response) { + assert.error(err, "testBinary: no callback error"); + assert.equal(response.length, 256, "testBinary"); + assert.deepEqual(response, buf, "testBinary(string)"); }); - }, callback); - }); + client.testMapMap(42, function(err, response) { + const expected = { + "4": { "1": 1, "2": 2, "3": 3, "4": 4 }, + "-4": { "-4": -4, "-3": -3, "-2": -2, "-1": -1 } + }; + assert.error(err, "testMapMap: no callback error"); + assert.deepEqual(expected, response, "testMapMap"); + }); + + client.testStruct(testCases.out, function(err, response) { + assert.error(err, "testStruct: no callback error"); + checkRecursively(testCases.out, response, "testStruct"); + }); + + client.testNest(testCases.out2, function(err, response) { + assert.error(err, "testNest: no callback error"); + checkRecursively(testCases.out2, response, "testNest"); + }); + + client.testInsanity(testCases.crazy, function(err, response) { + assert.error(err, "testInsanity: no callback error"); + checkRecursively(testCases.insanity, response, "testInsanity"); + }); + + client.testInsanity(testCases.crazy2, function(err, response) { + assert.error(err, "testInsanity2: no callback error"); + checkRecursively(testCases.insanity, response, "testInsanity2"); + }); + + client.testException("TException", function(err, response) { + assert.ok( + err instanceof TException, + "testException: correct error type" + ); + assert.ok(!response, "testException: no response"); + }); + + client.testException("Xception", function(err, response) { + assert.ok( + err instanceof ttypes.Xception, + "testException: correct error type" + ); + assert.ok(!response, "testException: no response"); + assert.equal(err.errorCode, 1001, "testException: correct error code"); + assert.equal( + "Xception", + err.message, + "testException: correct error message" + ); + }); + + client.testException("no Exception", function(err, response) { + assert.error(err, "testException: no callback error"); + assert.ok(!response, "testException: no response"); + }); + + client.testOneway(0, function(err, response) { + assert.error(err, "testOneway: no callback error"); + assert.strictEqual(response, undefined, "testOneway: void response"); + }); + + checkOffByOne(function(done) { + client.testI32(-1, function(err, response) { + assert.error(err, "checkOffByOne: no callback error"); + assert.equal(-1, response); + assert.end(); + done(); + }); + }, callback); + } + ); + + // ES6 does not support callback style + if (helpers.ecmaMode === "es6") { + checkOffByOne(done => done(), callback); + } }; exports.ThriftTestDriverPromise = function(client, callback) { - - test('Q Promise Client Tests', function(assert) { - - var checkRecursively = makeRecursiveCheck(assert); - - function fail(msg) { - return function() { - assert.fail(msg); - } - } + test("Promise Client Tests", function(assert) { + const checkRecursively = makeRecursiveCheck(assert); function makeAsserter(assertionFn) { return function(c) { - var fnName = c[0]; - var expected = c[1]; + const fnName = c[0]; + const expected = c[1]; client[fnName](expected) .then(function(actual) { assertionFn(actual, expected, fnName); }) - .fail(fail('fnName')); + .catch(() => assert.fail("fnName")); }; } - testCases.simple.forEach(makeAsserter(function(a, e, m){ - if (a instanceof Int64) { - var e64 = e instanceof Int64 ? e : new Int64(e); - assert.deepEqual(a.buffer, e64.buffer, m); - } else { - assert.equal(a, e, m); - } - })); + testCases.simple.forEach( + makeAsserter(function(a, e, m) { + if (a instanceof Int64) { + const e64 = e instanceof Int64 ? e : new Int64(e); + assert.deepEqual(a.buffer, e64.buffer, m); + } else { + assert.equal(a, e, m); + } + }) + ); testCases.deep.forEach(makeAsserter(assert.deepEqual)); - testCases.deepUnordered.forEach(makeAsserter(makeUnorderedDeepEqual(assert))); + testCases.deepUnordered.forEach( + makeAsserter(makeUnorderedDeepEqual(assert)) + ); - client.testStruct(testCases.out) + client + .testStruct(testCases.out) .then(function(response) { - checkRecursively(testCases.out, response, 'testStruct'); + checkRecursively(testCases.out, response, "testStruct"); }) - .fail(fail('testStruct')); + .catch(() => assert.fail("testStruct")); - client.testNest(testCases.out2) + client + .testNest(testCases.out2) .then(function(response) { - checkRecursively(testCases.out2, response, 'testNest'); + checkRecursively(testCases.out2, response, "testNest"); }) - .fail(fail('testNest')); + .catch(() => assert.fail("testNest")); - client.testInsanity(testCases.crazy) + client + .testInsanity(testCases.crazy) .then(function(response) { - checkRecursively(testCases.insanity, response, 'testInsanity'); + checkRecursively(testCases.insanity, response, "testInsanity"); }) - .fail(fail('testInsanity')); + .catch(() => assert.fail("testInsanity")); - client.testInsanity(testCases.crazy2) + client + .testInsanity(testCases.crazy2) .then(function(response) { - checkRecursively(testCases.insanity, response, 'testInsanity2'); + checkRecursively(testCases.insanity, response, "testInsanity2"); }) - .fail(fail('testInsanity2')); + .catch(() => assert.fail("testInsanity2")); - client.testException('TException') - .then(function(response) { - fail('testException: TException'); + client + .testException("TException") + .then(function() { + assert.fail("testException: TException"); }) - .fail(function(err) { + .catch(function(err) { assert.ok(err instanceof TException); }); - client.testException('Xception') - .then(function(response) { - fail('testException: Xception'); + client + .testException("Xception") + .then(function() { + assert.fail("testException: Xception"); }) - .fail(function(err) { + .catch(function(err) { assert.ok(err instanceof ttypes.Xception); assert.equal(err.errorCode, 1001); - assert.equal('Xception', err.message); + assert.equal("Xception", err.message); }); - client.testException('no Exception') + client + .testException("no Exception") .then(function(response) { assert.equal(undefined, response); //void }) - .fail(fail('testException')); + .catch(() => assert.fail("testException")); - client.testOneway(0) + client + .testOneway(0) .then(function(response) { - assert.strictEqual(response, undefined, 'testOneway: void response') + assert.strictEqual(response, undefined, "testOneway: void response"); }) - .fail(fail('testOneway: should not reject')); + .catch(() => assert.fail("testOneway: should not reject")); checkOffByOne(function(done) { - client.testI32(-1) + client + .testI32(-1) .then(function(response) { - assert.equal(-1, response); - assert.end(); - done(); + assert.equal(-1, response); + assert.end(); + done(); }) - .fail(fail('checkOffByOne')); + .catch(() => assert.fail("checkOffByOne")); }, callback); }); }; - // Helper Functions // ========================================================= function makeRecursiveCheck(assert) { - - return function (map1, map2, msg) { - var equal = true; - - var equal = checkRecursively(map1, map2); + return function(map1, map2, msg) { + const equal = checkRecursively(map1, map2); assert.ok(equal, msg); // deepEqual doesn't work with fields using node-int64 function checkRecursively(map1, map2) { - if (typeof map1 !== 'function' && typeof map2 !== 'function') { - if (!map1 || typeof map1 !== 'object') { + if (typeof map1 !== "function" && typeof map2 !== "function") { + if (!map1 || typeof map1 !== "object") { //Handle int64 types (which use node-int64 in Node.js JavaScript) - if ((typeof map1 === "number") && (typeof map2 === "object") && - (map2.buffer) && (map2.buffer instanceof Buffer) && (map2.buffer.length === 8)) { - var n = new Int64(map2.buffer); + if ( + typeof map1 === "number" && + typeof map2 === "object" && + map2.buffer && + map2.buffer instanceof Buffer && + map2.buffer.length === 8 + ) { + const n = new Int64(map2.buffer); return map1 === n.toNumber(); } else { return map1 == map2; @@ -274,15 +301,14 @@ function makeRecursiveCheck(assert) { } } } - } + }; } function checkOffByOne(done, callback) { - - var retry_limit = 30; - var retry_interval = 100; - var test_complete = false; - var retrys = 0; + const retry_limit = 30; + const retry_interval = 100; + let test_complete = false; + let retrys = 0; /** * redo a simple test after the oneway to make sure we aren't "off by one" -- @@ -299,14 +325,17 @@ function checkOffByOne(done, callback) { //We wait up to retry_limit * retry_interval for the test suite to complete function TestForCompletion() { - if(test_complete && callback) { + if (test_complete && callback) { callback("Server successfully tested!"); } else { if (++retrys < retry_limit) { setTimeout(TestForCompletion, retry_interval); } else if (callback) { - callback("Server test failed to complete after " + - (retry_limit * retry_interval / 1000) + " seconds"); + callback( + "Server test failed to complete after " + + (retry_limit * retry_interval) / 1000 + + " seconds" + ); } } } @@ -317,15 +346,15 @@ function checkOffByOne(done, callback) { function makeUnorderedDeepEqual(assert) { return function(actual, expected, name) { assert.equal(actual.length, expected.length, name); - for (var k in actual) { - var found = false; - for (var k2 in expected) { + for (const k in actual) { + let found = false; + for (const k2 in expected) { if (actual[k] === expected[k2]) { found = true; } } if (!found) { - assert.fail('Unexpected value ' + actual[k] + ' with key ' + k); + assert.fail("Unexpected value " + actual[k] + " with key " + k); } } }; diff --git a/vendor/git.apache.org/thrift.git/lib/nodejs/test/test_handler.js b/vendor/git.apache.org/thrift.git/lib/nodejs/test/test_handler.js index 5c89f7a..317a7c8 100644 --- a/vendor/git.apache.org/thrift.git/lib/nodejs/test/test_handler.js +++ b/vendor/git.apache.org/thrift.git/lib/nodejs/test/test_handler.js @@ -19,18 +19,17 @@ //This is the server side Node test handler for the standard // Apache Thrift test service. +const helpers = require("./helpers"); +const ttypes = require(`./${helpers.genPath}/ThriftTest_types`); +const TException = require("thrift").Thrift.TException; -var ttypes = require('./gen-nodejs/ThriftTest_types'); -var TException = require('thrift').Thrift.TException; - -function makeSyncHandler(label) { +function makeSyncHandler() { return function(thing) { - //console.log(label + '(\'' + thing + '\')'); return thing; - } + }; } -var syncHandlers = { +const syncHandlers = { testVoid: testVoid, testMapMap: testMapMap, testInsanity: testInsanity, @@ -44,10 +43,10 @@ function makeAsyncHandler(label) { return function(thing, result) { thing = syncHandlers[label](thing); result(null, thing); - } + }; } -var asyncHandlers = { +const asyncHandlers = { testVoid: testVoidAsync, testMulti: testMultiAsync, testException: testExceptionAsync, @@ -55,22 +54,22 @@ var asyncHandlers = { testOneway: testOnewayAsync }; -var identityHandlers = [ - 'testString', - 'testBool', - 'testByte', - 'testI32', - 'testI64', - 'testDouble', - 'testBinary', - 'testStruct', - 'testNest', - 'testMap', - 'testStringMap', - 'testSet', - 'testList', - 'testEnum', - 'testTypedef' +const identityHandlers = [ + "testString", + "testBool", + "testByte", + "testI32", + "testI64", + "testDouble", + "testBinary", + "testStruct", + "testNest", + "testMap", + "testStringMap", + "testSet", + "testList", + "testEnum", + "testTypedef" ]; function testVoid() { @@ -81,13 +80,11 @@ function testVoidAsync(result) { result(testVoid()); } -function testMapMap(hello) { - //console.log('testMapMap(' + hello + ')'); - - var mapmap = []; - var pos = []; - var neg = []; - for (var i = 1; i < 5; i++) { +function testMapMap() { + const mapmap = []; + const pos = []; + const neg = []; + for (let i = 1; i < 5; i++) { pos[i] = i; neg[-i] = -i; } @@ -102,16 +99,16 @@ function testInsanity(argument) { //console.log(argument); //console.log(')'); - var first_map = []; - var second_map = []; + const first_map = []; + const second_map = []; first_map[ttypes.Numberz.TWO] = argument; first_map[ttypes.Numberz.THREE] = argument; - var looney = new ttypes.Insanity(); + const looney = new ttypes.Insanity(); second_map[ttypes.Numberz.SIX] = looney; - var insane = []; + const insane = []; insane[1] = first_map; insane[2] = second_map; @@ -120,11 +117,11 @@ function testInsanity(argument) { return insane; } -function testMulti(arg0, arg1, arg2, arg3, arg4, arg5) { +function testMulti(arg0, arg1, arg2) { //console.log('testMulti()'); - var hello = new ttypes.Xtruct(); - hello.string_thing = 'Hello2'; + const hello = new ttypes.Xtruct(); + hello.string_thing = "Hello2"; hello.byte_thing = arg0; hello.i32_thing = arg1; hello.i64_thing = arg2; @@ -132,18 +129,18 @@ function testMulti(arg0, arg1, arg2, arg3, arg4, arg5) { } function testMultiAsync(arg0, arg1, arg2, arg3, arg4, arg5, result) { - var hello = testMulti(arg0, arg1, arg2, arg3, arg4, arg5); + const hello = testMulti(arg0, arg1, arg2, arg3, arg4, arg5); result(null, hello); } function testException(arg) { //console.log('testException('+arg+')'); - if (arg === 'Xception') { - var x = new ttypes.Xception(); + if (arg === "Xception") { + const x = new ttypes.Xception(); x.errorCode = 1001; x.message = arg; throw x; - } else if (arg === 'TException') { + } else if (arg === "TException") { throw new TException(arg); } else { return; @@ -152,12 +149,12 @@ function testException(arg) { function testExceptionAsync(arg, result) { //console.log('testException('+arg+')'); - if (arg === 'Xception') { - var x = new ttypes.Xception(); + if (arg === "Xception") { + const x = new ttypes.Xception(); x.errorCode = 1001; x.message = arg; result(x); - } else if (arg === 'TException') { + } else if (arg === "TException") { result(new TException(arg)); } else { result(null); @@ -166,49 +163,48 @@ function testExceptionAsync(arg, result) { function testMultiException(arg0, arg1) { //console.log('testMultiException(' + arg0 + ', ' + arg1 + ')'); - if (arg0 === ('Xception')) { - var x = new ttypes.Xception(); + if (arg0 === "Xception") { + const x = new ttypes.Xception(); x.errorCode = 1001; - x.message = 'This is an Xception'; + x.message = "This is an Xception"; throw x; - } else if (arg0 === ('Xception2')) { - var x2 = new ttypes.Xception2(); + } else if (arg0 === "Xception2") { + const x2 = new ttypes.Xception2(); x2.errorCode = 2002; x2.struct_thing = new ttypes.Xtruct(); - x2.struct_thing.string_thing = 'This is an Xception2'; + x2.struct_thing.string_thing = "This is an Xception2"; throw x2; } - var res = new ttypes.Xtruct(); + const res = new ttypes.Xtruct(); res.string_thing = arg1; return res; } function testMultiExceptionAsync(arg0, arg1, result) { //console.log('testMultiException(' + arg0 + ', ' + arg1 + ')'); - if (arg0 === ('Xception')) { - var x = new ttypes.Xception(); + if (arg0 === "Xception") { + const x = new ttypes.Xception(); x.errorCode = 1001; - x.message = 'This is an Xception'; + x.message = "This is an Xception"; result(x); - } else if (arg0 === ('Xception2')) { - var x2 = new ttypes.Xception2(); + } else if (arg0 === "Xception2") { + const x2 = new ttypes.Xception2(); x2.errorCode = 2002; x2.struct_thing = new ttypes.Xtruct(); - x2.struct_thing.string_thing = 'This is an Xception2'; + x2.struct_thing.string_thing = "This is an Xception2"; result(x2); } else { - var res = new ttypes.Xtruct(); + const res = new ttypes.Xtruct(); res.string_thing = arg1; result(null, res); } } -function testOneway(sleepFor) { - //console.log('testOneway(' + sleepFor + ') => JavaScript (like Rust) never sleeps!'); -} +//console.log('testOneway(' + sleepFor + ') => JavaScript (like Rust) never sleeps!'); +function testOneway() {} -function testOnewayAsync(sleepFor, result) { +function testOnewayAsync(sleepFor) { testOneway(sleepFor); } @@ -217,11 +213,8 @@ identityHandlers.forEach(function(label) { asyncHandlers[label] = makeAsyncHandler(label); }); -['testMapMap', 'testInsanity'].forEach(function(label) { +["testMapMap", "testInsanity"].forEach(function(label) { asyncHandlers[label] = makeAsyncHandler(label); }); exports.ThriftTestHandler = asyncHandlers; - -exports.AsyncThriftTestHandler = asyncHandlers; -exports.SyncThriftTestHandler = asyncHandlers; diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/.gitignore b/vendor/git.apache.org/thrift.git/lib/nodets/.gitignore new file mode 100644 index 0000000..c7aba89 --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/.gitignore @@ -0,0 +1 @@ +test-compiled/ diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/Makefile.am b/vendor/git.apache.org/thrift.git/lib/nodets/Makefile.am new file mode 100755 index 0000000..ea640cf --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/Makefile.am @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +# We call npm twice to work around npm issues + +stubs: $(top_srcdir)/test/ThriftTest.thrift + mkdir -p test-compiled + $(THRIFT) --gen js:node,ts -o test/ $(top_srcdir)/test/ThriftTest.thrift && $(THRIFT) --gen js:node,ts -o test-compiled $(top_srcdir)/test/ThriftTest.thrift + +ts-compile: stubs + mkdir -p test-compiled + ../../node_modules/typescript/bin/tsc --outDir test-compiled/ --project test/tsconfig.json + +deps: $(top_srcdir)/package.json + $(NPM) install $(top_srcdir)/ || $(NPM) install $(top_srcdir)/ + +all-local: deps ts-compile + +precross: deps stubs ts-compile + +check: deps ts-compile + cd $(top_srcdir) && $(NPM) run test-ts && cd lib/nodets + +clean-local: + $(RM) -r test/gen-nodejs + $(RM) -r $(top_srcdir)/node_modules + $(RM) -r test-compiled + +EXTRA_DIST = \ + test \ + coding_standards.md diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/coding_standards.md b/vendor/git.apache.org/thrift.git/lib/nodets/coding_standards.md new file mode 100644 index 0000000..fa0390b --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/coding_standards.md @@ -0,0 +1 @@ +Please follow [General Coding Standards](/doc/coding_standards.md) diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/test/client.ts b/vendor/git.apache.org/thrift.git/lib/nodets/test/client.ts new file mode 100644 index 0000000..4fa3c28 --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/test/client.ts @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +import assert = require("assert"); +import thrift = require("thrift"); +import Thrift = thrift.Thrift; +import ThriftTest = require("./gen-nodejs/ThriftTest"); +import test_driver = require("./test_driver"); +import ThriftTestDriver = test_driver.ThriftTestDriver; +import ThriftTestDriverPromise = test_driver.ThriftTestDriverPromise; + +// var program = require("commander"); +import * as program from "commander"; + +program + .option("--port ", "Set thrift server port number to connect", 9090) + .option("--promise", "test with promise style functions") + .option("--protocol", "Set thrift protocol (binary) [protocol]") + .parse(process.argv); + +var port: number = program.port; +var promise = program.promise; + +var options = { + transport: Thrift.TBufferedTransport, + protocol: Thrift.TBinaryProtocol +}; + +var testDriver = promise ? ThriftTestDriverPromise : ThriftTestDriver; + +var connection = thrift.createConnection("localhost", port, options); + +connection.on("error", function(err: string) { + assert(false, err); +}); + +var client = thrift.createClient(ThriftTest.Client, connection); +runTests(); + +function runTests() { + testDriver(client, function (status: string) { + console.log(status); + process.exit(0); + }); +} + +exports.expressoTest = function() {}; diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/test/runClient.sh b/vendor/git.apache.org/thrift.git/lib/nodets/test/runClient.sh new file mode 100755 index 0000000..8d5e9a3 --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/test/runClient.sh @@ -0,0 +1,18 @@ +#! /bin/sh + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +mkdir -p $DIR/../test-compiled + +COMPILEDDIR="$(cd $DIR && cd ../test-compiled && pwd)" +export NODE_PATH="${DIR}:${DIR}/../../nodejs/lib:${NODE_PATH}" + +compile() +{ + #generating thrift code + ${DIR}/../../../compiler/cpp/thrift -o ${DIR} --gen js:node,ts ${DIR}/../../../test/ThriftTest.thrift + ${DIR}/../../../compiler/cpp/thrift -o ${COMPILEDDIR} --gen js:node,ts ${DIR}/../../../test/ThriftTest.thrift +} +compile + +node ${COMPILEDDIR}/client.js $* diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/test/runServer.sh b/vendor/git.apache.org/thrift.git/lib/nodets/test/runServer.sh new file mode 100755 index 0000000..4eee927 --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/test/runServer.sh @@ -0,0 +1,20 @@ +#! /bin/sh + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +mkdir -p $DIR/../test-compiled + +COMPILEDDIR="$(cd $DIR && cd ../test-compiled && pwd)" +export NODE_PATH="${DIR}:${DIR}/../../nodejs/lib:${NODE_PATH}" + +compile() +{ + #generating thrift code + ${DIR}/../../../compiler/cpp/thrift -o ${DIR} --gen js:node,ts ${DIR}/../../../test/ThriftTest.thrift + ${DIR}/../../../compiler/cpp/thrift -o ${COMPILEDDIR} --gen js:node,ts ${DIR}/../../../test/ThriftTest.thrift +} +compile + +node ${COMPILEDDIR}/server.js $* + + diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/test/server.ts b/vendor/git.apache.org/thrift.git/lib/nodets/test/server.ts new file mode 100644 index 0000000..2da53ae --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/test/server.ts @@ -0,0 +1,26 @@ +import thrift = require("thrift"); +var program = require('commander'); +import ThriftTest = require('./gen-nodejs/ThriftTest'); +import test_handler = require('./test_handler'); + + +program + .option('--port ', 'Set thrift server port', 9090) + .option('--promise', 'test with promise style functions') + .option('--protocol', '"Set thrift protocol (binary) [protocol]"') + .parse(process.argv); + +var port: number = program.port; + +var options: thrift.ServerOptions = { + transport: thrift.TBufferedTransport, + protocol: thrift.TBinaryProtocol +}; + +var server: thrift.Server; +if (program.promise) { + server = thrift.createServer(ThriftTest.Processor, new test_handler.AsyncThriftTestHandler(), options); +} else { + server = thrift.createServer(ThriftTest.Processor, new test_handler.SyncThriftTestHandler(), options); +} +server.listen(port); diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/test/test-cases.ts b/vendor/git.apache.org/thrift.git/lib/nodets/test/test-cases.ts new file mode 100644 index 0000000..ca740ec --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/test/test-cases.ts @@ -0,0 +1,113 @@ +'use strict'; + +import ttypes = require('./gen-nodejs/ThriftTest_types'); + +//all Languages in UTF-8 +/*jshint -W100 */ +export var stringTest = "Afrikaans, Alemannisch, Aragonés, العربية, مصرى, " + + "Asturianu, Aymar aru, Azərbaycan, Башҡорт, Boarisch, Žemaitėška, " + + "Беларуская, Беларуская (тарашкевіца), Български, Bamanankan, " + + "বাংলা, Brezhoneg, Bosanski, Català, Mìng-dĕ̤ng-ngṳ̄, Нохчийн, " + + "Cebuano, ᏣᎳᎩ, Česky, Словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ, Чӑвашла, Cymraeg, " + + "Dansk, Zazaki, ދިވެހިބަސް, Ελληνικά, Emiliàn e rumagnòl, English, " + + "Esperanto, Español, Eesti, Euskara, فارسی, Suomi, Võro, Føroyskt, " + + "Français, Arpetan, Furlan, Frysk, Gaeilge, 贛語, Gàidhlig, Galego, " + + "Avañe'ẽ, ગુજરાતી, Gaelg, עברית, हिन्दी, Fiji Hindi, Hrvatski, " + + "Kreyòl ayisyen, Magyar, Հայերեն, Interlingua, Bahasa Indonesia, " + + "Ilokano, Ido, Íslenska, Italiano, 日本語, Lojban, Basa Jawa, " + + "ქართული, Kongo, Kalaallisut, ಕನ್ನಡ, 한국어, Къарачай-Малкъар, " + + "Ripoarisch, Kurdî, Коми, Kernewek, Кыргызча, Latina, Ladino, " + + "Lëtzebuergesch, Limburgs, Lingála, ລາວ, Lietuvių, Latviešu, Basa " + + "Banyumasan, Malagasy, Македонски, മലയാളം, मराठी, مازِرونی, Bahasa " + + "Melayu, Nnapulitano, Nedersaksisch, नेपाल भाषा, Nederlands, ‪" + + "Norsk (nynorsk)‬, ‪Norsk (bokmål)‬, Nouormand, Diné bizaad, " + + "Occitan, Иронау, Papiamentu, Deitsch, Polski, پنجابی, پښتو, " + + "Norfuk / Pitkern, Português, Runa Simi, Rumantsch, Romani, Română, " + + "Русский, Саха тыла, Sardu, Sicilianu, Scots, Sámegiella, Simple " + + "English, Slovenčina, Slovenščina, Српски / Srpski, Seeltersk, " + + "Svenska, Kiswahili, தமிழ், తెలుగు, Тоҷикӣ, ไทย, Türkmençe, Tagalog, " + + "Türkçe, Татарча/Tatarça, Українська, اردو, Tiếng Việt, Volapük, " + + "Walon, Winaray, 吴语, isiXhosa, ייִדיש, Yorùbá, Zeêuws, 中文, " + + "Bân-lâm-gú, 粵語"; +/*jshint +W100 */ + +export var specialCharacters = 'quote: \" backslash:' + + ' forwardslash-escaped: \/ ' + + ' backspace: \b formfeed: \f newline: \n return: \r tab: ' + + ' now-all-of-them-together: "\\\/\b\n\r\t' + + ' now-a-bunch-of-junk: !@#$%&()(&%$#{}{}<><><' + + ' char-to-test-json-parsing: ]] \"]] \\" }}}{ [[[ '; + +export var mapTestInput = { + "a":"123", "a b":"with spaces ", "same":"same", "0":"numeric key", + "longValue":stringTest, stringTest:"long key" +}; + +export var simple = [ + ['testVoid', undefined], + ['testString', 'Test'], + ['testString', ''], + ['testString', stringTest], + ['testString', specialCharacters], + ['testByte', 1], + ['testByte', 0], + ['testByte', -1], + ['testByte', -127], + ['testI32', -1], + ['testDouble', -5.2098523], + ['testDouble', 7.012052175215044], + ['testEnum', ttypes.Numberz.ONE] +]; + +export var simpleLoose = [ + ['testI64', 5], + ['testI64', -5], + ['testI64', 734359738368], + ['testI64', -34359738368], + ['testI64', -734359738368], + ['testTypedef', 69] +] + +var mapout: {[key: number]: number; } = {}; +for (var i = 0; i < 5; ++i) { + mapout[i] = i-10; +} + +export var deep = [ + ['testMap', mapout], + ['testSet', [1,2,3]], + ['testList', [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]], + ['testStringMap', mapTestInput] +]; + +export var out = new ttypes.Xtruct({ + string_thing: 'Zero', + byte_thing: 1, + i32_thing: -3, + i64_thing: 1000000 +}); + +export var out2 = new ttypes.Xtruct2(); +out2.byte_thing = 1; +out2.struct_thing = out; +out2.i32_thing = 5; + +export var crazy = new ttypes.Insanity({ + "userMap":{ "5":5, "8":8 }, + "xtructs":[new ttypes.Xtruct({ + "string_thing":"Goodbye4", + "byte_thing":4, + "i32_thing":4, + "i64_thing":4 + }), new ttypes.Xtruct({ + "string_thing":"Hello2", + "byte_thing":2, + "i32_thing":2, + "i64_thing":2 + })] +}); + +export var insanity: any = { + "1":{ "2": crazy, "3": crazy }, + "2":{ "6":{ "userMap":{}, "xtructs":[] } } +}; diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/test/testAll.sh b/vendor/git.apache.org/thrift.git/lib/nodets/test/testAll.sh new file mode 100755 index 0000000..a7c00bf --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/test/testAll.sh @@ -0,0 +1,38 @@ +#! /bin/sh + +DIR="$( cd "$( dirname "$0" )" && pwd )" + +mkdir -p $DIR/../test-compiled + +COMPILEDDIR="$(cd $DIR && cd ../test-compiled && pwd)" +export NODE_PATH="${DIR}:${DIR}/../../nodejs/lib:${NODE_PATH}" + +compile() +{ + #generating thrift code + ${DIR}/../../../compiler/cpp/thrift -o ${DIR} --gen js:node,ts ${DIR}/../../../test/ThriftTest.thrift + ${DIR}/../../../compiler/cpp/thrift -o ${COMPILEDDIR} --gen js:node,ts ${DIR}/../../../test/ThriftTest.thrift + + tsc --outDir $COMPILEDDIR --project $DIR/tsconfig.json +} +compile + +testServer() +{ + echo "start server $1" + RET=0 + node ${COMPILEDDIR}/server.js $1 & + SERVERPID=$! + sleep 1 + echo "start client $1" + node ${COMPILEDDIR}/client.js $1 || RET=1 + kill -2 $SERVERPID || RET=1 + return $RET +} + +#integration tests + +testServer || TESTOK=1 +testServer --promise || TESTOK=1 + +exit $TESTOK diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/test/test_driver.ts b/vendor/git.apache.org/thrift.git/lib/nodets/test/test_driver.ts new file mode 100644 index 0000000..2c41526 --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/test/test_driver.ts @@ -0,0 +1,278 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + + // This is the Node.js test driver for the standard Apache Thrift + // test service. The driver invokes every function defined in the + // Thrift Test service with a representative range of parameters. + // + // The ThriftTestDriver function requires a client object + // connected to a server hosting the Thrift Test service and + // supports an optional callback function which is called with + // a status message when the test is complete. + +import test = require("tape"); +import ttypes = require("./gen-nodejs/ThriftTest_types"); +import ThriftTest = require("./gen-nodejs/ThriftTest"); +import thrift = require("thrift"); +import Q = thrift.Q; +import TException = thrift.Thrift.TException; +var Int64 = require("node-int64"); +import testCases = require("./test-cases"); + +export function ThriftTestDriver(client: ThriftTest.Client, callback: (status: string) => void) { + + test("NodeJS Style Callback Client Tests", function(assert) { + + var checkRecursively = makeRecursiveCheck(assert); + + function makeAsserter(assertionFn: (a: any, b: any, msg?: string) => void) { + return function(c: (string | any)[]) { + var fnName = c[0]; + var expected = c[1]; + (client)[fnName](expected, function(err: any, actual: any) { + assert.error(err, fnName + ": no callback error"); + assertionFn(actual, expected, fnName); + }) + }; + } + + testCases.simple.forEach(makeAsserter(assert.equal)); + testCases.simpleLoose.forEach(makeAsserter(function(a, e, m){ + assert.ok(a == e, m); + })); + testCases.deep.forEach(makeAsserter(assert.deepEqual)); + + client.testMapMap(42, function(err, response) { + var expected: typeof response = { + "4": {"1":1, "2":2, "3":3, "4":4}, + "-4": {"-4":-4, "-3":-3, "-2":-2, "-1":-1} + }; + assert.error(err, 'testMapMap: no callback error'); + assert.deepEqual(expected, response, "testMapMap"); + }); + + client.testStruct(testCases.out, function(err, response) { + assert.error(err, "testStruct: no callback error"); + checkRecursively(testCases.out, response, "testStruct"); + }); + + client.testNest(testCases.out2, function(err, response) { + assert.error(err, "testNest: no callback error"); + checkRecursively(testCases.out2, response, "testNest"); + }); + + client.testInsanity(testCases.crazy, function(err, response) { + assert.error(err, "testInsanity: no callback error"); + checkRecursively(testCases.insanity, response, "testInsanity"); + }); + + client.testException("TException", function(err, response) { + assert.ok(err instanceof TException, 'testException: correct error type'); + assert.ok(!Boolean(response), 'testException: no response'); + }); + + client.testException("Xception", function(err, response) { + assert.ok(err instanceof ttypes.Xception, 'testException: correct error type'); + assert.ok(!Boolean(response), 'testException: no response'); + assert.equal(err.errorCode, 1001, 'testException: correct error code'); + assert.equal('Xception', err.message, 'testException: correct error message'); + }); + + client.testException("no Exception", function(err, response) { + assert.error(err, 'testException: no callback error'); + assert.ok(!Boolean(response), 'testException: no response'); + }); + + client.testOneway(0, function(err, response) { + assert.error(err, 'testOneway: no callback error'); + assert.strictEqual(response, undefined, 'testOneway: void response'); + }); + + checkOffByOne(function(done) { + client.testI32(-1, function(err, response) { + assert.error(err, "checkOffByOne: no callback error"); + assert.equal(-1, response); + assert.end(); + done(); + }); + }, callback); + + }); +}; + +export function ThriftTestDriverPromise(client: ThriftTest.Client, callback: (status: string) => void) { + + test("Q Promise Client Tests", function(assert) { + + var checkRecursively = makeRecursiveCheck(assert); + + function fail(msg: string) { + return function(error, response) { + if (error !== null) { + assert.fail(msg); + } + } + } + + function makeAsserter(assertionFn: (a: any, b: any, msg?: string) => void) { + return function(c: (string | any)[]) { + var fnName = c[0]; + var expected = c[1]; + (client)[fnName](expected) + .then(function(actual: any) { + assertionFn(actual, expected, fnName); + }) + .fail(fail("fnName")); + }; + } + + testCases.simple.forEach(makeAsserter(assert.equal)); + testCases.simpleLoose.forEach(makeAsserter(function(a, e, m){ + assert.ok(a == e, m); + })); + testCases.deep.forEach(makeAsserter(assert.deepEqual)); + + Q.resolve(client.testStruct(testCases.out)) + .then(function(response) { + checkRecursively(testCases.out, response, "testStruct"); + }) + .fail(fail("testStruct")); + + Q.resolve(client.testNest(testCases.out2)) + .then(function(response) { + checkRecursively(testCases.out2, response, "testNest"); + }) + .fail(fail("testNest")); + + Q.resolve(client.testInsanity(testCases.crazy)) + .then(function(response) { + checkRecursively(testCases.insanity, response, "testInsanity"); + }) + .fail(fail("testInsanity")); + + Q.resolve(client.testException("TException")) + .then(function(response) { + fail("testException: TException"); + }) + .fail(function(err) { + assert.ok(err instanceof TException); + }); + + Q.resolve(client.testException("Xception")) + .then(function(response) { + fail("testException: Xception"); + }) + .fail(function(err) { + assert.ok(err instanceof ttypes.Xception); + assert.equal(err.errorCode, 1001); + assert.equal("Xception", err.message); + }); + + Q.resolve(client.testException("no Exception")) + .then(function(response) { + assert.equal(undefined, response); //void + }) + .fail(fail("testException")); + + client.testOneway(0, fail("testOneway: should not answer")); + + checkOffByOne(function(done) { + Q.resolve(client.testI32(-1)) + .then(function(response) { + assert.equal(-1, response); + assert.end(); + done(); + }) + .fail(fail("checkOffByOne")); + }, callback); + }); +}; + + +// Helper Functions +// ========================================================= + +function makeRecursiveCheck(assert: test.Test) { + + return function (map1: any, map2: any, msg: string) { + var equal = true; + + var equal = checkRecursively(map1, map2); + + assert.ok(equal, msg); + + // deepEqual doesn't work with fields using node-int64 + function checkRecursively(map1: any, map2: any) : boolean { + if (!(typeof map1 !== "function" && typeof map2 !== "function")) { + return false; + } + if (!map1 || typeof map1 !== "object") { + //Handle int64 types (which use node-int64 in Node.js JavaScript) + if ((typeof map1 === "number") && (typeof map2 === "object") && + (map2.buffer) && (map2.buffer instanceof Buffer) && (map2.buffer.length === 8)) { + var n = new Int64(map2.buffer); + return map1 === n.toNumber(); + } else { + return map1 == map2; + } + } else { + return Object.keys(map1).every(function(key) { + return checkRecursively(map1[key], map2[key]); + }); + } + } + } +} + +function checkOffByOne(done: (callback: () => void) => void, callback: (message: string) => void) { + + var retry_limit = 30; + var retry_interval = 100; + var test_complete = false; + var retrys = 0; + + /** + * redo a simple test after the oneway to make sure we aren't "off by one" -- + * if the server treated oneway void like normal void, this next test will + * fail since it will get the void confirmation rather than the correct + * result. In this circumstance, the client will throw the exception: + * + * Because this is the last test against the server, when it completes + * the entire suite is complete by definition (the tests run serially). + */ + done(function() { + test_complete = true; + }); + + //We wait up to retry_limit * retry_interval for the test suite to complete + function TestForCompletion() { + if(test_complete && callback) { + callback("Server successfully tested!"); + } else { + if (++retrys < retry_limit) { + setTimeout(TestForCompletion, retry_interval); + } else if (callback) { + callback("Server test failed to complete after " + + (retry_limit * retry_interval / 1000) + " seconds"); + } + } + } + + setTimeout(TestForCompletion, retry_interval); +} diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/test/test_handler.ts b/vendor/git.apache.org/thrift.git/lib/nodets/test/test_handler.ts new file mode 100644 index 0000000..1bc855a --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/test/test_handler.ts @@ -0,0 +1,299 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +//This is the server side Node test handler for the standard +// Apache Thrift test service. + +import ttypes = require("./gen-nodejs/ThriftTest_types"); +import thrift = require("thrift"); +import Thrift = thrift.Thrift; +import Q = require("q"); + + +export class SyncThriftTestHandler { + testVoid(): Q.IPromise { + //console.log('testVoid()'); + return Q.resolve(undefined); + } + testMapMap(hello: number) { + //console.log('testMapMap(' + hello + ')'); + + var mapmap: {[key: number]: {[key: number]: number; }} = []; + var pos: {[key: number]: number; } = []; + var neg: {[key: number]: number; } = []; + for (var i = 1; i < 5; i++) { + pos[i] = i; + neg[-i] = -i; + } + mapmap[4] = pos; + mapmap[-4] = neg; + + return Q.resolve(mapmap); + } + testInsanity(argument: ttypes.Insanity): Q.IPromise<{ [k: number]: any; }> { + const first_map: { [k: number]: any; } = []; + const second_map: { [k: number]: any; } = []; + + first_map[ttypes.Numberz.TWO] = argument; + first_map[ttypes.Numberz.THREE] = argument; + + const looney = new ttypes.Insanity(); + second_map[ttypes.Numberz.SIX] = looney; + + const insane: { [k: number]: any; } = []; + insane[1] = first_map; + insane[2] = second_map; + + return Q.resolve(insane); + } + testMulti(arg0: any, arg1: number, arg2: number, arg3: { [k: number]: string; }, arg4: ttypes.Numberz, arg5: number) { + var hello = new ttypes.Xtruct(); + hello.string_thing = 'Hello2'; + hello.byte_thing = arg0; + hello.i32_thing = arg1; + hello.i64_thing = arg2; + return Q.resolve(hello); + } + testException(arg: string): Q.IPromise { + if (arg === 'Xception') { + var x = new ttypes.Xception(); + x.errorCode = 1001; + x.message = arg; + throw x; + } else if (arg === 'TException') { + throw new Thrift.TException(arg); + } else { + return Q.resolve(); + } + } + testMultiException(arg0: string, arg1: string) { + if (arg0 === ('Xception')) { + var x = new ttypes.Xception(); + x.errorCode = 1001; + x.message = 'This is an Xception'; + throw x; + } else if (arg0 === ('Xception2')) { + var x2 = new ttypes.Xception2(); + x2.errorCode = 2002; + x2.struct_thing = new ttypes.Xtruct(); + x2.struct_thing.string_thing = 'This is an Xception2'; + throw x2; + } + + var res = new ttypes.Xtruct(); + res.string_thing = arg1; + return Q.resolve(res); + } + testOneway(sleepFor: number) { + } + + testString(thing: string) { + return Q.resolve(thing); + } + testBool(thing: boolean) { + return Q.resolve(thing); + } + testByte(thing: number) { + return Q.resolve(thing); + } + testI32(thing: number) { + return Q.resolve(thing); + } + testI64(thing: number) { + return Q.resolve(thing); + } + testDouble(thing: number) { + return Q.resolve(thing); + } + testBinary(thing: Buffer) { + return Q.resolve(thing); + } + testStruct(thing: ttypes.Xtruct) { + return Q.resolve(thing); + } + testNest(thing: ttypes.Xtruct2) { + return Q.resolve(thing); + } + testMap(thing: { [k: number]: number; }) { + return Q.resolve(thing); + } + testStringMap(thing: { [k: string]: string; }) { + return Q.resolve(thing); + } + testSet(thing: number[]) { + return Q.resolve(thing); + } + testList(thing: number[]) { + return Q.resolve(thing); + } + testEnum(thing: ttypes.Numberz) { + return Q.resolve(thing); + } + testTypedef(thing: number) { + return Q.resolve(thing); + } +} + +export class AsyncThriftTestHandler { + private syncHandler: SyncThriftTestHandler; + constructor() { + this.syncHandler = new SyncThriftTestHandler(); + } + + testVoid(callback: (result: void) => void): Q.IPromise { + callback(undefined); + return Q.resolve(); + } + testMapMap(hello: number, + callback: (err: any, result: { [k: number]: { [k: number]: number; }; }) => void): + Q.IPromise<{ [k: number]: { [k: number]: number; }; }> { + + var mapmap: {[key: number]: {[key: number]: number; }} = []; + var pos: {[key: number]: number; } = []; + var neg: {[key: number]: number; } = []; + for (var i = 1; i < 5; i++) { + pos[i] = i; + neg[-i] = -i; + } + mapmap[4] = pos; + mapmap[-4] = neg; + + callback(null, mapmap); + return Q.resolve(); + } + testInsanity(argument: ttypes.Insanity, callback?: (err: any, result: { [k: number]: any; }) => void): Q.IPromise<{ [k: number]: any; }> { + const first_map: { [k: number]: any; } = []; + const second_map: { [k: number]: any; } = []; + + first_map[ttypes.Numberz.TWO] = argument; + first_map[ttypes.Numberz.THREE] = argument; + + const looney = new ttypes.Insanity(); + second_map[ttypes.Numberz.SIX] = looney; + + const insane: { [k: number]: any; } = []; + insane[1] = first_map; + insane[2] = second_map; + + if (callback !== undefined){ + callback(null, insane); + } + return Q.resolve(); + } + testMulti(arg0: any, arg1: number, arg2: number, arg3: { [k: number]: string; }, arg4: ttypes.Numberz, arg5: number, result: Function): Q.IPromise { + var hello = this.syncHandler.testMulti(arg0, arg1, arg2, arg3, arg4, arg5); + hello.then(hello => result(null, hello)); + return Q.resolve(); + } + testException(arg: string, result: (err: any) => void): Q.IPromise { + if (arg === 'Xception') { + var x = new ttypes.Xception(); + x.errorCode = 1001; + x.message = arg; + result(x); + } else if (arg === 'TException') { + result(new Thrift.TException(arg)); + } else { + result(null); + } + return Q.resolve(); + } + testMultiException(arg0: string, arg1: string, result: (err: any, res?: ttypes.Xtruct) => void): Q.IPromise { + if (arg0 === ('Xception')) { + var x = new ttypes.Xception(); + x.errorCode = 1001; + x.message = 'This is an Xception'; + result(x); + } else if (arg0 === ('Xception2')) { + var x2 = new ttypes.Xception2(); + x2.errorCode = 2002; + x2.struct_thing = new ttypes.Xtruct(); + x2.struct_thing.string_thing = 'This is an Xception2'; + result(x2); + } else { + var res = new ttypes.Xtruct(); + res.string_thing = arg1; + result(null, res); + } + return Q.resolve(); + } + testOneway(sleepFor: number, result: Function) { + this.syncHandler.testOneway(sleepFor); + } + testString(thing: string, callback: (err: any, result: string) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testByte(thing: number, callback: (err: any, result: number) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testBool(thing: boolean, callback: (err: any, result: boolean) => void ): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testI32(thing: number, callback: (err: any, result: number) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testI64(thing: number, callback: (err: any, result: number) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testDouble(thing: number, callback: (err: any, result: number) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testBinary(thing: Buffer, callback: (err: any, result: Buffer) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testStruct(thing: ttypes.Xtruct, callback: (err: any, result: ttypes.Xtruct) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testNest(thing: ttypes.Xtruct2, callback: (err: any, result: ttypes.Xtruct2) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testMap(thing: { [k: number]: number; }, callback: (err: any, result: { [k: number]: number; }) => void): Q.IPromise<{ [k: number]: number; }> { + callback(null, thing); + return Q.resolve(); + } + testStringMap(thing: { [k: string]: string; }, callback: (err: any, result: { [k: string]: string; }) => void): Q.IPromise<{ [k: string]: string; }> { + callback(null, thing); + return Q.resolve(); + } + testSet(thing: number[], callback: (err: any, result: number[]) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testList(thing: number[], callback: (err: any, result: number[]) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testEnum(thing: ttypes.Numberz, callback: (err: any, result: ttypes.Numberz) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } + testTypedef(thing: number, callback: (err: any, result: number) => void): Q.IPromise { + callback(null, thing); + return Q.resolve(); + } +} diff --git a/vendor/git.apache.org/thrift.git/lib/nodets/test/tsconfig.json b/vendor/git.apache.org/thrift.git/lib/nodets/test/tsconfig.json new file mode 100644 index 0000000..029d06d --- /dev/null +++ b/vendor/git.apache.org/thrift.git/lib/nodets/test/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "allowJs": false, + "alwaysStrict": true, + "baseUrl": ".", + "declaration": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "module": "commonjs", + "moduleResolution": "node", + "noImplicitThis": true, + "noUnusedLocals": true, + "preserveConstEnums": true, + "removeComments": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "target": "es6", + "paths": { + "thrift": ["../../nodejs/lib/thrift"] + } + } +} diff --git a/vendor/git.apache.org/thrift.git/lib/ocaml/_oasis b/vendor/git.apache.org/thrift.git/lib/ocaml/_oasis index 4dd95e5..315183f 100644 --- a/vendor/git.apache.org/thrift.git/lib/ocaml/_oasis +++ b/vendor/git.apache.org/thrift.git/lib/ocaml/_oasis @@ -1,5 +1,5 @@ Name: libthrift-ocaml -Version: 1.0 +Version: 0.12.0 OASISFormat: 0.3 Synopsis: OCaml bindings for the Apache Thrift RPC system Authors: Apache Thrift Developers diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift.pm index 592d1dd..107b2a2 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift.pm @@ -31,6 +31,6 @@ use warnings; # package Thrift; -use version 0.77; our $VERSION = version->declare("v1.0_0"); +use version 0.77; our $VERSION = version->declare("v0.12.0_0"); 1; diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/BinaryProtocol.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/BinaryProtocol.pm index 61937e4..d62509a 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/BinaryProtocol.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/BinaryProtocol.pm @@ -39,7 +39,7 @@ use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); use constant VERSION_MASK => 0xffff0000; use constant VERSION_1 => 0x80010000; -use constant IS_BIG_ENDIAN => unpack("h*", pack("s", 1)) =~ /01/; +use constant IS_BIG_ENDIAN => unpack('h*', pack('s', 1)) =~ m/01/; sub new { @@ -67,7 +67,8 @@ sub writeMessageEnd return 0; } -sub writeStructBegin{ +sub writeStructBegin +{ my $self = shift; my $name = shift; return 0; @@ -253,7 +254,7 @@ sub readMessageBegin my $result = $self->readI32(\$version); if (($version & VERSION_MASK) > 0) { if (($version & VERSION_MASK) != VERSION_1) { - die new Thrift::TProtocolException('Missing version identifier', + die Thrift::TProtocolException->new('Missing version identifier', Thrift::TProtocolException::BAD_VERSION); } $$type = $version & 0x000000ff; @@ -261,7 +262,8 @@ sub readMessageBegin $result + $self->readString($name) + $self->readI32($seqid); - } else { # old client support code + } + else { # old client support code return $result + $self->readStringBody($name, $version) + # version here holds the size of the string @@ -427,7 +429,7 @@ sub readI64 my ($hi,$lo)=unpack('NN',$data); - my $vec = new Bit::Vector(64); + my $vec = Bit::Vector->new(64); $vec->Chunk_Store(32,32,$hi); $vec->Chunk_Store(32,0,$lo); @@ -467,7 +469,8 @@ sub readString if ($len) { $$value = $self->{trans}->readAll($len); - } else { + } + else { $$value = ''; } @@ -482,7 +485,8 @@ sub readStringBody if ($len) { $$value = $self->{trans}->readAll($len); - } else { + } + else { $$value = ''; } @@ -508,7 +512,7 @@ sub getProtocol{ my $self = shift; my $trans = shift; - return new Thrift::BinaryProtocol($trans); + return Thrift::BinaryProtocol->new($trans); } 1; diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Exception.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Exception.pm index 5f0d8fb..e404068 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Exception.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Exception.pm @@ -29,11 +29,10 @@ use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); use overload '""' => sub { return - ref( $_[0] ) - . " error: " - . ( $_[0]->{message} || 'empty message' ) - . " (code " - . ( defined $_[0]->{code} ? $_[0]->{code} : 'undefined' ) . ")"; + sprintf '%s error: %s (code %s)', + ref( $_[0] ), + ( $_[0]->{message} || 'empty message' ), + ( defined $_[0]->{code} ? $_[0]->{code} : 'undefined' ); }; sub new { @@ -91,7 +90,8 @@ sub read { if ($ftype == Thrift::TType::STRING) { $xfer += $input->readString(\$self->{message}); - } else { + } + else { $xfer += $input->skip($ftype); } @@ -101,7 +101,8 @@ sub read { /2/ && do{ if ($ftype == Thrift::TType::I32) { $xfer += $input->readI32(\$self->{code}); - } else { + } + else { $xfer += $input->skip($ftype); } last; diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/FramedTransport.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/FramedTransport.pm index ee842e6..ba89ba3 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/FramedTransport.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/FramedTransport.pm @@ -70,7 +70,7 @@ sub close my $self = shift; if (defined $self->{transport}) { - $self->{transport}->close(); + $self->{transport}->close(); } } diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/HttpClient.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/HttpClient.pm index 6e6a631..40ec9ce 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/HttpClient.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/HttpClient.pm @@ -61,7 +61,7 @@ sub setTimeout sub setRecvTimeout { - warn "setRecvTimeout is deprecated - use setTimeout instead"; + warn 'setRecvTimeout is deprecated - use setTimeout instead'; # note: recvTimeout was never used so we do not need to do anything here } @@ -70,7 +70,7 @@ sub setSendTimeout my $self = shift; my $timeout = shift; - warn "setSendTimeout is deprecated - use setTimeout instead"; + warn 'setSendTimeout is deprecated - use setTimeout instead'; $self->setTimeout($timeout); } @@ -102,8 +102,8 @@ sub close { my $self = shift; if (defined($self->{io})) { - close($self->{io}); - $self->{io} = undef; + close($self->{io}); + $self->{io} = undef; } } @@ -121,7 +121,7 @@ sub readAll my $buf = $self->read($len); if (!defined($buf)) { - die new Thrift::TTransportException("TSocket: Could not read $len bytes from input buffer", + die Thrift::TTransportException->new("TSocket: Could not read $len bytes from input buffer", Thrift::TTransportException::END_OF_FILE); } return $buf; @@ -140,17 +140,18 @@ sub read my $in = $self->{in}; if (!defined($in)) { - die new Thrift::TTransportException("Response buffer is empty, no request.", + die Thrift::TTransportException->new('Response buffer is empty, no request.', Thrift::TTransportException::END_OF_FILE); } eval { - my $ret = sysread($in, $buf, $len); - if (! defined($ret)) { - die new Thrift::TTransportException("No more data available.", + my $ret = sysread($in, $buf, $len); + if (! defined($ret)) { + die Thrift::TTransportException->new('No more data available.', Thrift::TTransportException::TIMED_OUT); - } - }; if($@){ - die new Thrift::TTransportException("$@", Thrift::TTransportException::UNKNOWN); + } + }; + if($@){ + die Thrift::TTransportException->new("$@", Thrift::TTransportException::UNKNOWN); } return $buf; @@ -173,8 +174,9 @@ sub flush { my $self = shift; - my $ua = LWP::UserAgent->new('timeout' => ($self->{timeout} / 1000), - 'agent' => 'Perl/THttpClient' + my $ua = LWP::UserAgent->new( + 'timeout' => ($self->{timeout} / 1000), + 'agent' => 'Perl/THttpClient' ); $ua->default_header('Accept' => 'application/x-thrift'); $ua->default_header('Content-Type' => 'application/x-thrift'); @@ -184,8 +186,7 @@ sub flush $out->setpos(0); # rewind my $buf = join('', <$out>); - my $request = new HTTP::Request(POST => $self->{url}, undef, $buf); - map { $request->header($_ => $self->{headers}->{$_}) } keys %{$self->{headers}}; + my $request = HTTP::Request->new(POST => $self->{url}, ($self->{headers} || undef), $buf); my $response = $ua->request($request); my $content_ref = $response->content_ref; diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MemoryBuffer.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MemoryBuffer.pm index 1e51239..be97ce4 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MemoryBuffer.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MemoryBuffer.pm @@ -35,10 +35,10 @@ sub new my $bufferSize= shift || 1024; my $self = { - buffer => '', - bufferSize=> $bufferSize, - wPos => 0, - rPos => 0, + buffer => '', + bufferSize => $bufferSize, + wPos => 0, + rPos => 0, }; return bless($self,$classname); @@ -117,7 +117,7 @@ sub readAll my $avail = ($self->{wPos} - $self->{rPos}); if ($avail < $len) { - die new TTransportException("Attempt to readAll($len) found only $avail available", + die TTransportException->new("Attempt to readAll($len) found only $avail available", Thrift::TTransportException::END_OF_FILE); } diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MultiplexedProcessor.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MultiplexedProcessor.pm index 05c4ead..ae925d7 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MultiplexedProcessor.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MultiplexedProcessor.pm @@ -101,32 +101,32 @@ sub process { $input->readMessageBegin(\$fname, \$mtype, \$rseqid); if ($mtype ne Thrift::TMessageType::CALL && $mtype ne Thrift::TMessageType::ONEWAY) { - die new Thrift::TException("This should not have happened!?"); + die Thrift::TException->new('This should not have happened!?'); } # Extract the service name and the new Message name. if (index($fname, Thrift::MultiplexedProtocol::SEPARATOR) == -1) { if (defined $self->{defaultProcessor}) { return $self->{defaultProcessor}->process( - new Thrift::StoredMessageProtocol($input, $fname, $mtype, $rseqid), $output + Thrift::StoredMessageProtocol->new($input, $fname, $mtype, $rseqid), $output ); } else { - die new Thrift::TException("Service name not found in message name: {$fname} and no default processor defined. Did you " . - "forget to use a MultiplexProtocol in your client?"); + die Thrift::TException->new("Service name not found in message name: {$fname} and no default processor defined. Did you " . + 'forget to use a MultiplexProtocol in your client?'); } } (my $serviceName, my $messageName) = split(':', $fname, 2); if (!exists($self->{serviceProcessorMap}->{$serviceName})) { - die new Thrift::TException("Service name not found: {$serviceName}. Did you forget " . - "to call registerProcessor()?"); + die Thrift::TException->new("Service name not found: {$serviceName}. Did you forget " . + 'to call registerProcessor()?'); } # Dispatch processing to the stored processor my $processor = $self->{serviceProcessorMap}->{$serviceName}; return $processor->process( - new Thrift::StoredMessageProtocol($input, $messageName, $mtype, $rseqid), $output + Thrift::StoredMessageProtocol->new($input, $messageName, $mtype, $rseqid), $output ); } diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MultiplexedProtocol.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MultiplexedProtocol.pm index 903211f..5b5b60b 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MultiplexedProtocol.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/MultiplexedProtocol.pm @@ -53,7 +53,7 @@ sub new { # sub writeMessageBegin { - my $self = shift; + my $self = shift; my ($name, $type, $seqid) = @_; if ($type == Thrift::TMessageType::CALL || $type == Thrift::TMessageType::ONEWAY) { diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Protocol.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Protocol.pm index c681f60..26ef46a 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Protocol.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Protocol.pm @@ -81,14 +81,14 @@ sub getTransport sub writeMessageBegin { my ($name, $type, $seqid); - die "abstract"; + die 'abstract'; } # # Close the message # sub writeMessageEnd { - die "abstract"; + die 'abstract'; } # @@ -101,7 +101,7 @@ sub writeMessageEnd { sub writeStructBegin { my ($name); - die "abstract"; + die 'abstract'; } # @@ -111,7 +111,7 @@ sub writeStructBegin { # @return int How many bytes written # sub writeStructEnd { - die "abstract"; + die 'abstract'; } # @@ -126,79 +126,79 @@ sub writeStructEnd { sub writeFieldBegin { my ($fieldName, $fieldType, $fieldId); - die "abstract"; + die 'abstract'; } sub writeFieldEnd { - die "abstract"; + die 'abstract'; } sub writeFieldStop { - die "abstract"; + die 'abstract'; } sub writeMapBegin { my ($keyType, $valType, $size); - die "abstract"; + die 'abstract'; } sub writeMapEnd { - die "abstract"; + die 'abstract'; } sub writeListBegin { my ($elemType, $size); - die "abstract"; + die 'abstract'; } sub writeListEnd { - die "abstract"; + die 'abstract'; } sub writeSetBegin { my ($elemType, $size); - die "abstract"; + die 'abstract'; } sub writeSetEnd { - die "abstract"; + die 'abstract'; } sub writeBool { my ($bool); - die "abstract"; + die 'abstract'; } sub writeByte { my ($byte); - die "abstract"; + die 'abstract'; } sub writeI16 { my ($i16); - die "abstract"; + die 'abstract'; } sub writeI32 { my ($i32); - die "abstract"; + die 'abstract'; } sub writeI64 { my ($i64); - die "abstract"; + die 'abstract'; } sub writeDouble { my ($dub); - die "abstract"; + die 'abstract'; } sub writeString { my ($str); - die "abstract"; + die 'abstract'; } # @@ -211,7 +211,7 @@ sub writeString sub readMessageBegin { my ($name, $type, $seqid); - die "abstract"; + die 'abstract'; } # @@ -219,105 +219,105 @@ sub readMessageBegin # sub readMessageEnd { - die "abstract"; + die 'abstract'; } sub readStructBegin { my($name); - die "abstract"; + die 'abstract'; } sub readStructEnd { - die "abstract"; + die 'abstract'; } sub readFieldBegin { my ($name, $fieldType, $fieldId); - die "abstract"; + die 'abstract'; } sub readFieldEnd { - die "abstract"; + die 'abstract'; } sub readMapBegin { my ($keyType, $valType, $size); - die "abstract"; + die 'abstract'; } sub readMapEnd { - die "abstract"; + die 'abstract'; } sub readListBegin { my ($elemType, $size); - die "abstract"; + die 'abstract'; } sub readListEnd { - die "abstract"; + die 'abstract'; } sub readSetBegin { my ($elemType, $size); - die "abstract"; + die 'abstract'; } sub readSetEnd { - die "abstract"; + die 'abstract'; } sub readBool { my ($bool); - die "abstract"; + die 'abstract'; } sub readByte { my ($byte); - die "abstract"; + die 'abstract'; } sub readI16 { my ($i16); - die "abstract"; + die 'abstract'; } sub readI32 { my ($i32); - die "abstract"; + die 'abstract'; } sub readI64 { my ($i64); - die "abstract"; + die 'abstract'; } sub readDouble { my ($dub); - die "abstract"; + die 'abstract'; } sub readString { my ($str); - die "abstract"; + die 'abstract'; } # @@ -405,7 +405,7 @@ sub skip return $result; } - die new Thrift::TProtocolException("Type $type not recognized --- corrupt data?", + die Thrift::TProtocolException->new("Type $type not recognized --- corrupt data?", Thrift::TProtocolException::INVALID_DATA); } @@ -424,7 +424,7 @@ sub skipBinary if($type == Thrift::TType::BOOL) { - return $itrans->readAll(1); + return $itrans->readAll(1); } elsif($type == Thrift::TType::BYTE) { @@ -459,17 +459,17 @@ sub skipBinary { my $result = 0; while (1) { - my $ftype = 0; - my $fid = 0; - my $data = $itrans->readAll(1); - my @arr = unpack('c', $data); - $ftype = $arr[0]; - if ($ftype == Thrift::TType::STOP) { - last; - } - # I16 field id - $result += $itrans->readAll(2); - $result += $self->skipBinary($itrans, $ftype); + my $ftype = 0; + my $fid = 0; + my $data = $itrans->readAll(1); + my @arr = unpack('c', $data); + $ftype = $arr[0]; + if ($ftype == Thrift::TType::STOP) { + last; + } + # I16 field id + $result += $itrans->readAll(2); + $result += $self->skipBinary($itrans, $ftype); } return $result; } @@ -517,7 +517,7 @@ sub skipBinary return $result; } - die new Thrift::TProtocolException("Type $type not recognized --- corrupt data?", + die Thrift::TProtocolException->new("Type $type not recognized --- corrupt data?", Thrift::TProtocolException::INVALID_DATA); } @@ -542,7 +542,7 @@ sub new { sub getProtocol { my ($trans); - die "interface"; + die 'interface'; } diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/SSLServerSocket.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/SSLServerSocket.pm index d29671b..7b06431 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/SSLServerSocket.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/SSLServerSocket.pm @@ -48,7 +48,7 @@ sub new sub __client { - return new Thrift::SSLSocket(); + return Thrift::SSLSocket->new(); } sub __listen diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/SSLSocket.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/SSLSocket.pm index 4bdf637..e34924d 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/SSLSocket.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/SSLSocket.pm @@ -34,7 +34,7 @@ use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); # Construction and usage # # my $opts = {} -# my $socket = new Thrift::SSLSocket(\%opts); +# my $socket = Thrift::SSLSocket->new(\%opts); # # options: # diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Server.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Server.pm index f265d45..28822e8 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Server.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Server.pm @@ -51,7 +51,7 @@ sub new if (scalar @args == 2) { - $self = _init($args[0], $args[1], + $self = _init($args[0], $args[1], Thrift::BufferedTransportFactory->new(), Thrift::BufferedTransportFactory->new(), Thrift::BinaryProtocolFactory->new(), @@ -67,7 +67,7 @@ sub new } else { - die new Thrift::TException("Thrift::Server expects exactly 2, 4, or 6 args"); + die Thrift::TException->new('Thrift::Server expects exactly 2, 4, or 6 args'); } return bless($self,$classname); @@ -94,7 +94,7 @@ sub _init sub serve { - die "abstract"; + die 'abstract'; } sub _clientBegin @@ -115,7 +115,7 @@ sub _handleException my $self = shift; my $e = shift; - if ($e->isa("Thrift::TException") and exists $e->{message}) { + if ($e->isa('Thrift::TException') and exists $e->{message}) { my $message = $e->{message}; my $code = $e->{code}; my $out = $code . ':' . $message; @@ -123,10 +123,12 @@ sub _handleException $message =~ m/TTransportException/ and die $out; if ($message =~ m/Socket/) { # suppress Socket messages - } else { + } + else { warn $out; } - } else { + } + else { warn $e; } } @@ -151,7 +153,7 @@ sub serve { my $self = shift; my $stop = 0; - + $self->{serverTransport}->listen(); while (!$stop) { my $client = $self->{serverTransport}->accept(); @@ -166,10 +168,10 @@ sub serve { $self->{processor}->process($iprot, $oprot); } - }; if($@) { + }; + if($@) { $self->_handleException($@); } - $itrans->close(); $otrans->close(); } else { @@ -184,7 +186,7 @@ sub serve # package Thrift::ForkingServer; use parent -norequire, 'Thrift::Server'; -use POSIX ":sys_wait_h"; +use POSIX ':sys_wait_h'; use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); sub new @@ -231,10 +233,12 @@ sub _client if ($pid) { $self->_parent($pid, $itrans, $otrans); - } else { + } + else { $self->_child($itrans, $otrans, $iprot, $oprot); } - }; if($@) { + }; + if($@) { $self->_handleException($@); } } @@ -267,7 +271,8 @@ sub _child { $self->{processor}->process($iprot, $oprot); } - }; if($@) { + }; + if($@) { $ecode = 1; $self->_handleException($@); } @@ -288,14 +293,16 @@ sub tryClose { $file->close(); } - }; if($@) { - if ($@->isa("Thrift::TException") and exists $@->{message}) { + }; + if($@) { + if ($@->isa('Thrift::TException') and exists $@->{message}) { my $message = $@->{message}; my $code = $@->{code}; my $out = $code . ':' . $message; warn $out; - } else { + } + else { warn $@; } } diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/ServerSocket.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/ServerSocket.pm index 2c4d906..3972643 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/ServerSocket.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/ServerSocket.pm @@ -38,7 +38,7 @@ use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); # @param[in] host host interface to listen on (undef = all interfaces) # @param[in] port port number to listen on (required) # @param[in] queue the listen queue size (default if not specified is 128) -# @example my $serversock = new Thrift::ServerSocket(host => undef, port => port) +# @example my $serversock = Thrift::ServerSocket->new(host => undef, port => port) # sub new { @@ -49,7 +49,8 @@ sub new # Support both old-style "port number" construction and newer... if (ref($args) eq 'HASH') { $self = $args; - } else { + } + else { $self = { port => $args }; } @@ -71,7 +72,7 @@ sub listen $self->{debugHandler}->($error); } - die new Thrift::TTransportException($error, Thrift::TTransportException::NOT_OPEN); + die Thrift::TTransportException->new($error, Thrift::TTransportException::NOT_OPEN); }; $self->{handle} = $sock; @@ -84,7 +85,7 @@ sub accept if ( exists $self->{handle} and defined $self->{handle} ) { my $client = $self->{handle}->accept(); my $result = $self->__client(); - $result->{handle} = new IO::Select($client); + $result->{handle} = IO::Select->new($client); return $result; } @@ -93,12 +94,12 @@ sub accept sub close { - my $self = shift; - + my $self = shift; + if ( exists $self->{handle} and defined $self->{handle} ) { $self->{handle}->close(); - } + } } ### @@ -107,7 +108,7 @@ sub close sub __client { - return new Thrift::Socket(); + return Thrift::Socket->new(); } sub __listen diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Socket.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Socket.pm index ae248df..ba0db5e 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Socket.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Socket.pm @@ -36,7 +36,7 @@ use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); # Construction and usage # # my $opts = {} -# my $socket = new Thrift::Socket(\%opts); +# my $socket = Thrift::Socket->new(\%opts); # # options: # @@ -120,10 +120,10 @@ sub open my $sock = $self->__open() || do { my $error = ref($self).': Could not connect to '.$self->{host}.':'.$self->{port}.' ('.$!.')'; - die new Thrift::TTransportException($error, Thrift::TTransportException::NOT_OPEN); + die Thrift::TTransportException->new($error, Thrift::TTransportException::NOT_OPEN); }; - $self->{handle} = new IO::Select( $sock ); + $self->{handle} = IO::Select->new( $sock ); } # @@ -159,15 +159,17 @@ sub readAll if (!defined $buf || $buf eq '') { - die new Thrift::TTransportException(ref($self).': Could not read '.$len.' bytes from '. + die Thrift::TTransportException->new(ref($self).': Could not read '.$len.' bytes from '. $self->{host}.':'.$self->{port}, Thrift::TTransportException::END_OF_FILE); - } elsif ((my $sz = length($buf)) < $len) { + } + elsif ((my $sz = length($buf)) < $len) { $pre .= $buf; $len -= $sz; - } else { + } + else { return $pre.$buf; } } @@ -191,7 +193,7 @@ sub read if (!defined $buf || $buf eq '') { - die new Thrift::TTransportException(ref($self).': Could not read '.$len.' bytes from '. + die Thrift::TTransportException->new(ref($self).': Could not read '.$len.' bytes from '. $self->{host}.':'.$self->{port}, Thrift::TTransportException::END_OF_FILE); } @@ -217,7 +219,7 @@ sub write my @sockets = $self->{handle}->can_write( $self->{sendTimeout} / 1000 ); if(@sockets == 0){ - die new Thrift::TTransportException(ref($self).': timed out writing to bytes from '. + die Thrift::TTransportException->new(ref($self).': timed out writing to bytes from '. $self->{host}.':'.$self->{port}, Thrift::TTransportException::TIMED_OUT); } @@ -225,7 +227,7 @@ sub write if (!defined $sent || $sent == 0 ) { - die new Thrift::TTransportException(ref($self).': Could not write '.length($buf).' bytes '. + die Thrift::TTransportException->new(ref($self).': Could not write '.length($buf).' bytes '. $self->{host}.':'.$self->{host}, Thrift::TTransportException::END_OF_FILE); } @@ -314,7 +316,7 @@ sub __wait my @sockets = $self->{handle}->can_read( $self->{recvTimeout} / 1000 ); if (@sockets == 0) { - die new Thrift::TTransportException(ref($self).': timed out reading from '. + die Thrift::TTransportException->new(ref($self).': timed out reading from '. $self->{host}.':'.$self->{port}, Thrift::TTransportException::TIMED_OUT); } diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Transport.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Transport.pm index 10c8ce2..41b7e15 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Transport.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/Transport.pm @@ -54,7 +54,7 @@ use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); # sub isOpen { - die "abstract"; + die 'abstract'; } # @@ -64,7 +64,7 @@ sub isOpen # sub open { - die "abstract"; + die 'abstract'; } # @@ -72,7 +72,7 @@ sub open # sub close { - die "abstract"; + die 'abstract'; } # @@ -84,7 +84,7 @@ sub close # sub read { - die "abstract"; + die 'abstract'; } # @@ -116,7 +116,7 @@ sub readAll # sub write { - die "abstract"; + die 'abstract'; } # @@ -162,17 +162,17 @@ use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); sub listen { - die "abstract"; + die 'abstract'; } sub accept { - die "abstract"; + die 'abstract'; } sub close { - die "abstract"; + die 'abstract'; } diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/UnixServerSocket.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/UnixServerSocket.pm index 7b857ce..875e804 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/UnixServerSocket.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/UnixServerSocket.pm @@ -37,8 +37,8 @@ use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); # If a single argument is given that is a hash: # @param[in] path unix domain socket file name # @param[in] queue the listen queue size (default is not specified is supplied by ServerSocket) -# @example my $serversock = new Thrift::UnixServerSocket($path); -# @example my $serversock = new Thrift::UnixServerSocket(path => "somepath", queue => 64); +# @example my $serversock = Thrift::UnixServerSocket->new($path); +# @example my $serversock = Thrift::UnixServerSocket->new(path => "somepath", queue => 64); # sub new { @@ -58,7 +58,7 @@ sub new sub __client { - return new Thrift::UnixSocket(); + return Thrift::UnixSocket->new(); } sub __listen @@ -75,7 +75,7 @@ sub __listen if ($self->{debug}) { $self->{debugHandler}->($error); } - die new Thrift::TTransportException($error, Thrift::TTransportException::NOT_OPEN); + die Thrift::TTransportException->new($error, Thrift::TTransportException::NOT_OPEN); }; return $sock; diff --git a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/UnixSocket.pm b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/UnixSocket.pm index 8b00450..ba386d1 100644 --- a/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/UnixSocket.pm +++ b/vendor/git.apache.org/thrift.git/lib/perl/lib/Thrift/UnixSocket.pm @@ -35,7 +35,7 @@ use version 0.77; our $VERSION = version->declare("$Thrift::VERSION"); # Takes a unix domain socket filename. # See Thrift::Socket for base class parameters. # @param[in] path path to unix socket file -# @example my $sock = new Thrift::UnixSocket($path); +# @example my $sock = Thrift::UnixSocket->new($path); # sub new { @@ -58,7 +58,7 @@ sub __open if ($self->{debug}) { $self->{debugHandler}->($error); } - die new Thrift::TTransportException($error, Thrift::TTransportException::NOT_OPEN); + die Thrift::TTransportException->new($error, Thrift::TTransportException::NOT_OPEN); }; return $sock; diff --git a/vendor/git.apache.org/thrift.git/lib/php/lib/Base/TBase.php b/vendor/git.apache.org/thrift.git/lib/php/lib/Base/TBase.php index f2c514a..c61b631 100644 --- a/vendor/git.apache.org/thrift.git/lib/php/lib/Base/TBase.php +++ b/vendor/git.apache.org/thrift.git/lib/php/lib/Base/TBase.php @@ -33,7 +33,7 @@ use Thrift\Type\TType; */ abstract class TBase { - static public $tmethod = array( + public static $tmethod = array( TType::BOOL => 'Bool', TType::BYTE => 'Byte', TType::I16 => 'I16', diff --git a/vendor/git.apache.org/thrift.git/lib/php/lib/Exception/TApplicationException.php b/vendor/git.apache.org/thrift.git/lib/php/lib/Exception/TApplicationException.php index 228add5..ebb6a6a 100644 --- a/vendor/git.apache.org/thrift.git/lib/php/lib/Exception/TApplicationException.php +++ b/vendor/git.apache.org/thrift.git/lib/php/lib/Exception/TApplicationException.php @@ -26,7 +26,7 @@ use Thrift\Type\TType; class TApplicationException extends TException { - static public $_TSPEC = + public static $_TSPEC = array(1 => array('var' => 'message', 'type' => TType::STRING), 2 => array('var' => 'code', diff --git a/vendor/git.apache.org/thrift.git/lib/php/lib/Exception/TException.php b/vendor/git.apache.org/thrift.git/lib/php/lib/Exception/TException.php index e9c7c71..7dbf832 100644 --- a/vendor/git.apache.org/thrift.git/lib/php/lib/Exception/TException.php +++ b/vendor/git.apache.org/thrift.git/lib/php/lib/Exception/TException.php @@ -56,7 +56,7 @@ class TException extends \Exception } } - static public $tmethod = array( + public static $tmethod = array( TType::BOOL => 'Bool', TType::BYTE => 'Byte', TType::I16 => 'I16', diff --git a/vendor/git.apache.org/thrift.git/lib/php/lib/Transport/TCurlClient.php b/vendor/git.apache.org/thrift.git/lib/php/lib/Transport/TCurlClient.php index 3d4908d..482b43b 100644 --- a/vendor/git.apache.org/thrift.git/lib/php/lib/Transport/TCurlClient.php +++ b/vendor/git.apache.org/thrift.git/lib/php/lib/Transport/TCurlClient.php @@ -169,6 +169,24 @@ class TCurlClient extends TTransport } } + /** + * Guarantees that the full amount of data is read. Since TCurlClient gets entire payload at + * once, parent readAll cannot be used. + * + * @return string The data, of exact length + * @throws TTransportException if cannot read data + */ + public function readAll($len) + { + $data = $this->read($len); + + if (TStringFuncFactory::create()->strlen($data) !== $len) { + throw new TTransportException('TCurlClient could not read '.$len.' bytes'); + } + + return $data; + } + /** * Writes some data into the pending buffer * diff --git a/vendor/git.apache.org/thrift.git/lib/php/lib/Transport/THttpClient.php b/vendor/git.apache.org/thrift.git/lib/php/lib/Transport/THttpClient.php index a89794b..0158809 100644 --- a/vendor/git.apache.org/thrift.git/lib/php/lib/Transport/THttpClient.php +++ b/vendor/git.apache.org/thrift.git/lib/php/lib/Transport/THttpClient.php @@ -88,14 +88,23 @@ class THttpClient extends TTransport */ protected $headers_; + /** + * Context additional options + * + * @var array + */ + protected $context_; + /** * Make a new HTTP client. * * @param string $host - * @param int $port + * @param int $port * @param string $uri + * @param string $scheme + * @param array $context */ - public function __construct($host, $port = 80, $uri = '', $scheme = 'http') + public function __construct($host, $port = 80, $uri = '', $scheme = 'http', array $context = array()) { if ((TStringFuncFactory::create()->strlen($uri) > 0) && ($uri{0} != '/')) { $uri = '/' . $uri; @@ -108,6 +117,7 @@ class THttpClient extends TTransport $this->handle_ = null; $this->timeout_ = null; $this->headers_ = array(); + $this->context_ = $context; } /** @@ -211,16 +221,21 @@ class THttpClient extends TTransport $headers[] = "$key: $value"; } - $options = array('method' => 'POST', + $options = $this->context_; + + $baseHttpOptions = isset($options["http"]) ? $options["http"] : array(); + + $httpOptions = $baseHttpOptions + array('method' => 'POST', 'header' => implode("\r\n", $headers), 'max_redirects' => 1, 'content' => $this->buf_); if ($this->timeout_ > 0) { - $options['timeout'] = $this->timeout_; + $httpOptions['timeout'] = $this->timeout_; } $this->buf_ = ''; - $contextid = stream_context_create(array('http' => $options)); + $options["http"] = $httpOptions; + $contextid = stream_context_create($options); $this->handle_ = @fopen( $this->scheme_ . '://' . $host . $this->uri_, 'r', diff --git a/vendor/git.apache.org/thrift.git/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp b/vendor/git.apache.org/thrift.git/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp index 5ac557f..63c8905 100644 --- a/vendor/git.apache.org/thrift.git/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp +++ b/vendor/git.apache.org/thrift.git/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp @@ -305,7 +305,7 @@ public: void skip(size_t len) { while (len) { - size_t chunk_size = std::min(len, buffer_used); + size_t chunk_size = (std::min)(len, buffer_used); if (chunk_size) { buffer_ptr = reinterpret_cast(buffer_ptr) + chunk_size; buffer_used -= chunk_size; @@ -318,7 +318,7 @@ public: void readBytes(void* buf, size_t len) { while (len) { - size_t chunk_size = std::min(len, buffer_used); + size_t chunk_size = (std::min)(len, buffer_used); if (chunk_size) { memcpy(buf, buffer_ptr, chunk_size); buffer_ptr = reinterpret_cast(buffer_ptr) + chunk_size; diff --git a/vendor/git.apache.org/thrift.git/lib/py/setup.py b/vendor/git.apache.org/thrift.git/lib/py/setup.py index 4c2877a..6ee28df 100644 --- a/vendor/git.apache.org/thrift.git/lib/py/setup.py +++ b/vendor/git.apache.org/thrift.git/lib/py/setup.py @@ -90,7 +90,7 @@ def run_setup(with_binary): twisted_deps = ['twisted'] setup(name='thrift', - version='1.0.0-dev', + version='0.12.0', description='Python bindings for the Apache Thrift RPC system', author='Thrift Developers', author_email='dev@thrift.apache.org', diff --git a/vendor/git.apache.org/thrift.git/lib/py/src/ext/protocol.h b/vendor/git.apache.org/thrift.git/lib/py/src/ext/protocol.h index 126dbc3..521b7ee 100644 --- a/vendor/git.apache.org/thrift.git/lib/py/src/ext/protocol.h +++ b/vendor/git.apache.org/thrift.git/lib/py/src/ext/protocol.h @@ -33,8 +33,8 @@ class ProtocolBase { public: ProtocolBase() - : stringLimit_(std::numeric_limits::max()), - containerLimit_(std::numeric_limits::max()), + : stringLimit_((std::numeric_limits::max)()), + containerLimit_((std::numeric_limits::max)()), output_(NULL) {} inline virtual ~ProtocolBase(); diff --git a/vendor/git.apache.org/thrift.git/lib/py/src/ext/protocol.tcc b/vendor/git.apache.org/thrift.git/lib/py/src/ext/protocol.tcc index c025d0c..e15df7e 100644 --- a/vendor/git.apache.org/thrift.git/lib/py/src/ext/protocol.tcc +++ b/vendor/git.apache.org/thrift.git/lib/py/src/ext/protocol.tcc @@ -144,7 +144,7 @@ inline int read_buffer(PyObject* buf, char** output, int len) { *output = PyBytes_AS_STRING(buf2->buf) + buf2->pos; #endif Py_ssize_t pos0 = buf2->pos; - buf2->pos = std::min(buf2->pos + static_cast(len), buf2->string_size); + buf2->pos = (std::min)(buf2->pos + static_cast(len), buf2->string_size); return static_cast(buf2->pos - pos0); } } @@ -212,7 +212,7 @@ inline bool check_ssize_t_32(Py_ssize_t len) { if (INT_CONV_ERROR_OCCURRED(len)) { return false; } - if (!CHECK_RANGE(len, 0, std::numeric_limits::max())) { + if (!CHECK_RANGE(len, 0, (std::numeric_limits::max)())) { PyErr_SetString(PyExc_OverflowError, "size out of range: exceeded INT32_MAX"); return false; } @@ -360,8 +360,8 @@ bool ProtocolBase::encodeValue(PyObject* value, TType type, PyObject* type case T_I08: { int8_t val; - if (!parse_pyint(value, &val, std::numeric_limits::min(), - std::numeric_limits::max())) { + if (!parse_pyint(value, &val, (std::numeric_limits::min)(), + (std::numeric_limits::max)())) { return false; } @@ -371,8 +371,8 @@ bool ProtocolBase::encodeValue(PyObject* value, TType type, PyObject* type case T_I16: { int16_t val; - if (!parse_pyint(value, &val, std::numeric_limits::min(), - std::numeric_limits::max())) { + if (!parse_pyint(value, &val, (std::numeric_limits::min)(), + (std::numeric_limits::max)())) { return false; } @@ -382,8 +382,8 @@ bool ProtocolBase::encodeValue(PyObject* value, TType type, PyObject* type case T_I32: { int32_t val; - if (!parse_pyint(value, &val, std::numeric_limits::min(), - std::numeric_limits::max())) { + if (!parse_pyint(value, &val, (std::numeric_limits::min)(), + (std::numeric_limits::max)())) { return false; } @@ -397,8 +397,8 @@ bool ProtocolBase::encodeValue(PyObject* value, TType type, PyObject* type return false; } - if (!CHECK_RANGE(nval, std::numeric_limits::min(), - std::numeric_limits::max())) { + if (!CHECK_RANGE(nval, (std::numeric_limits::min)(), + (std::numeric_limits::max)())) { PyErr_SetString(PyExc_OverflowError, "int out of range"); return false; } diff --git a/vendor/git.apache.org/thrift.git/lib/py/src/transport/TSocket.py b/vendor/git.apache.org/thrift.git/lib/py/src/transport/TSocket.py index c91de9d..a7d6617 100644 --- a/vendor/git.apache.org/thrift.git/lib/py/src/transport/TSocket.py +++ b/vendor/git.apache.org/thrift.git/lib/py/src/transport/TSocket.py @@ -159,6 +159,15 @@ class TServerSocket(TSocketBase, TServerTransportBase): self._unix_socket = unix_socket self._socket_family = socket_family self.handle = None + self._backlog = 128 + + def setBacklog(self, backlog=None): + if not self.handle: + self._backlog = backlog + else: + # We cann't update backlog when it is already listening, since the + # handle has been created. + logger.warn('You have to set backlog before listen.') def listen(self): res0 = self._resolveAddr() @@ -183,7 +192,7 @@ class TServerSocket(TSocketBase, TServerTransportBase): if hasattr(self.handle, 'settimeout'): self.handle.settimeout(None) self.handle.bind(res[4]) - self.handle.listen(128) + self.handle.listen(self._backlog) def accept(self): client, addr = self.handle.accept() diff --git a/vendor/git.apache.org/thrift.git/lib/rb/thrift.gemspec b/vendor/git.apache.org/thrift.git/lib/rb/thrift.gemspec index 0f96c3f..5a3a0ae 100644 --- a/vendor/git.apache.org/thrift.git/lib/rb/thrift.gemspec +++ b/vendor/git.apache.org/thrift.git/lib/rb/thrift.gemspec @@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__) Gem::Specification.new do |s| s.name = 'thrift' - s.version = '1.0.0.0' + s.version = '0.12.0' s.authors = ['Thrift Developers'] s.email = ['dev@thrift.apache.org'] s.homepage = 'http://thrift.apache.org' diff --git a/vendor/git.apache.org/thrift.git/lib/rs/Cargo.toml b/vendor/git.apache.org/thrift.git/lib/rs/Cargo.toml index f5844b4..e79198d 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/Cargo.toml +++ b/vendor/git.apache.org/thrift.git/lib/rs/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "thrift" description = "Rust bindings for the Apache Thrift RPC system" -version = "1.0.0" +version = "0.12.0" license = "Apache-2.0" authors = ["Apache Thrift Developers "] homepage = "http://thrift.apache.org" diff --git a/vendor/git.apache.org/thrift.git/lib/rs/README.md b/vendor/git.apache.org/thrift.git/lib/rs/README.md index 8b35eda..7c37a10 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/README.md +++ b/vendor/git.apache.org/thrift.git/lib/rs/README.md @@ -37,6 +37,57 @@ Thrift compiler you're using. Full [Rustdoc](https://docs.rs/thrift/) +## Compatibility + +The Rust library and auto-generated code targets Rust versions 1.28+. +It does not currently use any Rust 2018 features. + +### Breaking Changes + +Breaking changes are minimized. When they are made they will be outlined below with transition guidelines. + +##### Thrift 0.12.0 + +* **[THRIFT-4529]** - Rust enum variants are now camel-cased instead of uppercased to conform to Rust naming conventions + + Previously, enum variants were uppercased in the auto-generated code. + For example, the following thrift enum: + + ```thrift + // THRIFT + enum Operation { + ADD, + SUBTRACT, + MULTIPLY, + DIVIDE, + } + ``` + + used to generate: + + ```rust + // OLD AUTO-GENERATED RUST + pub enum Operation { + ADD, + SUBTRACT, + MULTIPLY, + DIVIDE, + } + ``` + It *now* generates: + ```rust + // NEW AUTO-GENERATED RUST + pub enum Operation { + Add, + Subtract, + Multiply, + Divide, + } + ``` + + You will have to change all enum variants in your code to use camel-cased names. + This should be a search and replace. + ## Contributing Bug reports and PRs are always welcome! Please see the diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/errors.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/errors.rs index cc0ac78..16a2576 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/errors.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/errors.rs @@ -198,8 +198,9 @@ impl Error { /// Create an `ApplicationError` from its wire representation. /// /// Application code **should never** call this method directly. - pub fn read_application_error_from_in_protocol(i: &mut TInputProtocol,) - -> ::Result { + pub fn read_application_error_from_in_protocol( + i: &mut TInputProtocol, + ) -> ::Result { let mut message = "general remote error".to_owned(); let mut kind = ApplicationErrorKind::Unknown; @@ -224,9 +225,8 @@ impl Error { } 2 => { let remote_type_as_int = i.read_i32()?; - let remote_kind: ApplicationErrorKind = - TryFrom::try_from(remote_type_as_int) - .unwrap_or(ApplicationErrorKind::Unknown); + let remote_kind: ApplicationErrorKind = TryFrom::try_from(remote_type_as_int) + .unwrap_or(ApplicationErrorKind::Unknown); i.read_field_end()?; kind = remote_kind; } @@ -238,12 +238,10 @@ impl Error { i.read_struct_end()?; - Ok( - ApplicationError { - kind: kind, - message: message, - }, - ) + Ok(ApplicationError { + kind: kind, + message: message, + }) } /// Convert an `ApplicationError` into its wire representation and write @@ -254,7 +252,9 @@ impl Error { e: &ApplicationError, o: &mut TOutputProtocol, ) -> ::Result<()> { - o.write_struct_begin(&TStructIdentifier { name: "TApplicationException".to_owned() },)?; + o.write_struct_begin(&TStructIdentifier { + name: "TApplicationException".to_owned(), + })?; let message_field = TFieldIdentifier::new("message", TType::String, 1); let type_field = TFieldIdentifier::new("type", TType::I32, 2); @@ -309,23 +309,19 @@ impl Display for Error { impl From for Error { fn from(s: String) -> Self { - Error::Application( - ApplicationError { - kind: ApplicationErrorKind::Unknown, - message: s, - }, - ) + Error::Application(ApplicationError { + kind: ApplicationErrorKind::Unknown, + message: s, + }) } } impl<'a> From<&'a str> for Error { fn from(s: &'a str) -> Self { - Error::Application( - ApplicationError { - kind: ApplicationErrorKind::Unknown, - message: String::from(s), - }, - ) + Error::Application(ApplicationError { + kind: ApplicationErrorKind::Unknown, + message: String::from(s), + }) } } @@ -427,16 +423,10 @@ impl TryFrom for TransportErrorKind { 4 => Ok(TransportErrorKind::EndOfFile), 5 => Ok(TransportErrorKind::NegativeSize), 6 => Ok(TransportErrorKind::SizeLimit), - _ => { - Err( - Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::Unknown, - message: format!("cannot convert {} to TransportErrorKind", from), - }, - ), - ) - } + _ => Err(Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::Unknown, + message: format!("cannot convert {} to TransportErrorKind", from), + })), } } } @@ -444,47 +434,29 @@ impl TryFrom for TransportErrorKind { impl From for Error { fn from(err: io::Error) -> Self { match err.kind() { - io::ErrorKind::ConnectionReset | - io::ErrorKind::ConnectionRefused | - io::ErrorKind::NotConnected => { - Error::Transport( - TransportError { - kind: TransportErrorKind::NotOpen, - message: err.description().to_owned(), - }, - ) - } - io::ErrorKind::AlreadyExists => { - Error::Transport( - TransportError { - kind: TransportErrorKind::AlreadyOpen, - message: err.description().to_owned(), - }, - ) - } - io::ErrorKind::TimedOut => { - Error::Transport( - TransportError { - kind: TransportErrorKind::TimedOut, - message: err.description().to_owned(), - }, - ) - } - io::ErrorKind::UnexpectedEof => { - Error::Transport( - TransportError { - kind: TransportErrorKind::EndOfFile, - message: err.description().to_owned(), - }, - ) - } + io::ErrorKind::ConnectionReset + | io::ErrorKind::ConnectionRefused + | io::ErrorKind::NotConnected => Error::Transport(TransportError { + kind: TransportErrorKind::NotOpen, + message: err.description().to_owned(), + }), + io::ErrorKind::AlreadyExists => Error::Transport(TransportError { + kind: TransportErrorKind::AlreadyOpen, + message: err.description().to_owned(), + }), + io::ErrorKind::TimedOut => Error::Transport(TransportError { + kind: TransportErrorKind::TimedOut, + message: err.description().to_owned(), + }), + io::ErrorKind::UnexpectedEof => Error::Transport(TransportError { + kind: TransportErrorKind::EndOfFile, + message: err.description().to_owned(), + }), _ => { - Error::Transport( - TransportError { - kind: TransportErrorKind::Unknown, - message: err.description().to_owned(), // FIXME: use io error's debug string - }, - ) + Error::Transport(TransportError { + kind: TransportErrorKind::Unknown, + message: err.description().to_owned(), // FIXME: use io error's debug string + }) } } } @@ -492,12 +464,10 @@ impl From for Error { impl From for Error { fn from(err: string::FromUtf8Error) -> Self { - Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::InvalidData, - message: err.description().to_owned(), // FIXME: use fmt::Error's debug string - }, - ) + Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::InvalidData, + message: err.description().to_owned(), // FIXME: use fmt::Error's debug string + }) } } @@ -583,16 +553,10 @@ impl TryFrom for ProtocolErrorKind { 4 => Ok(ProtocolErrorKind::BadVersion), 5 => Ok(ProtocolErrorKind::NotImplemented), 6 => Ok(ProtocolErrorKind::DepthLimit), - _ => { - Err( - Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::Unknown, - message: format!("cannot convert {} to ProtocolErrorKind", from), - }, - ), - ) - } + _ => Err(Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::Unknown, + message: format!("cannot convert {} to ProtocolErrorKind", from), + })), } } } @@ -697,16 +661,10 @@ impl TryFrom for ApplicationErrorKind { 8 => Ok(ApplicationErrorKind::InvalidTransform), 9 => Ok(ApplicationErrorKind::InvalidProtocol), 10 => Ok(ApplicationErrorKind::UnsupportedClientType), - _ => { - Err( - Error::Application( - ApplicationError { - kind: ApplicationErrorKind::Unknown, - message: format!("cannot convert {} to ApplicationErrorKind", from), - }, - ), - ) - } + _ => Err(Error::Application(ApplicationError { + kind: ApplicationErrorKind::Unknown, + message: format!("cannot convert {} to ApplicationErrorKind", from), + })), } } } diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/lib.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/lib.rs index 7ebb10c..ca5c7d6 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/lib.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/lib.rs @@ -63,13 +63,11 @@ extern crate log; /// return the value contained in the result, i.e. `expr.unwrap()`. #[cfg(test)] macro_rules! assert_success { - ($e: expr) => { - { - let res = $e; - assert!(res.is_ok()); - res.unwrap() - } - } + ($e: expr) => {{ + let res = $e; + assert!(res.is_ok()); + res.unwrap() + }}; } pub mod protocol; diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/binary.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/binary.rs index 8505b63..19aff3d 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/binary.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/binary.rs @@ -19,11 +19,13 @@ use byteorder::{BigEndian, ByteOrder, ReadBytesExt, WriteBytesExt}; use std::convert::From; use try_from::TryFrom; -use {ProtocolError, ProtocolErrorKind}; -use transport::{TReadTransport, TWriteTransport}; -use super::{TFieldIdentifier, TInputProtocol, TInputProtocolFactory, TListIdentifier, - TMapIdentifier, TMessageIdentifier, TMessageType}; +use super::{ + TFieldIdentifier, TInputProtocol, TInputProtocolFactory, TListIdentifier, TMapIdentifier, + TMessageIdentifier, TMessageType, +}; use super::{TOutputProtocol, TOutputProtocolFactory, TSetIdentifier, TStructIdentifier, TType}; +use transport::{TReadTransport, TWriteTransport}; +use {ProtocolError, ProtocolErrorKind}; const BINARY_PROTOCOL_VERSION_1: u32 = 0x80010000; @@ -90,14 +92,10 @@ where // apparently we got a protocol-version header - check // it, and if it matches, read the rest of the fields if first_bytes[0..2] != [0x80, 0x01] { - Err( - ::Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::BadVersion, - message: format!("received bad version: {:?}", &first_bytes[0..2]), - }, - ), - ) + Err(::Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::BadVersion, + message: format!("received bad version: {:?}", &first_bytes[0..2]), + })) } else { let message_type: TMessageType = TryFrom::try_from(first_bytes[3])?; let name = self.read_string()?; @@ -110,20 +108,16 @@ where if self.strict { // we're in strict mode however, and that always // requires the protocol-version header to be written first - Err( - ::Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::BadVersion, - message: format!("received bad version: {:?}", &first_bytes[0..2]), - }, - ), - ) + Err(::Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::BadVersion, + message: format!("received bad version: {:?}", &first_bytes[0..2]), + })) } else { // in the non-strict version the first message field // is the message name. strings (byte arrays) are length-prefixed, // so we've just read the length in the first 4 bytes let name_size = BigEndian::read_i32(&first_bytes) as usize; - let mut name_buf: Vec = Vec::with_capacity(name_size); + let mut name_buf: Vec = vec![0; name_size]; self.transport.read_exact(&mut name_buf)?; let name = String::from_utf8(name_buf)?; @@ -154,7 +148,9 @@ where TType::Stop => Ok(0), _ => self.read_i16(), }?; - Ok(TFieldIdentifier::new::, String, i16>(None, field_type, id),) + Ok(TFieldIdentifier::new::, String, i16>( + None, field_type, id, + )) } fn read_field_end(&mut self) -> ::Result<()> { @@ -183,27 +179,19 @@ where } fn read_i16(&mut self) -> ::Result { - self.transport - .read_i16::() - .map_err(From::from) + self.transport.read_i16::().map_err(From::from) } fn read_i32(&mut self) -> ::Result { - self.transport - .read_i32::() - .map_err(From::from) + self.transport.read_i32::().map_err(From::from) } fn read_i64(&mut self) -> ::Result { - self.transport - .read_i64::() - .map_err(From::from) + self.transport.read_i64::().map_err(From::from) } fn read_double(&mut self) -> ::Result { - self.transport - .read_f64::() - .map_err(From::from) + self.transport.read_f64::().map_err(From::from) } fn read_string(&mut self) -> ::Result { @@ -346,17 +334,13 @@ where fn write_field_begin(&mut self, identifier: &TFieldIdentifier) -> ::Result<()> { if identifier.id.is_none() && identifier.field_type != TType::Stop { - return Err( - ::Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::Unknown, - message: format!( - "cannot write identifier {:?} without sequence number", - &identifier - ), - }, + return Err(::Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::Unknown, + message: format!( + "cannot write identifier {:?} without sequence number", + &identifier ), - ); + })); } self.write_byte(field_type_to_u8(identifier.field_type))?; @@ -393,27 +377,19 @@ where } fn write_i16(&mut self, i: i16) -> ::Result<()> { - self.transport - .write_i16::(i) - .map_err(From::from) + self.transport.write_i16::(i).map_err(From::from) } fn write_i32(&mut self, i: i32) -> ::Result<()> { - self.transport - .write_i32::(i) - .map_err(From::from) + self.transport.write_i32::(i).map_err(From::from) } fn write_i64(&mut self, i: i64) -> ::Result<()> { - self.transport - .write_i64::(i) - .map_err(From::from) + self.transport.write_i64::(i).map_err(From::from) } fn write_double(&mut self, d: f64) -> ::Result<()> { - self.transport - .write_f64::(d) - .map_err(From::from) + self.transport.write_f64::(d).map_err(From::from) } fn write_string(&mut self, s: &str) -> ::Result<()> { @@ -520,36 +496,32 @@ fn field_type_from_u8(b: u8) -> ::Result { 0x0F => Ok(TType::List), 0x10 => Ok(TType::Utf8), 0x11 => Ok(TType::Utf16), - unkn => { - Err( - ::Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::InvalidData, - message: format!("cannot convert {} to TType", unkn), - }, - ), - ) - } + unkn => Err(::Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::InvalidData, + message: format!("cannot convert {} to TType", unkn), + })), } } #[cfg(test)] mod tests { - use protocol::{TFieldIdentifier, TInputProtocol, TListIdentifier, TMapIdentifier, - TMessageIdentifier, TMessageType, TOutputProtocol, TSetIdentifier, - TStructIdentifier, TType}; + use protocol::{ + TFieldIdentifier, TInputProtocol, TListIdentifier, TMapIdentifier, TMessageIdentifier, + TMessageType, TOutputProtocol, TSetIdentifier, TStructIdentifier, TType, + }; use transport::{ReadHalf, TBufferChannel, TIoChannel, WriteHalf}; use super::*; #[test] - fn must_write_message_call_begin() { - let (_, mut o_prot) = test_objects(); + fn must_write_strict_message_call_begin() { + let (_, mut o_prot) = test_objects(true); let ident = TMessageIdentifier::new("test", TMessageType::Call, 1); assert!(o_prot.write_message_begin(&ident).is_ok()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 16] = [ 0x80, 0x01, @@ -573,12 +545,40 @@ mod tests { } #[test] - fn must_write_message_reply_begin() { - let (_, mut o_prot) = test_objects(); + fn must_write_non_strict_message_call_begin() { + let (_, mut o_prot) = test_objects(false); + + let ident = TMessageIdentifier::new("test", TMessageType::Call, 1); + assert!(o_prot.write_message_begin(&ident).is_ok()); + + #[cfg_attr(rustfmt, rustfmt::skip)] + let expected: [u8; 13] = [ + 0x00, + 0x00, + 0x00, + 0x04, + 0x74, + 0x65, + 0x73, + 0x74, + 0x01, + 0x00, + 0x00, + 0x00, + 0x01, + ]; + + assert_eq_written_bytes!(o_prot, expected); + } + + #[test] + fn must_write_strict_message_reply_begin() { + let (_, mut o_prot) = test_objects(true); let ident = TMessageIdentifier::new("test", TMessageType::Reply, 10); assert!(o_prot.write_message_begin(&ident).is_ok()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 16] = [ 0x80, 0x01, @@ -601,9 +601,49 @@ mod tests { assert_eq_written_bytes!(o_prot, expected); } + #[test] + fn must_write_non_strict_message_reply_begin() { + let (_, mut o_prot) = test_objects(false); + + let ident = TMessageIdentifier::new("test", TMessageType::Reply, 10); + assert!(o_prot.write_message_begin(&ident).is_ok()); + + #[cfg_attr(rustfmt, rustfmt::skip)] + let expected: [u8; 13] = [ + 0x00, + 0x00, + 0x00, + 0x04, + 0x74, + 0x65, + 0x73, + 0x74, + 0x02, + 0x00, + 0x00, + 0x00, + 0x0A, + ]; + + assert_eq_written_bytes!(o_prot, expected); + } + #[test] fn must_round_trip_strict_message_begin() { - let (mut i_prot, mut o_prot) = test_objects(); + let (mut i_prot, mut o_prot) = test_objects(true); + + let sent_ident = TMessageIdentifier::new("test", TMessageType::Call, 1); + assert!(o_prot.write_message_begin(&sent_ident).is_ok()); + + copy_write_buffer_to_read_buffer!(o_prot); + + let received_ident = assert_success!(i_prot.read_message_begin()); + assert_eq!(&received_ident, &sent_ident); + } + + #[test] + fn must_round_trip_non_strict_message_begin() { + let (mut i_prot, mut o_prot) = test_objects(false); let sent_ident = TMessageIdentifier::new("test", TMessageType::Call, 1); assert!(o_prot.write_message_begin(&sent_ident).is_ok()); @@ -616,28 +656,29 @@ mod tests { #[test] fn must_write_message_end() { - assert_no_write(|o| o.write_message_end()); + assert_no_write(|o| o.write_message_end(), true); } #[test] fn must_write_struct_begin() { - assert_no_write(|o| o.write_struct_begin(&TStructIdentifier::new("foo"))); + assert_no_write( + |o| o.write_struct_begin(&TStructIdentifier::new("foo")), + true, + ); } #[test] fn must_write_struct_end() { - assert_no_write(|o| o.write_struct_end()); + assert_no_write(|o| o.write_struct_end(), true); } #[test] fn must_write_field_begin() { - let (_, mut o_prot) = test_objects(); + let (_, mut o_prot) = test_objects(true); - assert!( - o_prot - .write_field_begin(&TFieldIdentifier::new("some_field", TType::String, 22)) - .is_ok() - ); + assert!(o_prot + .write_field_begin(&TFieldIdentifier::new("some_field", TType::String, 22)) + .is_ok()); let expected: [u8; 3] = [0x0B, 0x00, 0x16]; assert_eq_written_bytes!(o_prot, expected); @@ -645,7 +686,7 @@ mod tests { #[test] fn must_round_trip_field_begin() { - let (mut i_prot, mut o_prot) = test_objects(); + let (mut i_prot, mut o_prot) = test_objects(true); let sent_field_ident = TFieldIdentifier::new("foo", TType::I64, 20); assert!(o_prot.write_field_begin(&sent_field_ident).is_ok()); @@ -663,7 +704,7 @@ mod tests { #[test] fn must_write_stop_field() { - let (_, mut o_prot) = test_objects(); + let (_, mut o_prot) = test_objects(true); assert!(o_prot.write_field_stop().is_ok()); @@ -673,7 +714,7 @@ mod tests { #[test] fn must_round_trip_field_stop() { - let (mut i_prot, mut o_prot) = test_objects(); + let (mut i_prot, mut o_prot) = test_objects(true); assert!(o_prot.write_field_stop().is_ok()); @@ -691,18 +732,16 @@ mod tests { #[test] fn must_write_field_end() { - assert_no_write(|o| o.write_field_end()); + assert_no_write(|o| o.write_field_end(), true); } #[test] fn must_write_list_begin() { - let (_, mut o_prot) = test_objects(); + let (_, mut o_prot) = test_objects(true); - assert!( - o_prot - .write_list_begin(&TListIdentifier::new(TType::Bool, 5)) - .is_ok() - ); + assert!(o_prot + .write_list_begin(&TListIdentifier::new(TType::Bool, 5)) + .is_ok()); let expected: [u8; 5] = [0x02, 0x00, 0x00, 0x00, 0x05]; assert_eq_written_bytes!(o_prot, expected); @@ -710,7 +749,7 @@ mod tests { #[test] fn must_round_trip_list_begin() { - let (mut i_prot, mut o_prot) = test_objects(); + let (mut i_prot, mut o_prot) = test_objects(true); let ident = TListIdentifier::new(TType::List, 900); assert!(o_prot.write_list_begin(&ident).is_ok()); @@ -723,18 +762,16 @@ mod tests { #[test] fn must_write_list_end() { - assert_no_write(|o| o.write_list_end()); + assert_no_write(|o| o.write_list_end(), true); } #[test] fn must_write_set_begin() { - let (_, mut o_prot) = test_objects(); + let (_, mut o_prot) = test_objects(true); - assert!( - o_prot - .write_set_begin(&TSetIdentifier::new(TType::I16, 7)) - .is_ok() - ); + assert!(o_prot + .write_set_begin(&TSetIdentifier::new(TType::I16, 7)) + .is_ok()); let expected: [u8; 5] = [0x06, 0x00, 0x00, 0x00, 0x07]; assert_eq_written_bytes!(o_prot, expected); @@ -742,7 +779,7 @@ mod tests { #[test] fn must_round_trip_set_begin() { - let (mut i_prot, mut o_prot) = test_objects(); + let (mut i_prot, mut o_prot) = test_objects(true); let ident = TSetIdentifier::new(TType::I64, 2000); assert!(o_prot.write_set_begin(&ident).is_ok()); @@ -756,18 +793,16 @@ mod tests { #[test] fn must_write_set_end() { - assert_no_write(|o| o.write_set_end()); + assert_no_write(|o| o.write_set_end(), true); } #[test] fn must_write_map_begin() { - let (_, mut o_prot) = test_objects(); + let (_, mut o_prot) = test_objects(true); - assert!( - o_prot - .write_map_begin(&TMapIdentifier::new(TType::I64, TType::Struct, 32)) - .is_ok() - ); + assert!(o_prot + .write_map_begin(&TMapIdentifier::new(TType::I64, TType::Struct, 32)) + .is_ok()); let expected: [u8; 6] = [0x0A, 0x0C, 0x00, 0x00, 0x00, 0x20]; assert_eq_written_bytes!(o_prot, expected); @@ -775,7 +810,7 @@ mod tests { #[test] fn must_round_trip_map_begin() { - let (mut i_prot, mut o_prot) = test_objects(); + let (mut i_prot, mut o_prot) = test_objects(true); let ident = TMapIdentifier::new(TType::Map, TType::Set, 100); assert!(o_prot.write_map_begin(&ident).is_ok()); @@ -788,12 +823,12 @@ mod tests { #[test] fn must_write_map_end() { - assert_no_write(|o| o.write_map_end()); + assert_no_write(|o| o.write_map_end(), true); } #[test] fn must_write_bool_true() { - let (_, mut o_prot) = test_objects(); + let (_, mut o_prot) = test_objects(true); assert!(o_prot.write_bool(true).is_ok()); @@ -803,7 +838,7 @@ mod tests { #[test] fn must_write_bool_false() { - let (_, mut o_prot) = test_objects(); + let (_, mut o_prot) = test_objects(true); assert!(o_prot.write_bool(false).is_ok()); @@ -813,7 +848,7 @@ mod tests { #[test] fn must_read_bool_true() { - let (mut i_prot, _) = test_objects(); + let (mut i_prot, _) = test_objects(true); set_readable_bytes!(i_prot, &[0x01]); @@ -823,7 +858,7 @@ mod tests { #[test] fn must_read_bool_false() { - let (mut i_prot, _) = test_objects(); + let (mut i_prot, _) = test_objects(true); set_readable_bytes!(i_prot, &[0x00]); @@ -833,7 +868,7 @@ mod tests { #[test] fn must_allow_any_non_zero_value_to_be_interpreted_as_bool_true() { - let (mut i_prot, _) = test_objects(); + let (mut i_prot, _) = test_objects(true); set_readable_bytes!(i_prot, &[0xAC]); @@ -843,7 +878,7 @@ mod tests { #[test] fn must_write_bytes() { - let (_, mut o_prot) = test_objects(); + let (_, mut o_prot) = test_objects(true); let bytes: [u8; 10] = [0x0A, 0xCC, 0xD1, 0x84, 0x99, 0x12, 0xAB, 0xBB, 0x45, 0xDF]; @@ -856,8 +891,9 @@ mod tests { #[test] fn must_round_trip_bytes() { - let (mut i_prot, mut o_prot) = test_objects(); + let (mut i_prot, mut o_prot) = test_objects(true); + #[cfg_attr(rustfmt, rustfmt::skip)] let bytes: [u8; 25] = [ 0x20, 0xFD, @@ -894,25 +930,27 @@ mod tests { assert_eq!(&received_bytes, &bytes); } - fn test_objects() - -> (TBinaryInputProtocol>, - TBinaryOutputProtocol>) - { + fn test_objects( + strict: bool, + ) -> ( + TBinaryInputProtocol>, + TBinaryOutputProtocol>, + ) { let mem = TBufferChannel::with_capacity(40, 40); let (r_mem, w_mem) = mem.split().unwrap(); - let i_prot = TBinaryInputProtocol::new(r_mem, true); - let o_prot = TBinaryOutputProtocol::new(w_mem, true); + let i_prot = TBinaryInputProtocol::new(r_mem, strict); + let o_prot = TBinaryOutputProtocol::new(w_mem, strict); (i_prot, o_prot) } - fn assert_no_write(mut write_fn: F) + fn assert_no_write(mut write_fn: F, strict: bool) where F: FnMut(&mut TBinaryOutputProtocol>) -> ::Result<()>, { - let (_, mut o_prot) = test_objects(); + let (_, mut o_prot) = test_objects(strict); assert!(write_fn(&mut o_prot).is_ok()); assert_eq!(o_prot.transport.write_bytes().len(), 0); } diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/compact.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/compact.rs index 1e67f49..df5edaa 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/compact.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/compact.rs @@ -18,13 +18,15 @@ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use integer_encoding::{VarIntReader, VarIntWriter}; use std::convert::From; -use try_from::TryFrom; use std::io; +use try_from::TryFrom; -use transport::{TReadTransport, TWriteTransport}; -use super::{TFieldIdentifier, TInputProtocol, TInputProtocolFactory, TListIdentifier, - TMapIdentifier, TMessageIdentifier, TMessageType}; +use super::{ + TFieldIdentifier, TInputProtocol, TInputProtocolFactory, TListIdentifier, TMapIdentifier, + TMessageIdentifier, TMessageType, +}; use super::{TOutputProtocol, TOutputProtocolFactory, TSetIdentifier, TStructIdentifier, TType}; +use transport::{TReadTransport, TWriteTransport}; const COMPACT_PROTOCOL_ID: u8 = 0x82; const COMPACT_VERSION: u8 = 0x01; @@ -103,14 +105,10 @@ where fn read_message_begin(&mut self) -> ::Result { let compact_id = self.read_byte()?; if compact_id != COMPACT_PROTOCOL_ID { - Err( - ::Error::Protocol( - ::ProtocolError { - kind: ::ProtocolErrorKind::BadVersion, - message: format!("invalid compact protocol header {:?}", compact_id), - }, - ), - ) + Err(::Error::Protocol(::ProtocolError { + kind: ::ProtocolErrorKind::BadVersion, + message: format!("invalid compact protocol header {:?}", compact_id), + })) } else { Ok(()) }?; @@ -118,17 +116,13 @@ where let type_and_byte = self.read_byte()?; let received_version = type_and_byte & COMPACT_VERSION_MASK; if received_version != COMPACT_VERSION { - Err( - ::Error::Protocol( - ::ProtocolError { - kind: ::ProtocolErrorKind::BadVersion, - message: format!( - "cannot process compact protocol version {:?}", - received_version - ), - }, + Err(::Error::Protocol(::ProtocolError { + kind: ::ProtocolErrorKind::BadVersion, + message: format!( + "cannot process compact protocol version {:?}", + received_version ), - ) + })) } else { Ok(()) }?; @@ -140,7 +134,11 @@ where self.last_read_field_id = 0; - Ok(TMessageIdentifier::new(service_call_name, message_type, sequence_number),) + Ok(TMessageIdentifier::new( + service_call_name, + message_type, + sequence_number, + )) } fn read_message_end(&mut self) -> ::Result<()> { @@ -154,7 +152,8 @@ where } fn read_struct_end(&mut self) -> ::Result<()> { - self.last_read_field_id = self.read_field_id_stack + self.last_read_field_id = self + .read_field_id_stack .pop() .expect("should have previous field ids"); Ok(()) @@ -179,15 +178,13 @@ where }?; match field_type { - TType::Stop => { - Ok( - TFieldIdentifier::new::, String, Option>( - None, - TType::Stop, - None, - ), - ) - } + TType::Stop => Ok( + TFieldIdentifier::new::, String, Option>( + None, + TType::Stop, + None, + ), + ), _ => { if field_delta != 0 { self.last_read_field_id += field_delta as i16; @@ -195,13 +192,11 @@ where self.last_read_field_id = self.read_i16()?; }; - Ok( - TFieldIdentifier { - name: None, - field_type: field_type, - id: Some(self.last_read_field_id), - }, - ) + Ok(TFieldIdentifier { + name: None, + field_type: field_type, + id: Some(self.last_read_field_id), + }) } } } @@ -218,16 +213,10 @@ where match b { 0x01 => Ok(true), 0x02 => Ok(false), - unkn => { - Err( - ::Error::Protocol( - ::ProtocolError { - kind: ::ProtocolErrorKind::InvalidData, - message: format!("cannot convert {} into bool", unkn), - }, - ), - ) - } + unkn => Err(::Error::Protocol(::ProtocolError { + kind: ::ProtocolErrorKind::InvalidData, + message: format!("cannot convert {} into bool", unkn), + })), } } } @@ -259,9 +248,7 @@ where } fn read_double(&mut self) -> ::Result { - self.transport - .read_f64::() - .map_err(From::from) + self.transport.read_f64::().map_err(From::from) } fn read_string(&mut self) -> ::Result { @@ -315,7 +302,6 @@ where } } - impl io::Seek for TCompactInputProtocol where T: io::Seek + TReadTransport, @@ -450,7 +436,8 @@ where fn write_struct_end(&mut self) -> ::Result<()> { self.assert_no_pending_bool_write(); - self.last_write_field_id = self.write_field_id_stack + self.last_write_field_id = self + .write_field_id_stack .pop() .expect("should have previous field ids"); Ok(()) @@ -462,7 +449,7 @@ where if self.pending_write_bool_field_identifier.is_some() { panic!( "should not have a pending bool while writing another bool with id: \ - {:?}", + {:?}", identifier ) } @@ -471,9 +458,7 @@ where } _ => { let field_type = type_to_u8(identifier.field_type); - let field_id = identifier - .id - .expect("non-stop field should have field id"); + let field_id = identifier.id.expect("non-stop field should have field id"); self.write_field_header(field_type, field_id) } } @@ -537,9 +522,7 @@ where } fn write_double(&mut self, d: f64) -> ::Result<()> { - self.transport - .write_f64::(d) - .map_err(From::from) + self.transport.write_f64::(d).map_err(From::from) } fn write_string(&mut self, s: &str) -> ::Result<()> { @@ -595,10 +578,7 @@ where // fn write_byte(&mut self, b: u8) -> ::Result<()> { - self.transport - .write(&[b]) - .map_err(From::from) - .map(|_| ()) + self.transport.write(&[b]).map_err(From::from).map(|_| ()) } } @@ -639,7 +619,10 @@ fn type_to_u8(field_type: TType) -> u8 { TType::Set => 0x0A, TType::Map => 0x0B, TType::Struct => 0x0C, - _ => panic!(format!("should not have attempted to convert {} to u8", field_type)), + _ => panic!(format!( + "should not have attempted to convert {} to u8", + field_type + )), } } @@ -663,25 +646,20 @@ fn u8_to_type(b: u8) -> ::Result { 0x0A => Ok(TType::Set), 0x0B => Ok(TType::Map), 0x0C => Ok(TType::Struct), - unkn => { - Err( - ::Error::Protocol( - ::ProtocolError { - kind: ::ProtocolErrorKind::InvalidData, - message: format!("cannot convert {} into TType", unkn), - }, - ), - ) - } + unkn => Err(::Error::Protocol(::ProtocolError { + kind: ::ProtocolErrorKind::InvalidData, + message: format!("cannot convert {} into TType", unkn), + })), } } #[cfg(test)] mod tests { - use protocol::{TFieldIdentifier, TInputProtocol, TListIdentifier, TMapIdentifier, - TMessageIdentifier, TMessageType, TOutputProtocol, TSetIdentifier, - TStructIdentifier, TType}; + use protocol::{ + TFieldIdentifier, TInputProtocol, TListIdentifier, TMapIdentifier, TMessageIdentifier, + TMessageType, TOutputProtocol, TSetIdentifier, TStructIdentifier, TType, + }; use transport::{ReadHalf, TBufferChannel, TIoChannel, WriteHalf}; use super::*; @@ -690,8 +668,13 @@ mod tests { fn must_write_message_begin_0() { let (_, mut o_prot) = test_objects(); - assert_success!(o_prot.write_message_begin(&TMessageIdentifier::new("foo", TMessageType::Call, 431))); + assert_success!(o_prot.write_message_begin(&TMessageIdentifier::new( + "foo", + TMessageType::Call, + 431 + ))); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 8] = [ 0x82, /* protocol ID */ 0x21, /* message type | protocol version */ @@ -710,10 +693,13 @@ mod tests { fn must_write_message_begin_1() { let (_, mut o_prot) = test_objects(); - assert_success!( - o_prot.write_message_begin(&TMessageIdentifier::new("bar", TMessageType::Reply, 991828)) - ); + assert_success!(o_prot.write_message_begin(&TMessageIdentifier::new( + "bar", + TMessageType::Reply, + 991828 + ))); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 9] = [ 0x82, /* protocol ID */ 0x41, /* message type | protocol version */ @@ -777,6 +763,7 @@ mod tests { assert_success!(o_prot.write_field_stop()); assert_success!(o_prot.write_struct_end()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 5] = [ 0x03, /* field type */ 0x00, /* first field id */ @@ -891,6 +878,7 @@ mod tests { assert_success!(o_prot.write_field_stop()); assert_success!(o_prot.write_struct_end()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 4] = [ 0x15, /* field delta (1) | field type */ 0x1A, /* field delta (1) | field type */ @@ -1003,6 +991,7 @@ mod tests { assert_success!(o_prot.write_field_stop()); assert_success!(o_prot.write_struct_end()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 8] = [ 0x05, /* field type */ 0x00, /* first field id */ @@ -1126,6 +1115,7 @@ mod tests { assert_success!(o_prot.write_field_stop()); assert_success!(o_prot.write_struct_end()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 10] = [ 0x16, /* field delta (1) | field type */ 0x85, /* field delta (8) | field type */ @@ -1290,6 +1280,7 @@ mod tests { assert_success!(o_prot.write_field_stop()); assert_success!(o_prot.write_struct_end()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 7] = [ 0x16, /* field delta (1) | field type */ 0x85, /* field delta (8) | field type */ @@ -1462,6 +1453,7 @@ mod tests { assert_success!(o_prot.write_field_stop()); assert_success!(o_prot.write_struct_end()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 7] = [ 0x16, /* field delta (1) | field type */ 0x85, /* field delta (8) | field type */ @@ -1634,6 +1626,7 @@ mod tests { assert_success!(o_prot.write_field_stop()); assert_success!(o_prot.write_struct_end()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 7] = [ 0x16, /* field delta (1) | field type */ 0x08, /* field type */ @@ -1803,6 +1796,7 @@ mod tests { assert_success!(o_prot.write_field_stop()); assert_success!(o_prot.write_struct_end()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 8] = [ 0x16, /* field delta (1) | field type */ 0x08, /* field type */ @@ -1968,6 +1962,7 @@ mod tests { assert_success!(o_prot.write_field_stop()); assert_success!(o_prot.write_struct_end()); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 7] = [ 0x11, /* field delta (1) | true */ 0x82, /* field delta (8) | false */ @@ -2158,8 +2153,7 @@ mod tests { let expected: [u8; 3] = [ 0xF9, /* 0xF0 | elem_type */ - 0x8F, - 0x4E /* size as varint */, + 0x8F, 0x4E, /* size as varint */ ]; assert_eq_written_bytes!(o_prot, expected); @@ -2217,9 +2211,7 @@ mod tests { let expected: [u8; 4] = [ 0xF7, /* 0xF0 | elem_type */ - 0xD3, - 0xBA, - 0x01 /* size as varint */, + 0xD3, 0xBA, 0x01, /* size as varint */ ]; assert_eq_written_bytes!(o_prot, expected); @@ -2267,10 +2259,10 @@ mod tests { assert_eq!( &res, &TMapIdentifier { - key_type: None, - value_type: None, - size: 0, - } + key_type: None, + value_type: None, + size: 0, + } ); } @@ -2278,12 +2270,15 @@ mod tests { fn must_write_map_begin() { let (_, mut o_prot) = test_objects(); - assert_success!(o_prot.write_map_begin(&TMapIdentifier::new(TType::Double, TType::String, 238))); + assert_success!(o_prot.write_map_begin(&TMapIdentifier::new( + TType::Double, + TType::String, + 238 + ))); let expected: [u8; 3] = [ - 0xEE, - 0x01, /* size as varint */ - 0x78 /* key type | val type */, + 0xEE, 0x01, /* size as varint */ + 0x78, /* key type | val type */ ]; assert_eq_written_bytes!(o_prot, expected); @@ -2321,7 +2316,7 @@ mod tests { 0x01, /* size as varint */ 0x11, /* key type | val type */ 0x01, /* key: true */ - 0x02 /* val: false */, + 0x02, /* val: false */ ]; assert_eq_written_bytes!(o_prot, expected); @@ -2366,10 +2361,10 @@ mod tests { assert!(i_prot.read_map_end().is_ok()); // will blow up if we try to read from empty buffer } - fn test_objects() - -> (TCompactInputProtocol>, - TCompactOutputProtocol>) - { + fn test_objects() -> ( + TCompactInputProtocol>, + TCompactOutputProtocol>, + ) { let mem = TBufferChannel::with_capacity(80, 80); let (r_mem, w_mem) = mem.split().unwrap(); diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/mod.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/mod.rs index 4f13914..11c0289 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/mod.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/mod.rs @@ -57,38 +57,34 @@ //! protocol.write_field_end().unwrap(); //! ``` +use std::convert::From; use std::fmt; use std::fmt::{Display, Formatter}; -use std::convert::From; use try_from::TryFrom; -use {ProtocolError, ProtocolErrorKind}; use transport::{TReadTransport, TWriteTransport}; +use {ProtocolError, ProtocolErrorKind}; #[cfg(test)] macro_rules! assert_eq_written_bytes { - ($o_prot:ident, $expected_bytes:ident) => { - { - assert_eq!($o_prot.transport.write_bytes(), &$expected_bytes); - } - }; + ($o_prot:ident, $expected_bytes:ident) => {{ + assert_eq!($o_prot.transport.write_bytes(), &$expected_bytes); + }}; } // FIXME: should take both read and write #[cfg(test)] macro_rules! copy_write_buffer_to_read_buffer { - ($o_prot:ident) => { - { - $o_prot.transport.copy_write_buffer_to_read_buffer(); - } - }; + ($o_prot:ident) => {{ + $o_prot.transport.copy_write_buffer_to_read_buffer(); + }}; } #[cfg(test)] macro_rules! set_readable_bytes { ($i_prot:ident, $bytes:expr) => { $i_prot.transport.set_readable_bytes($bytes); - } + }; } mod binary; @@ -96,10 +92,14 @@ mod compact; mod multiplexed; mod stored; -pub use self::binary::{TBinaryInputProtocol, TBinaryInputProtocolFactory, TBinaryOutputProtocol, - TBinaryOutputProtocolFactory}; -pub use self::compact::{TCompactInputProtocol, TCompactInputProtocolFactory, - TCompactOutputProtocol, TCompactOutputProtocolFactory}; +pub use self::binary::{ + TBinaryInputProtocol, TBinaryInputProtocolFactory, TBinaryOutputProtocol, + TBinaryOutputProtocolFactory, +}; +pub use self::compact::{ + TCompactInputProtocol, TCompactInputProtocolFactory, TCompactOutputProtocol, + TCompactOutputProtocolFactory, +}; pub use self::multiplexed::TMultiplexedOutputProtocol; pub use self::stored::TStoredInputProtocol; @@ -186,14 +186,10 @@ pub trait TInputProtocol { /// Skip a field with type `field_type` recursively up to `depth` levels. fn skip_till_depth(&mut self, field_type: TType, depth: i8) -> ::Result<()> { if depth == 0 { - return Err( - ::Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::DepthLimit, - message: format!("cannot parse past {:?}", field_type), - }, - ), - ); + return Err(::Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::DepthLimit, + message: format!("cannot parse past {:?}", field_type), + })); } match field_type { @@ -243,16 +239,10 @@ pub trait TInputProtocol { } self.read_map_end() } - u => { - Err( - ::Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::Unknown, - message: format!("cannot skip field type {:?}", &u), - }, - ), - ) - } + u => Err(::Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::Unknown, + message: format!("cannot skip field type {:?}", &u), + })), } } @@ -787,16 +777,10 @@ impl TryFrom for TMessageType { 0x02 => Ok(TMessageType::Reply), 0x03 => Ok(TMessageType::Exception), 0x04 => Ok(TMessageType::OneWay), - unkn => { - Err( - ::Error::Protocol( - ProtocolError { - kind: ProtocolErrorKind::InvalidData, - message: format!("cannot convert {} to TMessageType", unkn), - }, - ), - ) - } + unkn => Err(::Error::Protocol(ProtocolError { + kind: ProtocolErrorKind::InvalidData, + message: format!("cannot convert {} to TMessageType", unkn), + })), } } } @@ -869,14 +853,10 @@ pub fn verify_expected_sequence_number(expected: i32, actual: i32) -> ::Result<( if expected == actual { Ok(()) } else { - Err( - ::Error::Application( - ::ApplicationError { - kind: ::ApplicationErrorKind::BadSequenceId, - message: format!("expected {} got {}", expected, actual), - }, - ), - ) + Err(::Error::Application(::ApplicationError { + kind: ::ApplicationErrorKind::BadSequenceId, + message: format!("expected {} got {}", expected, actual), + })) } } @@ -888,14 +868,10 @@ pub fn verify_expected_service_call(expected: &str, actual: &str) -> ::Result<() if expected == actual { Ok(()) } else { - Err( - ::Error::Application( - ::ApplicationError { - kind: ::ApplicationErrorKind::WrongMethodName, - message: format!("expected {} got {}", expected, actual), - }, - ), - ) + Err(::Error::Application(::ApplicationError { + kind: ::ApplicationErrorKind::WrongMethodName, + message: format!("expected {} got {}", expected, actual), + })) } } @@ -907,14 +883,10 @@ pub fn verify_expected_message_type(expected: TMessageType, actual: TMessageType if expected == actual { Ok(()) } else { - Err( - ::Error::Application( - ::ApplicationError { - kind: ::ApplicationErrorKind::InvalidMessageType, - message: format!("expected {} got {}", expected, actual), - }, - ), - ) + Err(::Error::Application(::ApplicationError { + kind: ::ApplicationErrorKind::InvalidMessageType, + message: format!("expected {} got {}", expected, actual), + })) } } @@ -924,16 +896,10 @@ pub fn verify_expected_message_type(expected: TMessageType, actual: TMessageType pub fn verify_required_field_exists(field_name: &str, field: &Option) -> ::Result<()> { match *field { Some(_) => Ok(()), - None => { - Err( - ::Error::Protocol( - ::ProtocolError { - kind: ::ProtocolErrorKind::Unknown, - message: format!("missing required field {}", field_name), - }, - ), - ) - } + None => Err(::Error::Protocol(::ProtocolError { + kind: ::ProtocolErrorKind::Unknown, + message: format!("missing required field {}", field_name), + })), } } @@ -943,18 +909,12 @@ pub fn verify_required_field_exists(field_name: &str, field: &Option) -> : /// /// Return `TFieldIdentifier.id` if an id exists, `Err` otherwise. pub fn field_id(field_ident: &TFieldIdentifier) -> ::Result { - field_ident - .id - .ok_or_else( - || { - ::Error::Protocol( - ::ProtocolError { - kind: ::ProtocolErrorKind::Unknown, - message: format!("missing field in in {:?}", field_ident), - }, - ) - }, - ) + field_ident.id.ok_or_else(|| { + ::Error::Protocol(::ProtocolError { + kind: ::ProtocolErrorKind::Unknown, + message: format!("missing field in in {:?}", field_ident), + }) + }) } #[cfg(test)] diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/multiplexed.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/multiplexed.rs index db08027..aaee44f 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/multiplexed.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/multiplexed.rs @@ -15,8 +15,10 @@ // specific language governing permissions and limitations // under the License. -use super::{TFieldIdentifier, TListIdentifier, TMapIdentifier, TMessageIdentifier, TMessageType, - TOutputProtocol, TSetIdentifier, TStructIdentifier}; +use super::{ + TFieldIdentifier, TListIdentifier, TMapIdentifier, TMessageIdentifier, TMessageType, + TOutputProtocol, TSetIdentifier, TStructIdentifier, +}; /// `TOutputProtocol` that prefixes the service name to all outgoing Thrift /// messages. @@ -81,7 +83,8 @@ where P: TOutputProtocol, { fn write_message_begin(&mut self, identifier: &TMessageIdentifier) -> ::Result<()> { - match identifier.message_type { // FIXME: is there a better way to override identifier here? + match identifier.message_type { + // FIXME: is there a better way to override identifier here? TMessageType::Call | TMessageType::OneWay => { let identifier = TMessageIdentifier { name: format!("{}:{}", self.service_name, identifier.name), @@ -200,6 +203,7 @@ mod tests { let ident = TMessageIdentifier::new("bar", TMessageType::Call, 2); assert_success!(o_prot.write_message_begin(&ident)); + #[cfg_attr(rustfmt, rustfmt::skip)] let expected: [u8; 19] = [ 0x80, 0x01, /* protocol identifier */ @@ -225,9 +229,7 @@ mod tests { assert_eq!(o_prot.inner.transport.write_bytes(), expected); } - fn test_objects - () - -> TMultiplexedOutputProtocol>> + fn test_objects() -> TMultiplexedOutputProtocol>> { let c = TBufferChannel::with_capacity(40, 40); let (_, w_chan) = c.split().unwrap(); diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/stored.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/stored.rs index b3f305f..8c55978 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/stored.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/protocol/stored.rs @@ -17,9 +17,11 @@ use std::convert::Into; +use super::{ + TFieldIdentifier, TInputProtocol, TListIdentifier, TMapIdentifier, TMessageIdentifier, + TSetIdentifier, TStructIdentifier, +}; use ProtocolErrorKind; -use super::{TFieldIdentifier, TInputProtocol, TListIdentifier, TMapIdentifier, TMessageIdentifier, - TSetIdentifier, TStructIdentifier}; /// `TInputProtocol` required to use a `TMultiplexedProcessor`. /// @@ -101,16 +103,12 @@ impl<'a> TStoredInputProtocol<'a> { impl<'a> TInputProtocol for TStoredInputProtocol<'a> { fn read_message_begin(&mut self) -> ::Result { - self.message_ident - .take() - .ok_or_else( - || { - ::errors::new_protocol_error( - ProtocolErrorKind::Unknown, - "message identifier already read", - ) - }, + self.message_ident.take().ok_or_else(|| { + ::errors::new_protocol_error( + ProtocolErrorKind::Unknown, + "message identifier already read", ) + }) } fn read_message_end(&mut self) -> ::Result<()> { diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/server/mod.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/server/mod.rs index 3d8ccb2..70b381a 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/server/mod.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/server/mod.rs @@ -17,8 +17,8 @@ //! Types used to implement a Thrift server. -use {ApplicationError, ApplicationErrorKind}; use protocol::{TInputProtocol, TMessageIdentifier, TMessageType, TOutputProtocol}; +use {ApplicationError, ApplicationErrorKind}; mod multiplexed; mod threaded; diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/server/multiplexed.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/server/multiplexed.rs index a7f6d04..e433794 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/server/multiplexed.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/server/multiplexed.rs @@ -16,16 +16,17 @@ // under the License. use std::collections::HashMap; +use std::convert::Into; use std::fmt; use std::fmt::{Debug, Formatter}; -use std::convert::Into; use std::sync::{Arc, Mutex}; use protocol::{TInputProtocol, TMessageIdentifier, TOutputProtocol, TStoredInputProtocol}; -use super::{TProcessor, handle_process_result}; +use super::{handle_process_result, TProcessor}; -const MISSING_SEPARATOR_AND_NO_DEFAULT: &'static str = "missing service separator and no default processor set"; +const MISSING_SEPARATOR_AND_NO_DEFAULT: &'static str = + "missing service separator and no default processor set"; type ThreadSafeProcessor = Box; /// A `TProcessor` that can demux service calls to multiple underlying @@ -54,12 +55,10 @@ impl TMultiplexedProcessor { /// processors. pub fn new() -> TMultiplexedProcessor { TMultiplexedProcessor { - stored: Mutex::new( - StoredProcessors { - processors: HashMap::new(), - default_processor: None, - }, - ), + stored: Mutex::new(StoredProcessors { + processors: HashMap::new(), + default_processor: None, + }), } } @@ -97,7 +96,7 @@ impl TMultiplexedProcessor { Ok(()) } } else { - Err(format!("cannot overwrite existing processor for service {}", name).into(),) + Err(format!("cannot overwrite existing processor for service {}", name).into()) } } @@ -160,13 +159,11 @@ impl Debug for TMultiplexedProcessor { fn split_ident_name(ident_name: &str) -> (Option<&str>, &str) { ident_name .find(':') - .map( - |pos| { - let (svc_name, svc_call) = ident_name.split_at(pos); - let (_, svc_call) = svc_call.split_at(1); // remove colon from service call name - (Some(svc_name), svc_call) - }, - ) + .map(|pos| { + let (svc_name, svc_call) = ident_name.split_at(pos); + let (_, svc_call) = svc_call.split_at(1); // remove colon from service call name + (Some(svc_name), svc_call) + }) .or_else(|| Some((None, ident_name))) .unwrap() } @@ -181,12 +178,12 @@ fn missing_processor_message(svc_name: Option<&str>) -> String { #[cfg(test)] mod tests { use std::convert::Into; - use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; + use std::sync::Arc; - use {ApplicationError, ApplicationErrorKind}; use protocol::{TBinaryInputProtocol, TBinaryOutputProtocol, TMessageIdentifier, TMessageType}; use transport::{ReadHalf, TBufferChannel, TIoChannel, WriteHalf}; + use {ApplicationError, ApplicationErrorKind}; use super::*; @@ -219,8 +216,7 @@ mod tests { let p = TMultiplexedProcessor::new(); p.process(&mut i, &mut o).unwrap(); // at this point an error should be written out - i.transport - .set_readable_bytes(&o.transport.write_bytes()); + i.transport.set_readable_bytes(&o.transport.write_bytes()); let rcvd_ident = i.read_message_begin().unwrap(); let expected_ident = TMessageIdentifier::new("foo", TMessageType::Exception, 10); assert_eq!(rcvd_ident, expected_ident); @@ -245,8 +241,7 @@ mod tests { let p = TMultiplexedProcessor::new(); p.process(&mut i, &mut o).unwrap(); // at this point an error should be written out - i.transport - .set_readable_bytes(&o.transport.write_bytes()); + i.transport.set_readable_bytes(&o.transport.write_bytes()); let rcvd_ident = i.read_message_begin().unwrap(); let expected_ident = TMessageIdentifier::new("missing:call", TMessageType::Exception, 10); assert_eq!(rcvd_ident, expected_ident); @@ -265,7 +260,8 @@ mod tests { impl TProcessor for Service { fn process(&self, _: &mut TInputProtocol, _: &mut TOutputProtocol) -> ::Result<()> { - let res = self.invoked + let res = self + .invoked .compare_and_swap(false, true, Ordering::Relaxed); if res { Ok(()) @@ -280,9 +276,13 @@ mod tests { let (mut i, mut o) = build_objects(); // build the services - let svc_1 = Service { invoked: Arc::new(AtomicBool::new(false)) }; + let svc_1 = Service { + invoked: Arc::new(AtomicBool::new(false)), + }; let atm_1 = svc_1.invoked.clone(); - let svc_2 = Service { invoked: Arc::new(AtomicBool::new(false)) }; + let svc_2 = Service { + invoked: Arc::new(AtomicBool::new(false)), + }; let atm_2 = svc_2.invoked.clone(); // register them @@ -309,9 +309,13 @@ mod tests { let (mut i, mut o) = build_objects(); // build the services - let svc_1 = Service { invoked: Arc::new(AtomicBool::new(false)) }; + let svc_1 = Service { + invoked: Arc::new(AtomicBool::new(false)), + }; let atm_1 = svc_1.invoked.clone(); - let svc_2 = Service { invoked: Arc::new(AtomicBool::new(false)) }; + let svc_2 = Service { + invoked: Arc::new(AtomicBool::new(false)), + }; let atm_2 = svc_2.invoked.clone(); // register them @@ -333,12 +337,15 @@ mod tests { assert_eq!(atm_2.load(Ordering::Relaxed), true); } - fn build_objects() - -> (TBinaryInputProtocol>, - TBinaryOutputProtocol>) - { + fn build_objects() -> ( + TBinaryInputProtocol>, + TBinaryOutputProtocol>, + ) { let c = TBufferChannel::with_capacity(128, 128); let (r_c, w_c) = c.split().unwrap(); - (TBinaryInputProtocol::new(r_c, true), TBinaryOutputProtocol::new(w_c, true)) + ( + TBinaryInputProtocol::new(r_c, true), + TBinaryOutputProtocol::new(w_c, true), + ) } } diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/server/threaded.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/server/threaded.rs index 515b20d..8139a4e 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/server/threaded.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/server/threaded.rs @@ -19,9 +19,9 @@ use std::net::{TcpListener, TcpStream}; use std::sync::Arc; use threadpool::ThreadPool; -use {ApplicationError, ApplicationErrorKind}; use protocol::{TInputProtocol, TInputProtocolFactory, TOutputProtocol, TOutputProtocolFactory}; use transport::{TIoChannel, TReadTransportFactory, TTcpChannel, TWriteTransportFactory}; +use {ApplicationError, ApplicationErrorKind}; use super::TProcessor; @@ -129,11 +129,13 @@ where } impl TServer - where PRC: TProcessor + Send + Sync + 'static, - RTF: TReadTransportFactory + 'static, - IPF: TInputProtocolFactory + 'static, - WTF: TWriteTransportFactory + 'static, - OPF: TOutputProtocolFactory + 'static { +where + PRC: TProcessor + Send + Sync + 'static, + RTF: TReadTransportFactory + 'static, + IPF: TInputProtocolFactory + 'static, + WTF: TWriteTransportFactory + 'static, + OPF: TOutputProtocolFactory + 'static, +{ /// Create a `TServer`. /// /// Each accepted connection has an input and output half, each of which @@ -155,10 +157,7 @@ impl TServer w_trans_factory: write_transport_factory, o_proto_factory: output_protocol_factory, processor: Arc::new(processor), - worker_pool: ThreadPool::with_name( - "Thrift service processor".to_owned(), - num_workers, - ), + worker_pool: ThreadPool::with_name("Thrift service processor".to_owned(), num_workers), } } @@ -179,7 +178,7 @@ impl TServer let (i_prot, o_prot) = self.new_protocols_for_connection(s)?; let processor = self.processor.clone(); self.worker_pool - .execute(move || handle_incoming_connection(processor, i_prot, o_prot),); + .execute(move || handle_incoming_connection(processor, i_prot, o_prot)); } Err(e) => { warn!("failed to accept remote connection with error {:?}", e); @@ -187,17 +186,12 @@ impl TServer } } - Err( - ::Error::Application( - ApplicationError { - kind: ApplicationErrorKind::Unknown, - message: "aborted listen loop".into(), - }, - ), - ) + Err(::Error::Application(ApplicationError { + kind: ApplicationErrorKind::Unknown, + message: "aborted listen loop".into(), + })) } - fn new_protocols_for_connection( &mut self, stream: TcpStream, diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/buffered.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/buffered.rs index 41b941c..87cfeff 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/buffered.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/buffered.rs @@ -192,7 +192,10 @@ where /// `read_capacity` and an internal write buffer of size /// `write_capacity` that wraps the given `TIoChannel`. pub fn with_capacity(write_capacity: usize, channel: C) -> TBufferedWriteTransport { - assert!(write_capacity > 0, "write buffer size must be a positive integer"); + assert!( + write_capacity > 0, + "write buffer size must be a positive integer" + ); TBufferedWriteTransport { buf: Vec::with_capacity(write_capacity), diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/framed.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/framed.rs index 7e0f8b6..a009307 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/framed.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/framed.rs @@ -201,8 +201,7 @@ where if let 0 = message_size { return Ok(()); } else { - self.channel - .write_i32::(message_size as i32)?; + self.channel.write_i32::(message_size as i32)?; } // will spin if the underlying channel can't be written to @@ -240,7 +239,7 @@ impl TWriteTransportFactory for TFramedWriteTransportFactory { #[cfg(test)] mod tests { use super::*; - use ::transport::mem::TBufferChannel; + use transport::mem::TBufferChannel; // FIXME: test a forced reserve @@ -249,12 +248,10 @@ mod tests { let c = TBufferChannel::with_capacity(10, 10); let mut t = TFramedReadTransport::with_capacity(8, c); - t.chan.set_readable_bytes( - &[ - 0x00, 0x00, 0x00, 0x04, /* message size */ - 0x00, 0x01, 0x02, 0x03 /* message body */ - ] - ); + t.chan.set_readable_bytes(&[ + 0x00, 0x00, 0x00, 0x04, /* message size */ + 0x00, 0x01, 0x02, 0x03, /* message body */ + ]); let mut buf = vec![0; 8]; @@ -268,12 +265,10 @@ mod tests { let c = TBufferChannel::with_capacity(10, 10); let mut t = TFramedReadTransport::with_capacity(2, c); - t.chan.set_readable_bytes( - &[ - 0x00, 0x00, 0x00, 0x04, /* message size */ - 0x00, 0x01, 0x02, 0x03 /* message body */ - ] - ); + t.chan.set_readable_bytes(&[ + 0x00, 0x00, 0x00, 0x04, /* message size */ + 0x00, 0x01, 0x02, 0x03, /* message body */ + ]); let mut buf = vec![0; 8]; @@ -291,12 +286,10 @@ mod tests { // 1st message // - t.chan.set_readable_bytes( - &[ - 0x00, 0x00, 0x00, 0x04, /* message size */ - 0x00, 0x01, 0x02, 0x03 /* message body */ - ] - ); + t.chan.set_readable_bytes(&[ + 0x00, 0x00, 0x00, 0x04, /* message size */ + 0x00, 0x01, 0x02, 0x03, /* message body */ + ]); let mut buf = vec![0; 8]; @@ -308,12 +301,10 @@ mod tests { // 2nd message // - t.chan.set_readable_bytes( - &[ - 0x00, 0x00, 0x00, 0x01, /* message size */ - 0x04 /* message body */ - ] - ); + t.chan.set_readable_bytes(&[ + 0x00, 0x00, 0x00, 0x01, /* message size */ + 0x04, /* message body */ + ]); let mut buf = vec![0; 8]; @@ -356,8 +347,8 @@ mod tests { assert!(t.flush().is_ok()); let expected_bytes = [ - 0x00, 0x00, 0x00, 0x05, /* message size */ - 0x00, 0x01, 0x02, 0x03, 0x04 /* message body */ + 0x00, 0x00, 0x00, 0x05, /* message size */ + 0x00, 0x01, 0x02, 0x03, 0x04, /* message body */ ]; assert_eq_transport_written_bytes!(t, expected_bytes); @@ -382,8 +373,8 @@ mod tests { assert!(t.flush().is_ok()); let expected_bytes = [ - 0x00, 0x00, 0x00, 0x03, /* message size */ - 0x00, 0x01, 0x02 /* message body */ + 0x00, 0x00, 0x00, 0x03, /* message size */ + 0x00, 0x01, 0x02, /* message body */ ]; assert_eq_transport_written_bytes!(t, expected_bytes); @@ -408,8 +399,8 @@ mod tests { assert!(t.flush().is_ok()); let expected_bytes = [ - 0x00, 0x00, 0x00, 0x03, /* message size */ - 0x00, 0x01, 0x02 /* message body */ + 0x00, 0x00, 0x00, 0x03, /* message size */ + 0x00, 0x01, 0x02, /* message body */ ]; assert_eq_transport_written_bytes!(t, expected_bytes); diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/mem.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/mem.rs index 86ac6bb..82c4b57 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/mem.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/mem.rs @@ -57,25 +57,17 @@ impl TBufferChannel { /// read buffer capacity and write buffer capacity. pub fn with_capacity(read_capacity: usize, write_capacity: usize) -> TBufferChannel { TBufferChannel { - read: Arc::new( - Mutex::new( - ReadData { - buf: vec![0; read_capacity].into_boxed_slice(), - idx: 0, - pos: 0, - cap: read_capacity, - }, - ), - ), - write: Arc::new( - Mutex::new( - WriteData { - buf: vec![0; write_capacity].into_boxed_slice(), - pos: 0, - cap: write_capacity, - }, - ), - ), + read: Arc::new(Mutex::new(ReadData { + buf: vec![0; read_capacity].into_boxed_slice(), + idx: 0, + pos: 0, + cap: read_capacity, + })), + write: Arc::new(Mutex::new(WriteData { + buf: vec![0; write_capacity].into_boxed_slice(), + pos: 0, + cap: write_capacity, + })), } } @@ -151,20 +143,20 @@ impl TIoChannel for TBufferChannel { where Self: Sized, { - Ok( - (ReadHalf { - handle: TBufferChannel { - read: self.read.clone(), - write: self.write.clone(), - }, - }, - WriteHalf { - handle: TBufferChannel { - read: self.read.clone(), - write: self.write.clone(), - }, - }), - ) + Ok(( + ReadHalf { + handle: TBufferChannel { + read: self.read.clone(), + write: self.write.clone(), + }, + }, + WriteHalf { + handle: TBufferChannel { + read: self.read.clone(), + write: self.write.clone(), + }, + }, + )) } } diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/mod.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/mod.rs index 9392786..a623350 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/mod.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/mod.rs @@ -29,32 +29,31 @@ use std::ops::{Deref, DerefMut}; #[cfg(test)] macro_rules! assert_eq_transport_num_written_bytes { - ($transport:ident, $num_written_bytes:expr) => { - { - assert_eq!($transport.channel.write_bytes().len(), $num_written_bytes); - } - }; + ($transport:ident, $num_written_bytes:expr) => {{ + assert_eq!($transport.channel.write_bytes().len(), $num_written_bytes); + }}; } - #[cfg(test)] macro_rules! assert_eq_transport_written_bytes { - ($transport:ident, $expected_bytes:ident) => { - { - assert_eq!($transport.channel.write_bytes(), &$expected_bytes); - } - }; + ($transport:ident, $expected_bytes:ident) => {{ + assert_eq!($transport.channel.write_bytes(), &$expected_bytes); + }}; } mod buffered; mod framed; -mod socket; mod mem; +mod socket; -pub use self::buffered::{TBufferedReadTransport, TBufferedReadTransportFactory, - TBufferedWriteTransport, TBufferedWriteTransportFactory}; -pub use self::framed::{TFramedReadTransport, TFramedReadTransportFactory, TFramedWriteTransport, - TFramedWriteTransportFactory}; +pub use self::buffered::{ + TBufferedReadTransport, TBufferedReadTransportFactory, TBufferedWriteTransport, + TBufferedWriteTransportFactory, +}; +pub use self::framed::{ + TFramedReadTransport, TFramedReadTransportFactory, TFramedWriteTransport, + TFramedWriteTransportFactory, +}; pub use self::mem::TBufferChannel; pub use self::socket::TTcpChannel; @@ -78,17 +77,9 @@ pub trait TWriteTransportFactory { fn create(&self, channel: Box) -> Box; } -impl TReadTransport for T -where - T: Read, -{ -} +impl TReadTransport for T where T: Read {} -impl TWriteTransport for T -where - T: Write, -{ -} +impl TWriteTransport for T where T: Write {} // FIXME: implement the Debug trait for boxed transports @@ -143,6 +134,26 @@ where handle: C, } +impl ReadHalf +where + C: Read, +{ + /// Create a `ReadHalf` associated with readable `handle` + pub fn new(handle: C) -> ReadHalf { + ReadHalf { handle } + } +} + +impl WriteHalf +where + C: Write, +{ + /// Create a `WriteHalf` associated with writable `handle` + pub fn new(handle: C) -> WriteHalf { + WriteHalf { handle } + } +} + impl Read for ReadHalf where C: Read, diff --git a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/socket.rs b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/socket.rs index a6f780a..0bef67b 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/src/transport/socket.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/src/transport/socket.rs @@ -20,8 +20,8 @@ use std::io; use std::io::{ErrorKind, Read, Write}; use std::net::{Shutdown, TcpStream}; -use {TransportErrorKind, new_transport_error}; use super::{ReadHalf, TIoChannel, WriteHalf}; +use {new_transport_error, TransportErrorKind}; /// Bidirectional TCP/IP channel. /// @@ -76,18 +76,18 @@ impl TTcpChannel { /// The passed-in stream is assumed to have been opened before being wrapped /// by the created `TTcpChannel` instance. pub fn with_stream(stream: TcpStream) -> TTcpChannel { - TTcpChannel { stream: Some(stream) } + TTcpChannel { + stream: Some(stream), + } } /// Connect to `remote_address`, which should have the form `host:port`. pub fn open(&mut self, remote_address: &str) -> ::Result<()> { if self.stream.is_some() { - Err( - new_transport_error( - TransportErrorKind::AlreadyOpen, - "tcp connection previously opened", - ), - ) + Err(new_transport_error( + TransportErrorKind::AlreadyOpen, + "tcp connection previously opened", + )) } else { match TcpStream::connect(&remote_address) { Ok(s) => { @@ -112,11 +112,13 @@ impl TTcpChannel { where F: FnMut(&mut TcpStream) -> io::Result, { - if let Some(ref mut s) = self.stream { stream_operation(s) } else { - Err(io::Error::new(ErrorKind::NotConnected, "tcp endpoint not connected"),) + Err(io::Error::new( + ErrorKind::NotConnected, + "tcp endpoint not connected", + )) } } } @@ -131,20 +133,21 @@ impl TIoChannel for TTcpChannel { s.stream .as_mut() .and_then(|s| s.try_clone().ok()) - .map( - |cloned| { - (ReadHalf { handle: TTcpChannel { stream: s.stream.take() } }, - WriteHalf { handle: TTcpChannel { stream: Some(cloned) } }) - }, - ) - .ok_or_else( - || { - new_transport_error( - TransportErrorKind::Unknown, - "cannot clone underlying tcp stream", - ) - }, - ) + .map(|cloned| { + let read_half = ReadHalf::new(TTcpChannel { + stream: s.stream.take(), + }); + let write_half = WriteHalf::new(TTcpChannel { + stream: Some(cloned), + }); + (read_half, write_half) + }) + .ok_or_else(|| { + new_transport_error( + TransportErrorKind::Unknown, + "cannot clone underlying tcp stream", + ) + }) } } diff --git a/vendor/git.apache.org/thrift.git/lib/rs/test/src/bin/kitchen_sink_client.rs b/vendor/git.apache.org/thrift.git/lib/rs/test/src/bin/kitchen_sink_client.rs index fb6ea15..d295c88 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/test/src/bin/kitchen_sink_client.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/test/src/bin/kitchen_sink_client.rs @@ -28,10 +28,13 @@ use kitchen_sink::midlayer::{MealServiceSyncClient, TMealServiceSyncClient}; use kitchen_sink::recursive; use kitchen_sink::recursive::{CoRec, CoRec2, RecList, RecTree, TTestServiceSyncClient}; use kitchen_sink::ultimate::{FullMealServiceSyncClient, TFullMealServiceSyncClient}; -use thrift::transport::{ReadHalf, TFramedReadTransport, TFramedWriteTransport, TIoChannel, - TTcpChannel, WriteHalf}; -use thrift::protocol::{TBinaryInputProtocol, TBinaryOutputProtocol, TCompactInputProtocol, - TCompactOutputProtocol, TInputProtocol, TOutputProtocol}; +use thrift::protocol::{ + TBinaryInputProtocol, TBinaryOutputProtocol, TCompactInputProtocol, TCompactOutputProtocol, + TInputProtocol, TOutputProtocol, +}; +use thrift::transport::{ + ReadHalf, TFramedReadTransport, TFramedWriteTransport, TIoChannel, TTcpChannel, WriteHalf, +}; fn main() { match run() { @@ -61,17 +64,20 @@ fn run() -> thrift::Result<()> { let service = matches.value_of("service").unwrap_or("part"); let (i_chan, o_chan) = tcp_channel(host, port)?; - let (i_tran, o_tran) = (TFramedReadTransport::new(i_chan), TFramedWriteTransport::new(o_chan)); + let (i_tran, o_tran) = ( + TFramedReadTransport::new(i_chan), + TFramedWriteTransport::new(o_chan), + ); let (i_prot, o_prot): (Box, Box) = match protocol { - "binary" => { - (Box::new(TBinaryInputProtocol::new(i_tran, true)), - Box::new(TBinaryOutputProtocol::new(o_tran, true))) - } - "compact" => { - (Box::new(TCompactInputProtocol::new(i_tran)), - Box::new(TCompactOutputProtocol::new(o_tran))) - } + "binary" => ( + Box::new(TBinaryInputProtocol::new(i_tran, true)), + Box::new(TBinaryOutputProtocol::new(o_tran, true)), + ), + "compact" => ( + Box::new(TCompactInputProtocol::new(i_tran)), + Box::new(TCompactOutputProtocol::new(o_tran)), + ), unmatched => return Err(format!("unsupported protocol {}", unmatched).into()), }; @@ -87,7 +93,10 @@ fn run_client( "full" => exec_full_meal_client(i_prot, o_prot), "part" => exec_meal_client(i_prot, o_prot), "recursive" => exec_recursive_client(i_prot, o_prot), - _ => Err(thrift::Error::from(format!("unknown service type {}", service)),), + _ => Err(thrift::Error::from(format!( + "unknown service type {}", + service + ))), } } @@ -110,12 +119,9 @@ fn exec_meal_client( // this is because the MealService struct does not contain the appropriate service marker // only the following three calls work - execute_call("part", "ramen", || client.ramen(50)) - .map(|_| ())?; - execute_call("part", "meal", || client.meal()) - .map(|_| ())?; - execute_call("part", "napkin", || client.napkin()) - .map(|_| ())?; + execute_call("part", "ramen", || client.ramen(50)).map(|_| ())?; + execute_call("part", "meal", || client.meal()).map(|_| ())?; + execute_call("part", "napkin", || client.napkin()).map(|_| ())?; Ok(()) } @@ -126,14 +132,10 @@ fn exec_full_meal_client( ) -> thrift::Result<()> { let mut client = FullMealServiceSyncClient::new(i_prot, o_prot); - execute_call("full", "ramen", || client.ramen(100)) - .map(|_| ())?; - execute_call("full", "meal", || client.meal()) - .map(|_| ())?; - execute_call("full", "napkin", || client.napkin()) - .map(|_| ())?; - execute_call("full", "full meal", || client.full_meal()) - .map(|_| ())?; + execute_call("full", "ramen", || client.ramen(100)).map(|_| ())?; + execute_call("full", "meal", || client.meal()).map(|_| ())?; + execute_call("full", "napkin", || client.napkin()).map(|_| ())?; + execute_call("full", "full meal", || client.full_meal()).map(|_| ())?; Ok(()) } @@ -145,114 +147,75 @@ fn exec_recursive_client( let mut client = recursive::TestServiceSyncClient::new(i_prot, o_prot); let tree = RecTree { - children: Some( - vec![ - Box::new( - RecTree { - children: Some( - vec![ - Box::new( - RecTree { - children: None, - item: Some(3), - }, - ), - Box::new( - RecTree { - children: None, - item: Some(4), - }, - ), - ], - ), - item: Some(2), - }, - ), - ], - ), + children: Some(vec![Box::new(RecTree { + children: Some(vec![ + Box::new(RecTree { + children: None, + item: Some(3), + }), + Box::new(RecTree { + children: None, + item: Some(4), + }), + ]), + item: Some(2), + })]), item: Some(1), }; let expected_tree = RecTree { - children: Some( - vec![ - Box::new( - RecTree { - children: Some( - vec![ - Box::new( - RecTree { - children: Some(Vec::new()), // remote returns an empty list - item: Some(3), - }, - ), - Box::new( - RecTree { - children: Some(Vec::new()), // remote returns an empty list - item: Some(4), - }, - ), - ], - ), - item: Some(2), - }, - ), - ], - ), + children: Some(vec![Box::new(RecTree { + children: Some(vec![ + Box::new(RecTree { + children: Some(Vec::new()), // remote returns an empty list + item: Some(3), + }), + Box::new(RecTree { + children: Some(Vec::new()), // remote returns an empty list + item: Some(4), + }), + ]), + item: Some(2), + })]), item: Some(1), }; let returned_tree = execute_call("recursive", "echo_tree", || client.echo_tree(tree.clone()))?; if returned_tree != expected_tree { - return Err( - format!( - "mismatched recursive tree {:?} {:?}", - expected_tree, - returned_tree - ) - .into(), - ); + return Err(format!( + "mismatched recursive tree {:?} {:?}", + expected_tree, returned_tree + ) + .into()); } let list = RecList { - nextitem: Some( - Box::new( - RecList { - nextitem: Some( - Box::new( - RecList { - nextitem: None, - item: Some(3), - }, - ), - ), - item: Some(2), - }, - ), - ), + nextitem: Some(Box::new(RecList { + nextitem: Some(Box::new(RecList { + nextitem: None, + item: Some(3), + })), + item: Some(2), + })), item: Some(1), }; let returned_list = execute_call("recursive", "echo_list", || client.echo_list(list.clone()))?; if returned_list != list { - return Err(format!("mismatched recursive list {:?} {:?}", list, returned_list).into(),); + return Err(format!("mismatched recursive list {:?} {:?}", list, returned_list).into()); } let co_rec = CoRec { - other: Some( - Box::new( - CoRec2 { - other: Some(CoRec { other: Some(Box::new(CoRec2 { other: None })) }), - }, - ), - ), + other: Some(Box::new(CoRec2 { + other: Some(CoRec { + other: Some(Box::new(CoRec2 { other: None })), + }), + })), }; - let returned_co_rec = execute_call( - "recursive", - "echo_co_rec", - || client.echo_co_rec(co_rec.clone()), - )?; + let returned_co_rec = execute_call("recursive", "echo_co_rec", || { + client.echo_co_rec(co_rec.clone()) + })?; if returned_co_rec != co_rec { - return Err(format!("mismatched co_rec {:?} {:?}", co_rec, returned_co_rec).into(),); + return Err(format!("mismatched co_rec {:?} {:?}", co_rec, returned_co_rec).into()); } Ok(()) @@ -266,14 +229,10 @@ where match res { Ok(_) => println!("{}: completed {} call", service_type, call_name), - Err(ref e) => { - println!( - "{}: failed {} call with error {:?}", - service_type, - call_name, - e - ) - } + Err(ref e) => println!( + "{}: failed {} call with error {:?}", + service_type, call_name, e + ), } res diff --git a/vendor/git.apache.org/thrift.git/lib/rs/test/src/bin/kitchen_sink_server.rs b/vendor/git.apache.org/thrift.git/lib/rs/test/src/bin/kitchen_sink_server.rs index 15ceb29..73801ea 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/test/src/bin/kitchen_sink_server.rs +++ b/vendor/git.apache.org/thrift.git/lib/rs/test/src/bin/kitchen_sink_server.rs @@ -17,23 +17,32 @@ #[macro_use] extern crate clap; - extern crate kitchen_sink; extern crate thrift; -use kitchen_sink::base_one::Noodle; -use kitchen_sink::base_two::{Napkin, NapkinServiceSyncHandler, Ramen, RamenServiceSyncHandler}; -use kitchen_sink::midlayer::{Dessert, Meal, MealServiceSyncHandler, MealServiceSyncProcessor}; -use kitchen_sink::recursive; -use kitchen_sink::ultimate::{Drink, FullMeal, FullMealAndDrinks, - FullMealAndDrinksServiceSyncProcessor, FullMealServiceSyncHandler}; -use kitchen_sink::ultimate::FullMealAndDrinksServiceSyncHandler; -use thrift::protocol::{TBinaryInputProtocolFactory, TBinaryOutputProtocolFactory, - TCompactInputProtocolFactory, TCompactOutputProtocolFactory, - TInputProtocolFactory, TOutputProtocolFactory}; -use thrift::transport::{TFramedReadTransportFactory, TFramedWriteTransportFactory, - TReadTransportFactory, TWriteTransportFactory}; +use thrift::protocol::{ + TBinaryInputProtocolFactory, TBinaryOutputProtocolFactory, TCompactInputProtocolFactory, + TCompactOutputProtocolFactory, TInputProtocolFactory, TOutputProtocolFactory, +}; use thrift::server::TServer; +use thrift::transport::{ + TFramedReadTransportFactory, TFramedWriteTransportFactory, TReadTransportFactory, + TWriteTransportFactory, +}; + +use kitchen_sink::base_one::Noodle; +use kitchen_sink::base_two::{ + BrothType, Napkin, NapkinServiceSyncHandler, Ramen, RamenServiceSyncHandler, +}; +use kitchen_sink::midlayer::{ + Dessert, Meal, MealServiceSyncHandler, MealServiceSyncProcessor, Pie, +}; +use kitchen_sink::recursive; +use kitchen_sink::ultimate::FullMealAndDrinksServiceSyncHandler; +use kitchen_sink::ultimate::{ + Drink, FullMeal, FullMealAndDrinks, FullMealAndDrinksServiceSyncProcessor, + FullMealServiceSyncHandler, +}; fn main() { match run() { @@ -46,7 +55,6 @@ fn main() { } fn run() -> thrift::Result<()> { - let matches = clap_app!(rust_kitchen_sink_server => (version: "0.1.0") (author: "Apache Thrift Developers ") @@ -67,21 +75,22 @@ fn run() -> thrift::Result<()> { let r_transport_factory = TFramedReadTransportFactory::new(); let w_transport_factory = TFramedWriteTransportFactory::new(); - let (i_protocol_factory, o_protocol_factory): (Box, - Box) = - match &*protocol { - "binary" => { - (Box::new(TBinaryInputProtocolFactory::new()), - Box::new(TBinaryOutputProtocolFactory::new())) - } - "compact" => { - (Box::new(TCompactInputProtocolFactory::new()), - Box::new(TCompactOutputProtocolFactory::new())) - } - unknown => { - return Err(format!("unsupported transport type {}", unknown).into()); - } - }; + let (i_protocol_factory, o_protocol_factory): ( + Box, + Box, + ) = match &*protocol { + "binary" => ( + Box::new(TBinaryInputProtocolFactory::new()), + Box::new(TBinaryOutputProtocolFactory::new()), + ), + "compact" => ( + Box::new(TCompactInputProtocolFactory::new()), + Box::new(TCompactOutputProtocolFactory::new()), + ), + unknown => { + return Err(format!("unsupported transport type {}", unknown).into()); + } + }; // FIXME: should processor be boxed as well? // @@ -94,33 +103,27 @@ fn run() -> thrift::Result<()> { // // Since what I'm doing is uncommon I'm just going to duplicate the code match &*service { - "part" => { - run_meal_server( - &listen_address, - r_transport_factory, - i_protocol_factory, - w_transport_factory, - o_protocol_factory, - ) - } - "full" => { - run_full_meal_server( - &listen_address, - r_transport_factory, - i_protocol_factory, - w_transport_factory, - o_protocol_factory, - ) - } - "recursive" => { - run_recursive_server( - &listen_address, - r_transport_factory, - i_protocol_factory, - w_transport_factory, - o_protocol_factory, - ) - } + "part" => run_meal_server( + &listen_address, + r_transport_factory, + i_protocol_factory, + w_transport_factory, + o_protocol_factory, + ), + "full" => run_full_meal_server( + &listen_address, + r_transport_factory, + i_protocol_factory, + w_transport_factory, + o_protocol_factory, + ), + "recursive" => run_recursive_server( + &listen_address, + r_transport_factory, + i_protocol_factory, + w_transport_factory, + o_protocol_factory, + ), unknown => Err(format!("unsupported service type {}", unknown).into()), } } @@ -207,7 +210,13 @@ struct FullHandler; impl FullMealAndDrinksServiceSyncHandler for FullHandler { fn handle_full_meal_and_drinks(&self) -> thrift::Result { - Ok(FullMealAndDrinks::new(full_meal(), Drink::WHISKEY)) + println!("full_meal_and_drinks: handling full meal and drinks call"); + Ok(FullMealAndDrinks::new(full_meal(), Drink::CanadianWhisky)) + } + + fn handle_best_pie(&self) -> thrift::Result { + println!("full_meal_and_drinks: handling pie call"); + Ok(Pie::MississippiMud) // I prefer Pie::Pumpkin, but I have to check that casing works } } @@ -252,7 +261,7 @@ fn noodle() -> Noodle { } fn ramen() -> Ramen { - Ramen::new("Mr Ramen".to_owned(), 72) + Ramen::new("Mr Ramen".to_owned(), 72, BrothType::Miso) } fn napkin() -> Napkin { diff --git a/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Base_One.thrift b/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Base_One.thrift index 3da083d..c5fa6c2 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Base_One.thrift +++ b/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Base_One.thrift @@ -37,6 +37,9 @@ const list CommonTemperatures = [300.0, 450.0] const double MealsPerDay = 2.5; +const string DefaultRecipeName = "Soup-rise of the Day" +const binary DefaultRecipeBinary = "Soup-rise of the 01010101" + struct Noodle { 1: string flourType 2: Temperature cookTemp diff --git a/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Base_Two.thrift b/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Base_Two.thrift index b4b4ea1..caa6acb 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Base_Two.thrift +++ b/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Base_Two.thrift @@ -23,9 +23,15 @@ const i32 WaterWeight = 200 +enum brothType { + Miso, + shouyu, +} + struct Ramen { 1: optional string ramenType 2: required i32 noodleCount + 3: brothType broth } struct Napkin { diff --git a/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Midlayer.thrift b/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Midlayer.thrift index cf1157c..16ff49b 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Midlayer.thrift +++ b/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Midlayer.thrift @@ -46,6 +46,15 @@ const set> MyConstNestedSet = [ [6, 7, 8] ] +enum Pie { + PUMPKIN, + apple, // intentionally poorly cased + STRAWBERRY_RHUBARB, + Key_Lime, // intentionally poorly cased + coconut_Cream, // intentionally poorly cased + mississippi_mud, // intentionally poorly cased +} + struct Meal { 1: Base_One.Noodle noodle 2: Base_Two.Ramen ramen diff --git a/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Ultimate.thrift b/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Ultimate.thrift index 8154d91..72fa100 100644 --- a/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Ultimate.thrift +++ b/vendor/git.apache.org/thrift.git/lib/rs/test/thrifts/Ultimate.thrift @@ -27,6 +27,21 @@ enum Drink { WATER, WHISKEY, WINE, + scotch, // intentionally poorly cased + LATE_HARVEST_WINE, + India_Pale_Ale, // intentionally poorly cased + apple_cider, // intentially poorly cased + belgian_Ale, // intentionally poorly cased + Canadian_whisky, // intentionally poorly cased +} + +const map RankedPies = { + 1: Midlayer.Pie.PUMPKIN, + 2: Midlayer.Pie.STRAWBERRY_RHUBARB, + 3: Midlayer.Pie.apple, + 4: Midlayer.Pie.mississippi_mud, + 5: Midlayer.Pie.coconut_Cream, + 6: Midlayer.Pie.Key_Lime, } struct FullMeal { @@ -45,5 +60,7 @@ service FullMealService extends Midlayer.MealService { service FullMealAndDrinksService extends FullMealService { FullMealAndDrinks fullMealAndDrinks() + + Midlayer.Pie bestPie() } diff --git a/vendor/git.apache.org/thrift.git/lib/st/package.xml b/vendor/git.apache.org/thrift.git/lib/st/package.xml index 72194fc..7f6b234 100644 --- a/vendor/git.apache.org/thrift.git/lib/st/package.xml +++ b/vendor/git.apache.org/thrift.git/lib/st/package.xml @@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License. --> - + libthrift-st thrift.st diff --git a/vendor/git.apache.org/thrift.git/package-lock.json b/vendor/git.apache.org/thrift.git/package-lock.json index 7add853..0342c15 100644 --- a/vendor/git.apache.org/thrift.git/package-lock.json +++ b/vendor/git.apache.org/thrift.git/package-lock.json @@ -1,38 +1,99 @@ { "name": "thrift", - "version": "1.0.0-dev", + "version": "0.12.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@types/node": { + "version": "10.12.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.6.tgz", + "integrity": "sha512-+ZWB5Ec1iki99xQFzBlivlKxSZQ+fuUKBott8StBOnLN4dWbRHlgdg1XknpW6g0tweniN5DcOqA64CJyOUPSAw==", + "dev": true + }, + "@types/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.1.tgz", + "integrity": "sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==", + "dev": true + }, "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", "dev": true }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "acorn": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz", + "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==", + "dev": true + }, + "acorn-jsx": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.0.tgz", + "integrity": "sha512-XkB50fn0MURDyww9+UYL3c1yLbOBz0ZFvrdYlGB8l+Ije1oSC75qAqrzSPjYQbdnQUzhlUGNKuesryAv0gxZOg==", + "dev": true + }, + "ajv": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", + "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true, + "optional": true + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", @@ -40,13 +101,13 @@ "dev": true }, "are-we-there-yet": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", - "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.5" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, "argparse": { @@ -55,12 +116,33 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "async": { "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, @@ -88,46 +170,19 @@ "dev": true }, "bl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.0.3.tgz", - "integrity": "sha1-/FQhoo/UImA2w7OJGmaiW8ZNIm4=", + "version": "1.2.2", + "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "dev": true, "requires": { - "readable-stream": "2.0.6" - }, - "dependencies": { - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" } }, "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", + "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", "dev": true }, "brace-expansion": { @@ -136,22 +191,52 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "requires": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, "buffer-equals": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/buffer-equals/-/buffer-equals-1.0.4.tgz", + "resolved": "http://registry.npmjs.org/buffer-equals/-/buffer-equals-1.0.4.tgz", "integrity": "sha1-A1O1T9B/2VZBcGca5vZrnPENJ/U=", "dev": true }, - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, - "optional": true + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true }, "catharsis": { "version": "0.8.9", @@ -159,57 +244,78 @@ "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", "dev": true, "requires": { - "underscore-contrib": "0.3.0" + "underscore-contrib": "~0.3.0" } }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, - "optional": true, "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, - "chownr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", - "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, - "cliui": { + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, - "optional": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true, - "optional": true - } + "restore-cursor": "^2.0.0" } }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "commander": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", - "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", "dev": true }, "concat-map": { @@ -226,7 +332,7 @@ "requires": { "debug": "2.6.9", "finalhandler": "1.1.0", - "parseurl": "1.3.2", + "parseurl": "~1.3.2", "utils-merge": "1.0.1" } }, @@ -242,6 +348,19 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -251,17 +370,25 @@ "ms": "2.0.0" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", "dev": true, - "optional": true + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true }, "deep-extend": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", - "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, "deep-is": { @@ -271,21 +398,33 @@ "dev": true }, "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { - "foreach": "2.0.5", - "object-keys": "1.0.11" - }, - "dependencies": { - "object-keys": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", - "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", - "dev": true - } + "object-keys": "^1.0.12" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" } }, "delegates": { @@ -294,6 +433,21 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -312,31 +466,31 @@ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "es-abstract": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.10.0.tgz", - "integrity": "sha512-/uh/DhdqIOSkAWifU+8nG78vlQxdLckUdI/sPgy0VhuXi2qJ7T8czBmqIYtLQVpCIFYafChnsRsB5pyb1JdmCQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", "dev": true, "requires": { - "es-to-primitive": "1.1.1", - "function-bind": "1.1.1", - "has": "1.0.1", - "is-callable": "1.1.3", - "is-regex": "1.0.4" + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" } }, "es-to-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", - "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", "dev": true, "requires": { - "is-callable": "1.1.3", - "is-date-object": "1.0.1", - "is-symbol": "1.0.1" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" } }, "escape-html": { @@ -357,23 +511,169 @@ "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "dev": true, "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.2.0" + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + } + } + }, + "eslint": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.7.0.tgz", + "integrity": "sha512-zYCeFQahsxffGl87U2aJ7DPyH8CbWgxBC213Y8+TCanhUTf2gEvfq3EKpHmEcozTLyPmGe9LZdMAwC/CpJBM5A==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^4.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "imurmurhash": "^0.1.4", + "inquirer": "^6.1.0", + "is-resolvable": "^1.1.0", + "js-yaml": "^3.12.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.0.2", + "text-table": "^0.2.0" + }, + "dependencies": { + "debug": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "eslint-config-prettier": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-3.1.0.tgz", + "integrity": "sha512-QYGfmzuc4q4J6XIhlp8vRKdI/fI0tQfQPy1dME3UOLprE+v4ssH/3W9LM2Q7h5qBcy5m0ehCrBDU2YF8q6OY8w==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-plugin-prettier": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.0.tgz", + "integrity": "sha512-4g11opzhqq/8+AMmo5Vc2Gn7z9alZ4JqrbZ+D4i8KlSyxeQhZHlmIrY8U9Akf514MoEhogPa87Jgkq87aZ2Ohw==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", + "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", + "dev": true, + "requires": { + "acorn": "^6.0.2", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" } }, "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, "estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", "dev": true }, "esutils": { @@ -383,9 +683,38 @@ "dev": true }, "expand-template": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.0.tgz", - "integrity": "sha512-kkjwkMqj0h4w/sb32ERCDxCQkREMCAgS39DscDnSwDsbxnwwM1BTZySdC3Bn1lhY7vL08n9GoO/fVTynjDgRyQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.1.tgz", + "integrity": "sha512-cebqLtV8KOZfw0UI8TEFWxtczxxC1jvyUvx6H4fyp1K1FN7A4Q+uggVUlOsI1K8AGU0rwOGqP8nCapdrw8CYQg==", + "dev": true + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", "dev": true }, "fast-levenshtein": { @@ -394,6 +723,25 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + } + }, "finalhandler": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", @@ -401,27 +749,39 @@ "dev": true, "requires": { "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.3.1", - "unpipe": "1.0.0" + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.3.1", + "unpipe": "~1.0.0" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" } }, "for-each": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", - "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "requires": { - "is-function": "1.0.1" + "is-callable": "^1.1.3" } }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true }, "fs.realpath": { @@ -436,22 +796,71 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } } }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, "github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", @@ -459,16 +868,37 @@ "dev": true }, "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globals": { + "version": "11.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", + "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "graceful-fs": { @@ -478,41 +908,53 @@ "dev": true }, "handlebars": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", + "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", "dev": true, "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" + "async": "^2.5.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" }, "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "dev": true, "requires": { - "amdefine": "1.0.1" + "lodash": "^4.17.10" } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true } } }, "has": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", - "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "function-bind": "1.1.1" + "function-bind": "^1.1.1" } }, "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, "has-unicode": { @@ -521,14 +963,35 @@ "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -543,16 +1006,31 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true + "inquirer": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", + "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.0", + "figures": "^2.0.0", + "lodash": "^4.17.10", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.1.0", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } }, "is-callable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", - "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, "is-date-object": { @@ -562,18 +1040,39 @@ "dev": true }, "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-path-cwd": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "is-path-inside": "^1.0.0" } }, - "is-function": { + "is-path-inside": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", - "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, "is-regex": { @@ -582,15 +1081,24 @@ "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { - "has": "1.0.1" + "has": "^1.0.1" } }, - "is-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", - "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -609,47 +1117,81 @@ "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", "dev": true, "requires": { - "abbrev": "1.0.9", - "async": "1.5.2", - "escodegen": "1.8.1", - "esprima": "2.7.3", - "glob": "5.0.15", - "handlebars": "4.0.11", - "js-yaml": "3.11.0", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "once": "1.4.0", - "resolve": "1.1.7", - "supports-color": "3.2.3", - "which": "1.3.0", - "wordwrap": "1.0.0" - } - }, - "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", - "dev": true, - "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" }, "dependencies": { "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", "dev": true + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } } } }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "js2xmlparser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", "dev": true, "requires": { - "xmlcreate": "1.0.2" + "xmlcreate": "^1.0.1" } }, "jsdoc": { @@ -659,27 +1201,30 @@ "dev": true, "requires": { "babylon": "7.0.0-beta.19", - "bluebird": "3.5.1", - "catharsis": "0.8.9", - "escape-string-regexp": "1.0.5", - "js2xmlparser": "3.0.0", - "klaw": "2.0.0", - "marked": "0.3.17", - "mkdirp": "0.5.1", - "requizzle": "0.2.1", - "strip-json-comments": "2.0.1", + "bluebird": "~3.5.0", + "catharsis": "~0.8.9", + "escape-string-regexp": "~1.0.5", + "js2xmlparser": "~3.0.0", + "klaw": "~2.0.0", + "marked": "~0.3.6", + "mkdirp": "~0.5.1", + "requizzle": "~0.2.1", + "strip-json-comments": "~2.0.1", "taffydb": "2.6.2", - "underscore": "1.8.3" + "underscore": "~1.8.3" } }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true }, "klaw": { "version": "2.0.0", @@ -687,36 +1232,41 @@ "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.9" } }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, - "optional": true - }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, "marked": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.17.tgz", - "integrity": "sha512-+AKbNsjZl6jFfLPwHhWmGTqE009wTKn3RTmn9K8oUKHrX/abPJjtcRtXpYB/FFrwPJRUA86LX/de3T0knkPCmQ==", + "version": "0.3.19", + "resolved": "http://registry.npmjs.org/marked/-/marked-0.3.19.tgz", + "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "dev": true + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", "dev": true }, "minimatch": { @@ -725,30 +1275,22 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } } }, "ms": { @@ -757,19 +1299,37 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, "nan": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", - "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "version": "2.10.0", + "resolved": "http://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "node-abi": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.3.0.tgz", - "integrity": "sha512-zwm6vU3SsVgw3e9fu48JBaRBCJGIvAgysDsqtf5+vEexFE71bEOtaMWb5zr/zODZNzTPtQlqUUpC79k68Hspow==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.4.5.tgz", + "integrity": "sha512-aa/UC6Nr3+tqhHGRsAuw/edz7/q9nnetBrKWxj6rpTtm+0X9T1qU7lIEHMS3yN9JwAbRiKUbRRFy1PLz/y3aaA==", "dev": true, "requires": { - "semver": "5.5.0" + "semver": "^5.4.1" } }, "node-int64": { @@ -789,7 +1349,7 @@ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1.0.9" + "abbrev": "1" } }, "npmlog": { @@ -798,10 +1358,10 @@ "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" } }, "number-is-nan": { @@ -817,9 +1377,15 @@ "dev": true }, "object-inspect": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.5.0.tgz", - "integrity": "sha512-UmOFbHbwvv+XHj7BerrhVq+knjceBdkvU5AriwLMvhv2qi+e7DJzxfBeFpILEjVzCp+xA+W/pIf06RGPWlZNfw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", + "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "dev": true + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", "dev": true }, "on-finished": { @@ -837,7 +1403,16 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" } }, "optimist": { @@ -846,8 +1421,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" }, "dependencies": { "wordwrap": { @@ -864,12 +1439,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "os-homedir": { @@ -878,6 +1453,12 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", @@ -890,45 +1471,79 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "prebuild-install": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-2.3.0.tgz", - "integrity": "sha512-gzjq2oHB8oMbzJSsSh9MQ64zrXZGt092/uT4TLZlz2qnrPxpWqp4vYB7LZrDxnlxf5RfbCjkgDI/z0EIVuYzAw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-4.0.0.tgz", + "integrity": "sha512-7tayxeYboJX0RbVzdnKyGl2vhQRWr6qfClEXDhOkXjuaOKCw2q8aiuFhONRYVsG/czia7KhpykIlI2S2VaPunA==", "dev": true, "requires": { - "expand-template": "1.1.0", + "detect-libc": "^1.0.3", + "expand-template": "^1.0.2", "github-from-package": "0.0.0", - "minimist": "1.2.0", - "mkdirp": "0.5.1", - "node-abi": "2.3.0", - "noop-logger": "0.1.1", - "npmlog": "4.1.2", - "os-homedir": "1.0.2", - "pump": "1.0.3", - "rc": "1.2.5", - "simple-get": "1.4.3", - "tar-fs": "1.16.0", - "tunnel-agent": "0.6.0", - "xtend": "4.0.1" + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "node-abi": "^2.2.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "os-homedir": "^1.0.1", + "pump": "^2.0.1", + "rc": "^1.1.6", + "simple-get": "^2.7.0", + "tar-fs": "^1.13.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" }, "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true } } }, @@ -939,80 +1554,111 @@ "dev": true }, "prettier": { - "version": "1.11.1", - "resolved": "https://unpm.uberinternal.com/prettier/-/prettier-1.11.1.tgz", - "integrity": "sha512-T/KD65Ot0PB97xTrG8afQ46x3oiVhnfGjGESSI9NWYcG92+OUPZKkwHqGWXH2t9jK1crnQjubECW0FuOth+hxw==", + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.3.tgz", + "integrity": "sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==", "dev": true }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, + "progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", + "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", + "dev": true + }, "pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "dev": true, "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, "rc": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.5.tgz", - "integrity": "sha1-J1zWh/bjs2zHVrqibf7oCnkDAf0=", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } } }, "readable-stream": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", - "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + } + }, "requizzle": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", "dev": true, "requires": { - "underscore": "1.6.0" + "underscore": "~1.6.0" }, "dependencies": { "underscore": { @@ -1029,35 +1675,74 @@ "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, "resumer": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", "dev": true, "requires": { - "through": "2.3.8" + "through": "~2.3.4" } }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, - "optional": true, "requires": { - "align-text": "0.1.4" + "glob": "^7.0.5" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "dev": true, + "requires": { + "tslib": "^1.9.0" } }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, "set-blocking": { @@ -1066,29 +1751,51 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", + "dev": true + }, "simple-get": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-1.4.3.tgz", - "integrity": "sha1-6XVe2kB+ltpAxeUVjJ6jezO+y+s=", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", "dev": true, "requires": { - "once": "1.4.0", - "unzip-response": "1.0.2", - "xtend": "4.0.1" - }, - "dependencies": { - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - } + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" } }, "source-map": { @@ -1098,7 +1805,7 @@ "dev": true, "optional": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } }, "sprintf-js": { @@ -1114,14 +1821,13 @@ "dev": true }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "string.prototype.trim": { @@ -1130,27 +1836,27 @@ "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", "dev": true, "requires": { - "define-properties": "1.1.2", - "es-abstract": "1.10.0", - "function-bind": "1.1.1" + "define-properties": "^1.1.2", + "es-abstract": "^1.5.0", + "function-bind": "^1.0.2" } }, "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^3.0.0" } }, "strip-json-comments": { @@ -1160,12 +1866,24 @@ "dev": true }, "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", + "integrity": "sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg==", + "dev": true, + "requires": { + "ajv": "^6.5.3", + "lodash": "^4.17.10", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" } }, "taffydb": { @@ -1175,114 +1893,122 @@ "dev": true }, "tape": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.0.tgz", - "integrity": "sha512-j0jO9BiScfqtPBb9QmPLL0qvxXMz98xjkMb7x8lKipFlJZwNJkqkWPou+NU4V6T9RnVh1kuSthLE8gLrN8bBfw==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.1.tgz", + "integrity": "sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw==", "dev": true, "requires": { - "deep-equal": "1.0.1", - "defined": "1.0.0", - "for-each": "0.3.2", - "function-bind": "1.1.1", - "glob": "7.1.2", - "has": "1.0.1", - "inherits": "2.0.3", - "minimist": "1.2.0", - "object-inspect": "1.5.0", - "resolve": "1.5.0", - "resumer": "0.0.0", - "string.prototype.trim": "1.1.2", - "through": "2.3.8" + "deep-equal": "~1.0.1", + "defined": "~1.0.0", + "for-each": "~0.3.3", + "function-bind": "~1.1.1", + "glob": "~7.1.2", + "has": "~1.0.3", + "inherits": "~2.0.3", + "minimist": "~1.2.0", + "object-inspect": "~1.6.0", + "resolve": "~1.7.1", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.1.2", + "through": "~2.3.8" }, "dependencies": { - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", - "dev": true - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "resolve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } } } }, "tar-fs": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.0.tgz", - "integrity": "sha512-I9rb6v7mjWLtOfCau9eH5L7sLJyU2BnxtEZRQ5Mt+eRKmf1F0ohXmT/Jc3fr52kDvjJ/HV5MH3soQfPL5bQ0Yg==", + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", + "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", "dev": true, "requires": { - "chownr": "1.0.1", - "mkdirp": "0.5.1", - "pump": "1.0.3", - "tar-stream": "1.5.5" - } - }, - "tar-stream": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.5.tgz", - "integrity": "sha512-mQdgLPc/Vjfr3VWqWbfxW8yQNiJCbAZ+Gf6GDu1Cy0bdb33ofyiNGBtAY96jHFhDuivCwgW1H9DgTON+INiXgg==", - "dev": true, - "requires": { - "bl": "1.0.3", - "end-of-stream": "1.4.1", - "readable-stream": "2.3.5", - "xtend": "4.0.1" + "chownr": "^1.0.1", + "mkdirp": "^0.5.1", + "pump": "^1.0.0", + "tar-stream": "^1.1.2" }, "dependencies": { - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true + "pump": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } } } }, + "tar-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "dev": true, + "requires": { + "bl": "^1.0.0", + "buffer-alloc": "^1.2.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.1", + "xtend": "^4.0.0" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-buffer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", + "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", + "dev": true + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.0.1" } }, "type-check": { @@ -1291,37 +2017,42 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, + "typescript": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.6.tgz", + "integrity": "sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA==", + "dev": true + }, "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "version": "3.4.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", + "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", "dev": true, "optional": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "commander": "~2.17.1", + "source-map": "~0.6.1" }, "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "dev": true, + "optional": true + }, "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "optional": true } } }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, "underscore": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", @@ -1351,21 +2082,24 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, - "unzip-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-1.0.2.tgz", - "integrity": "sha1-uYTwh3/AqJwsdzzB73tbIytbBv4=", - "dev": true - }, - "utf-8-validate": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-4.0.0.tgz", - "integrity": "sha512-JS/c6nR/qauqSdvTksgDO1142kYddTXz42y5X/he188B/kgcFLLB4l9CfZd+hGic/ORgsL+pPfwr9lYsL/80Fw==", + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "dev": true, "requires": { - "bindings": "1.3.0", - "nan": "2.8.0", - "prebuild-install": "2.3.0" + "punycode": "^2.1.0" + } + }, + "utf-8-validate": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-4.0.2.tgz", + "integrity": "sha512-CS63Ssp6zynBQ4IxVzgjP5Abdo6LuJ87HFIcgIiVUeY96+MTHkqKtrUhphbwQ6jX8aSGZv8zX6l1DCPpfcAnxA==", + "dev": true, + "requires": { + "bindings": "~1.3.0", + "nan": "~2.10.0", + "prebuild-install": "~4.0.0" } }, "util-deprecate": { @@ -1381,30 +2115,29 @@ "dev": true }, "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, "wide-align": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "requires": { - "string-width": "1.0.2" + "string-width": "^1.0.2 || 2" } }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true, - "optional": true - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -1417,12 +2150,21 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "ws": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.0.0.tgz", - "integrity": "sha512-XXG4S0b771C68AeTHebBsJJBZMguxj7Em+D657RViuj6ppRd3tfuOhIK8eGwZGNb76C8MjQfCTfH2NN50rJN4w==", + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, "requires": { - "async-limiter": "1.0.0" + "mkdirp": "^0.5.1" + } + }, + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "requires": { + "async-limiter": "~1.0.0" } }, "xmlcreate": { @@ -1431,18 +2173,11 @@ "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", "dev": true }, - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "optional": true, - "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", - "window-size": "0.1.0" - } + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true } } } diff --git a/vendor/git.apache.org/thrift.git/package.json b/vendor/git.apache.org/thrift.git/package.json index 94ff766..722ae7d 100644 --- a/vendor/git.apache.org/thrift.git/package.json +++ b/vendor/git.apache.org/thrift.git/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://git-wip-us.apache.org/repos/asf/thrift.git" }, - "version": "1.0.0-dev", + "version": "0.12.0", "author": { "name": "Apache Thrift Developers", "email": "dev@thrift.apache.org", @@ -43,15 +43,24 @@ "buffer-equals": "^1.0.4", "commander": "^2.14.1", "connect": "^3.6.6", + "eslint": "^5.7.0", + "eslint-config-prettier": "^3.1.0", + "eslint-plugin-prettier": "^3.0.0", "istanbul": "^0.4.5", "jsdoc": "^3.5.5", - "prettier": "1.11.1", + "prettier": "^1.14.3", "tape": "^4.9.0", - "utf-8-validate": "^4.0.0" + "utf-8-validate": "^4.0.0", + "typescript": "^3.1.6", + "@types/node": "^10.12.6", + "@types/q": "^1.5.1" }, "scripts": { "cover": "lib/nodejs/test/testAll.sh COVER", "test": "lib/nodejs/test/testAll.sh", - "prettier": "prettier --write '**/*.js'" + "test-ts": "lib/nodets/test/testAll.sh", + "prettier": "prettier --write '**/*.js'", + "lint": "eslint lib/nodejs/. --ext .js", + "lint-tests": "eslint lib/nodejs/test/. --ext .js" } } diff --git a/vendor/git.apache.org/thrift.git/sonar-project.properties b/vendor/git.apache.org/thrift.git/sonar-project.properties index aebeff0..ef11517 100755 --- a/vendor/git.apache.org/thrift.git/sonar-project.properties +++ b/vendor/git.apache.org/thrift.git/sonar-project.properties @@ -16,7 +16,7 @@ development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between all major languages. # Apache Thrift Version -sonar.projectVersion=1.0.0-dev +sonar.projectVersion=0.12.0 # use this to set another version string # $ sonar-runner -D sonar.projectVersion=`git rev-parse HEAD` # set projectDate in combination with projectVersion for imports of old releases @@ -54,7 +54,7 @@ module1.sonar.projectName=Apache Thrift - Java Library module1.sonar.projectBaseDir=lib/java module1.sonar.sources=src module1.sonar.tests=test -module1.sonar.binaries=build/libs/libthrift-1.0.0.jar +module1.sonar.binaries=build/libs/libthrift-0.12.0.jar module1.sonar.libraries=build/deps/*.jar module1.sonar.language=java @@ -62,7 +62,7 @@ module2.sonar.projectName=Apache Thrift - Java Tutorial module2.sonar.projectBaseDir=. module2.sonar.sources=tutorial/java/src, tutorial/java/gen-java module2.sonar.binaries=tutorial/java/tutorial.jar -module2.sonar.libraries=lib/java/build/deps/*.jar,lib/java/build/libs/libthrift-1.0.0.jar +module2.sonar.libraries=lib/java/build/deps/*.jar,lib/java/build/libs/libthrift-0.12.0.jar module2.sonar.language=java module3.sonar.projectName=Apache Thrift - JavaScript Library diff --git a/vendor/git.apache.org/thrift.git/test/ThriftTest.thrift b/vendor/git.apache.org/thrift.git/test/ThriftTest.thrift index bff4e52..3499ab5 100644 --- a/vendor/git.apache.org/thrift.git/test/ThriftTest.thrift +++ b/vendor/git.apache.org/thrift.git/test/ThriftTest.thrift @@ -196,7 +196,7 @@ service ThriftTest * @return binary - returns the binary 'thing' */ binary testBinary(1: binary thing), - + /** * Prints 'testStruct("{%s}")' where thing has been formatted into a string of comma separated values * @param Xtruct thing - the Xtruct to print diff --git a/vendor/git.apache.org/thrift.git/test/cpp/src/TestClient.cpp b/vendor/git.apache.org/thrift.git/test/cpp/src/TestClient.cpp index 54b43db..ca21326 100644 --- a/vendor/git.apache.org/thrift.git/test/cpp/src/TestClient.cpp +++ b/vendor/git.apache.org/thrift.git/test/cpp/src/TestClient.cpp @@ -516,8 +516,8 @@ int main(int argc, char** argv) { BASETYPE_IDENTITY_TEST(testI32, -1); BASETYPE_IDENTITY_TEST(testI32, 190000013); BASETYPE_IDENTITY_TEST(testI32, -190000013); - BASETYPE_IDENTITY_TEST(testI32, numeric_limits::max()); - BASETYPE_IDENTITY_TEST(testI32, numeric_limits::min()); + BASETYPE_IDENTITY_TEST(testI32, (numeric_limits::max)()); + BASETYPE_IDENTITY_TEST(testI32, (numeric_limits::min)()); /** * I64 TEST @@ -530,8 +530,8 @@ int main(int argc, char** argv) { BASETYPE_IDENTITY_TEST(testI64, (int64_t)-pow(static_cast(2LL), 32)); BASETYPE_IDENTITY_TEST(testI64, (int64_t)pow(static_cast(2LL), 32) + 1); BASETYPE_IDENTITY_TEST(testI64, (int64_t)-pow(static_cast(2LL), 32) - 1); - BASETYPE_IDENTITY_TEST(testI64, numeric_limits::max()); - BASETYPE_IDENTITY_TEST(testI64, numeric_limits::min()); + BASETYPE_IDENTITY_TEST(testI64, (numeric_limits::max)()); + BASETYPE_IDENTITY_TEST(testI64, (numeric_limits::min)()); /** * DOUBLE TEST diff --git a/vendor/git.apache.org/thrift.git/test/crossrunner/run.py b/vendor/git.apache.org/thrift.git/test/crossrunner/run.py index a7bc939..ef8fb60 100644 --- a/vendor/git.apache.org/thrift.git/test/crossrunner/run.py +++ b/vendor/git.apache.org/thrift.git/test/crossrunner/run.py @@ -152,7 +152,7 @@ def exec_context(port, logdir, test, prog, is_server): return ExecutionContext(prog.command, prog.workdir, prog.env, prog.stop_signal, is_server, report) -def run_test(testdir, logdir, test_dict, max_retry, async=True): +def run_test(testdir, logdir, test_dict, max_retry, async_mode=True): logger = multiprocessing.get_logger() def ensure_socket_open(sv, port, test): @@ -255,13 +255,13 @@ def run_test(testdir, logdir, test_dict, max_retry, async=True): logger.info('[%s-%s]: test failed, retrying...', test.server.name, test.client.name) retry_count += 1 except Exception: - if not async: + if not async_mode: raise logger.warn('Error executing [%s]', test.name, exc_info=True) return (retry_count, RESULT_ERROR) except: logger.info('Interrupted execution', exc_info=True) - if not async: + if not async_mode: raise stop.set() return (retry_count, RESULT_ERROR) @@ -385,7 +385,7 @@ class TestDispatcher(object): ports = m.ports() def _dispatch_sync(self, test, cont, max_retry): - r = run_test(self.testdir, self.logdir, test, max_retry, False) + r = run_test(self.testdir, self.logdir, test, max_retry, async_mode=False) cont(r) return NonAsyncResult(r) diff --git a/vendor/git.apache.org/thrift.git/test/csharp/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/test/csharp/Properties/AssemblyInfo.cs index b1101a1..d7e04b5 100644 --- a/vendor/git.apache.org/thrift.git/test/csharp/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/test/csharp/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.12.0.0")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/vendor/git.apache.org/thrift.git/test/csharp/ThriftTest.csproj b/vendor/git.apache.org/thrift.git/test/csharp/ThriftTest.csproj index 65c0daf..363627f 100644 --- a/vendor/git.apache.org/thrift.git/test/csharp/ThriftTest.csproj +++ b/vendor/git.apache.org/thrift.git/test/csharp/ThriftTest.csproj @@ -46,7 +46,7 @@ false true 0 - 1.0.0.%2a + 0.12.0.%2a false true @@ -138,4 +138,4 @@ for %25%25I in ("%25THRIFT_FILE%25") do set THRIFT_SHORT=%25%25~fsI "$(ProjectDir)\..\..\compiler\cpp\thrift.exe" --gen csharp -o %25SHORT_DIR%25 %25THRIFT_SHORT%25 $(MSBuildToolsPath)\Csc.exe /t:library /out:"$(ProjectDir)ThriftImpl.dll" /recurse:"$(ProjectDir)gen-csharp"\* /reference:"$(ProjectDir)..\..\lib\csharp\bin\Debug\Thrift.dll" - \ No newline at end of file + diff --git a/vendor/git.apache.org/thrift.git/test/dart/test_client/pubspec.yaml b/vendor/git.apache.org/thrift.git/test/dart/test_client/pubspec.yaml index a91aa45..63428b7 100644 --- a/vendor/git.apache.org/thrift.git/test/dart/test_client/pubspec.yaml +++ b/vendor/git.apache.org/thrift.git/test/dart/test_client/pubspec.yaml @@ -16,7 +16,7 @@ # under the License. name: thrift_test_client -version: 1.0.0-dev +version: 0.12.0 description: A client integration test for the Dart Thrift library author: Apache Thrift Developers homepage: http://thrift.apache.org diff --git a/vendor/git.apache.org/thrift.git/test/erl/src/thrift_test.app.src b/vendor/git.apache.org/thrift.git/test/erl/src/thrift_test.app.src index 7896a95..f166cc4 100644 --- a/vendor/git.apache.org/thrift.git/test/erl/src/thrift_test.app.src +++ b/vendor/git.apache.org/thrift.git/test/erl/src/thrift_test.app.src @@ -22,7 +22,7 @@ {description, "Thrift cross language test"}, % The version of the applicaton - {vsn, "1.0.0-dev"}, + {vsn, "0.12.0"}, % All modules used by the application. {modules, [ diff --git a/vendor/git.apache.org/thrift.git/test/known_failures_Linux.json b/vendor/git.apache.org/thrift.git/test/known_failures_Linux.json index 24ce997..1ab2af5 100644 --- a/vendor/git.apache.org/thrift.git/test/known_failures_Linux.json +++ b/vendor/git.apache.org/thrift.git/test/known_failures_Linux.json @@ -212,6 +212,7 @@ "d-nodejs_json_framed-ip-ssl", "d-nodejs_json_http-ip", "d-nodejs_json_http-ip-ssl", + "d-nodets_binary_buffered-ip", "d-py3_binary-accel_buffered-ip", "d-py3_binary-accel_buffered-ip-ssl", "d-py3_binary-accel_framed-ip", @@ -278,6 +279,7 @@ "erl-csharp_compact_buffered-ip", "erl-nodejs_binary_buffered-ip", "erl-nodejs_compact_buffered-ip", + "erl-nodets_binary_buffered-ip", "erl-rb_binary-accel_buffered-ip", "erl-rb_binary-accel_buffered-ip-ssl", "erl-rb_binary-accel_framed-ip", diff --git a/vendor/git.apache.org/thrift.git/test/perl/TestClient.pl b/vendor/git.apache.org/thrift.git/test/perl/TestClient.pl index 990274c..96e3bec 100755 --- a/vendor/git.apache.org/thrift.git/test/perl/TestClient.pl +++ b/vendor/git.apache.org/thrift.git/test/perl/TestClient.pl @@ -45,7 +45,7 @@ use ThriftTest::Types; $|++; sub usage { - print <new($opts{'domain-socket'}); +} +elsif ($opts{ssl}) { + $socket = Thrift::SSLSocket->new(\%opts); +} +else { + $socket = Thrift::Socket->new($opts{host}, $opts{port}); } my $transport; if ($opts{transport} eq 'buffered') { - $transport = new Thrift::BufferedTransport($socket, 1024, 1024); -} elsif ($opts{transport} eq 'framed') { - $transport = new Thrift::FramedTransport($socket); -} else { + $transport = Thrift::BufferedTransport->new($socket, 1024, 1024); +} +elsif ($opts{transport} eq 'framed') { + $transport = Thrift::FramedTransport->new($socket); +} +else { usage(); exit 1; } @@ -112,20 +116,21 @@ if ($opts{transport} eq 'buffered') { my $protocol; my $protocol2; if ($opts{protocol} eq 'binary' || $opts{protocol} eq 'multi') { - $protocol = new Thrift::BinaryProtocol($transport); -} else { + $protocol = Thrift::BinaryProtocol->new($transport); +} +else { usage(); exit 1; } my $secondService = undef; if (index($opts{protocol}, 'multi') == 0) { - $protocol2 = new Thrift::MultiplexedProtocol($protocol, "SecondService"); - $protocol = new Thrift::MultiplexedProtocol($protocol, "ThriftTest"); - $secondService = new ThriftTest::SecondServiceClient($protocol2); + $protocol2 = Thrift::MultiplexedProtocol->new($protocol, 'SecondService'); + $protocol = Thrift::MultiplexedProtocol->new($protocol, 'ThriftTest'); + $secondService = ThriftTest::SecondServiceClient->new($protocol2); } -my $testClient = new ThriftTest::ThriftTestClient($protocol); +my $testClient = ThriftTest::ThriftTestClient->new($protocol); eval { $transport->open(); @@ -146,52 +151,52 @@ my $start = gettimeofday(); # # VOID TEST # -print("testVoid()"); +print('testVoid()'); $testClient->testVoid(); print(" = void\n"); # # STRING TEST # -print("testString(\"Test\")"); -my $s = $testClient->testString("Test"); -print(" = \"$s\"\n"); +print('testString("Test")'); +my $s = $testClient->testString('Test'); +print(qq| = "$s"\n|); exit(ERR_BASETYPES) if ($s ne 'Test'); # # MULTIPLEXED TEST # if (index($opts{protocol}, 'multi') == 0) { - print("secondtestString(\"Test2\")"); - $s = $secondService->secondtestString("Test2"); - print(" = \"$s\"\n"); + print('secondtestString("Test2")'); + $s = $secondService->secondtestString('Test2'); + print(qq| = "$s"\n|); exit(ERR_PROTOCOL) if ($s ne 'testString("Test2")'); } # # BOOL TEST # -print("testBool(1)"); +print('testBool(1)'); my $t = $testClient->testBool(1); print(" = $t\n"); exit(ERR_BASETYPES) if ($t ne 1); -print("testBool(0)"); +print('testBool(0)'); my $f = $testClient->testBool(0); print(" = $f\n"); -exit(ERR_BASETYPES) if ($f ne ""); +exit(ERR_BASETYPES) if ($f ne q||); # # BYTE TEST # -print("testByte(1)"); +print('testByte(1)'); my $u8 = $testClient->testByte(1); print(" = $u8\n"); # # I32 TEST # -print("testI32(-1)"); +print('testI32(-1)'); my $i32 = $testClient->testI32(-1); print(" = $i32\n"); exit(ERR_BASETYPES) if ($i32 ne -1); @@ -199,7 +204,7 @@ exit(ERR_BASETYPES) if ($i32 ne -1); # # I64 TEST # -print("testI64(-34359738368)"); +print('testI64(-34359738368)'); my $i64 = $testClient->testI64(-34359738368); print(" = $i64\n"); exit(ERR_BASETYPES) if ($i64 ne -34359738368); @@ -207,7 +212,7 @@ exit(ERR_BASETYPES) if ($i64 ne -34359738368); # # DOUBLE TEST # -print("testDouble(-852.234234234)"); +print('testDouble(-852.234234234)'); my $dub = $testClient->testDouble(-852.234234234); print(" = $dub\n"); exit(ERR_BASETYPES) if ($dub ne -852.234234234); @@ -220,33 +225,33 @@ exit(ERR_BASETYPES) if ($dub ne -852.234234234); # # STRUCT TEST # -print("testStruct({\"Zero\", 1, -3, -5})"); -my $out = new ThriftTest::Xtruct(); -$out->string_thing("Zero"); +print('testStruct({"Zero", 1, -3, -5})'); +my $out = ThriftTest::Xtruct->new(); +$out->string_thing('Zero'); $out->byte_thing(1); $out->i32_thing(-3); $out->i64_thing(-5); my $in = $testClient->testStruct($out); -print(" = {\"".$in->string_thing."\", ". - $in->byte_thing.", ". - $in->i32_thing.", ". +print(' = {"'.$in->string_thing.'", '. + $in->byte_thing.', '. + $in->i32_thing.', '. $in->i64_thing."}\n"); # # NESTED STRUCT TEST # -print("testNest({1, {\"Zero\", 1, -3, -5}, 5}"); -my $out2 = new ThriftTest::Xtruct2(); +print('testNest({1, {"Zero", 1, -3, -5}, 5}'); +my $out2 = ThriftTest::Xtruct2->new(); $out2->byte_thing(1); $out2->struct_thing($out); $out2->i32_thing(5); my $in2 = $testClient->testNest($out2); $in = $in2->struct_thing; -print(" = {".$in2->byte_thing.", {\"". - $in->string_thing."\", ". - $in->byte_thing.", ". - $in->i32_thing.", ". - $in->i64_thing."}, ". +print(' = {'.$in2->byte_thing.', {"'. + $in->string_thing.'", '. + $in->byte_thing.', '. + $in->i32_thing.', '. + $in->i64_thing.'}, '. $in2->i32_thing."}\n"); # @@ -256,28 +261,30 @@ my $mapout = {}; for (my $i = 0; $i < 5; ++$i) { $mapout->{$i} = $i-10; } -print("testMap({"); +print('testMap({'); my $first = 1; while( my($key,$val) = each %$mapout) { if ($first) { $first = 0; - } else { - print(", "); + } + else { + print(', '); } print("$key => $val"); } -print("})"); +print('})'); my $mapin = $testClient->testMap($mapout); -print(" = {"); +print(' = {'); $first = 1; while( my($key,$val) = each %$mapin){ if ($first) { $first = 0; - } else { - print(", "); + } + else { + print(', '); } print("$key => $val"); } @@ -291,11 +298,11 @@ for (my $i = -2; $i < 3; ++$i) { push(@$setout, $i); } -print("testSet({".join(",",@$setout)."})"); +print('testSet({'.join(',',@$setout).'})'); my $setin = $testClient->testSet($setout); -print(" = {".join(",",@$setout)."}\n"); +print(' = {'.join(',',@$setout)."}\n"); # # LIST TEST @@ -305,111 +312,111 @@ for (my $i = -2; $i < 3; ++$i) { push(@$listout, $i); } -print("testList({".join(",",@$listout)."})"); +print('testList({'.join(',',@$listout).'})'); my $listin = $testClient->testList($listout); -print(" = {".join(",",@$listin)."}\n"); +print(' = {'.join(',',@$listin)."}\n"); # # ENUM TEST # -print("testEnum(ONE)"); +print('testEnum(ONE)'); my $ret = $testClient->testEnum(ThriftTest::Numberz::ONE); print(" = $ret\n"); -print("testEnum(TWO)"); +print('testEnum(TWO)'); $ret = $testClient->testEnum(ThriftTest::Numberz::TWO); print(" = $ret\n"); -print("testEnum(THREE)"); +print('testEnum(THREE)'); $ret = $testClient->testEnum(ThriftTest::Numberz::THREE); print(" = $ret\n"); -print("testEnum(FIVE)"); +print('testEnum(FIVE)'); $ret = $testClient->testEnum(ThriftTest::Numberz::FIVE); print(" = $ret\n"); -print("testEnum(EIGHT)"); +print('testEnum(EIGHT)'); $ret = $testClient->testEnum(ThriftTest::Numberz::EIGHT); print(" = $ret\n"); # # TYPEDEF TEST # -print("testTypedef(309858235082523)"); +print('testTypedef(309858235082523)'); my $uid = $testClient->testTypedef(309858235082523); print(" = $uid\n"); # # NESTED MAP TEST # -print("testMapMap(1)"); +print('testMapMap(1)'); my $mm = $testClient->testMapMap(1); -print(" = {"); +print(' = {'); while( my ($key,$val) = each %$mm) { print("$key => {"); while( my($k2,$v2) = each %$val) { print("$k2 => $v2, "); } - print("}, "); + print('}, '); } print("}\n"); # # INSANITY TEST # -my $insane = new ThriftTest::Insanity(); +my $insane = ThriftTest::Insanity->new(); $insane->{userMap}->{ThriftTest::Numberz::FIVE} = 5000; -my $truck = new ThriftTest::Xtruct(); -$truck->string_thing("Hello2"); +my $truck = ThriftTest::Xtruct->new(); +$truck->string_thing('Hello2'); $truck->byte_thing(2); $truck->i32_thing(2); $truck->i64_thing(2); -my $truck2 = new ThriftTest::Xtruct(); -$truck2->string_thing("Goodbye4"); +my $truck2 = ThriftTest::Xtruct->new(); +$truck2->string_thing('Goodbye4'); $truck2->byte_thing(4); $truck2->i32_thing(4); $truck2->i64_thing(4); push(@{$insane->{xtructs}}, $truck); push(@{$insane->{xtructs}}, $truck2); -print("testInsanity()"); +print('testInsanity()'); my $whoa = $testClient->testInsanity($insane); -print(" = {"); +print(' = {'); while( my ($key,$val) = each %$whoa) { print("$key => {"); while( my($k2,$v2) = each %$val) { print("$k2 => {"); my $userMap = $v2->{userMap}; - print("{"); - if (ref($userMap) eq "HASH") { + print('{'); + if (ref($userMap) eq 'HASH') { while( my($k3,$v3) = each %$userMap) { print("$k3 => $v3, "); } } - print("}, "); + print('}, '); my $xtructs = $v2->{xtructs}; - print("{"); - if (ref($xtructs) eq "ARRAY") { + print('{'); + if (ref($xtructs) eq 'ARRAY') { foreach my $x (@$xtructs) { - print("{\"".$x->{string_thing}."\", ". - $x->{byte_thing}.", ".$x->{i32_thing}.", ".$x->{i64_thing}."}, "); + print('{"'.$x->{string_thing}.'", '. + $x->{byte_thing}.', '.$x->{i32_thing}.', '.$x->{i64_thing}.'}, '); } } - print("}"); + print('}'); - print("}, "); + print('}, '); } - print("}, "); + print('}, '); } print("}\n"); # # EXCEPTION TEST # -print("testException('Xception')"); +print(q|testException('Xception')|); eval { $testClient->testException('Xception'); print(" void\nFAILURE\n"); @@ -422,7 +429,7 @@ eval { # Normal tests done. # my $stop = gettimeofday(); -my $elp = sprintf("%d",1000*($stop - $start), 0); +my $elp = sprintf('%d',1000*($stop - $start), 0); print("Total time: $elp ms\n"); # diff --git a/vendor/git.apache.org/thrift.git/test/perl/TestServer.pl b/vendor/git.apache.org/thrift.git/test/perl/TestServer.pl index e8c1cfa..d2b9a38 100644 --- a/vendor/git.apache.org/thrift.git/test/perl/TestServer.pl +++ b/vendor/git.apache.org/thrift.git/test/perl/TestServer.pl @@ -27,7 +27,7 @@ use Getopt::Long qw(GetOptions); use Time::HiRes qw(gettimeofday); $SIG{INT} = \&sigint_handler; - + use lib '../../lib/perl/lib'; use lib 'gen-perl'; @@ -48,7 +48,7 @@ use ThriftTest::Types; $|++; sub usage { - print <new(); +my $handler2 = SecondServiceHandler->new(); +my $processor = ThriftTest::ThriftTestProcessor->new($handler); +my $processor2 = ThriftTest::SecondServiceProcessor->new($handler2); + my $serversocket; -if ($opts{"domain-socket"}) { - unlink($opts{"domain-socket"}); - $serversocket = new Thrift::UnixServerSocket($opts{"domain-socket"}); -} elsif ($opts{ssl}) { - $serversocket = new Thrift::SSLServerSocket(\%opts); -} else { - $serversocket = new Thrift::ServerSocket(\%opts); +if ($opts{'domain-socket'}) { + unlink($opts{'domain-socket'}); + $serversocket = Thrift::UnixServerSocket->new($opts{'domain-socket'}); +} +elsif ($opts{ssl}) { + $serversocket = Thrift::SSLServerSocket->new(\%opts); +} +else { + $serversocket = Thrift::ServerSocket->new(\%opts); } my $transport; if ($opts{transport} eq 'buffered') { - $transport = new Thrift::BufferedTransportFactory(); -} elsif ($opts{transport} eq 'framed') { - $transport = new Thrift::FramedTransportFactory(); -} else { + $transport = Thrift::BufferedTransportFactory->new(); +} +elsif ($opts{transport} eq 'framed') { + $transport = Thrift::FramedTransportFactory->new(); +} +else { usage(); exit 1; } my $protocol; if ($opts{protocol} eq 'binary' || $opts{protocol} eq 'multi') { - $protocol = new Thrift::BinaryProtocolFactory(); -} else { + $protocol = Thrift::BinaryProtocolFactory->new(); +} +else { usage(); exit 1; } if (index($opts{protocol}, 'multi') == 0) { - my $newProcessor = new Thrift::MultiplexedProcessor($protocol); + my $newProcessor = Thrift::MultiplexedProcessor->new($protocol); $newProcessor->defaultProcessor($processor); - $newProcessor->registerProcessor("ThriftTest", $processor); - $newProcessor->registerProcessor("SecondService", $processor2); + $newProcessor->registerProcessor('ThriftTest', $processor); + $newProcessor->registerProcessor('SecondService', $processor2); $processor = $newProcessor; } my $ssltag = ''; if ($opts{ssl}) { - $ssltag = "(SSL)"; + $ssltag = '(SSL)'; } my $listening_on = "$opts{port} $ssltag"; -if ($opts{"domain-socket"}) { - $listening_on = $opts{"domain-socket"}; +if ($opts{'domain-socket'}) { + $listening_on = $opts{'domain-socket'}; } -my $server = new Thrift::SimpleServer($processor, $serversocket, $transport, $protocol); -print "Starting \"simple\" server ($opts{transport}/$opts{protocol}) listen on: $listening_on\n"; +my $server = Thrift::SimpleServer->new($processor, $serversocket, $transport, $protocol); +print qq|Starting "simple" server ($opts{transport}/$opts{protocol}) listen on: $listening_on\n|; $server->serve(); print "done.\n"; @@ -169,70 +175,67 @@ sub new { return bless($self, $classname); } -sub testVoid() { +sub testVoid { print("testVoid()\n"); } -sub testString() { +sub testString { my $self = shift; my $thing = shift; print("testString($thing)\n"); return $thing; } -sub testBool() { +sub testBool { my $self = shift; my $thing = shift; - my $str = $thing ? "true" : "false"; + my $str = $thing ? 'true' : 'false'; print("testBool($str)\n"); return $thing; } -sub testByte() { +sub testByte { my $self = shift; my $thing = shift; print("testByte($thing)\n"); return $thing; } -sub testI32() { +sub testI32 { my $self = shift; my $thing = shift; print("testI32($thing)\n"); return $thing; } -sub testI64() { +sub testI64 { my $self = shift; my $thing = shift; print("testI64($thing)\n"); return $thing; } -sub testDouble() { +sub testDouble { my $self = shift; my $thing = shift; print("testDouble($thing)\n"); return $thing; } -sub testBinary() { +sub testBinary { my $self = shift; my $thing = shift; my @bytes = split //, $thing; - print("testBinary("); - foreach (@bytes) - { - printf "%02lx", ord $_; - } - print(")\n"); + print 'testBinary('; + printf( '%02lx', ord $_ ) foreach (@bytes); + print ")\n"; return $thing; } -sub testStruct() { +sub testStruct { my $self = shift; my $thing = shift; - printf("testStruct({\"%s\", %d, %d, %lld})\n", + printf(qq|testStruct({"%s", %d, %d, %lld})\n|, $thing->{string_thing}, $thing->{byte_thing}, $thing->{i32_thing}, @@ -240,11 +243,11 @@ sub testStruct() { return $thing; } -sub testNest() { +sub testNest { my $self = shift; my $nest = shift; my $thing = $nest->{struct_thing}; - printf("testNest({%d, {\"%s\", %d, %d, %lld}, %d})\n", + printf(qq|testNest({%d, {"%s", %d, %d, %lld}, %d})\n|, $nest->{byte_thing}, $thing->{string_thing}, $thing->{byte_thing}, @@ -254,92 +257,58 @@ sub testNest() { return $nest; } -sub testMap() { +sub testMap { my $self = shift; my $thing = shift; - print("testMap({"); - my $first = 1; - foreach my $key (keys %$thing) { - if ($first) { - $first = 0; - } else { - print(", "); - } - print("$key => $thing->{$key}"); - } - print("})\n"); + printf "testMap({%s})\n", + join( ', ', + map { $_ . ' => ' . $thing->{$_} } + sort keys %$thing + ); return $thing; } -sub testStringMap() { +sub testStringMap { my $self = shift; my $thing = shift; - print("testStringMap({"); - my $first = 1; - foreach my $key (keys %$thing) { - if ($first) { - $first = 0; - } else { - print(", "); - } - print("$key => $thing->{$key}"); - } - print("})\n"); + printf "testStringMap({%s})\n", + join( ', ', + map { $_ . ' => ' . $thing->{$_} } + sort keys %$thing + ); return $thing; } -sub testSet() { +sub testSet { my $self = shift; my $thing = shift; - my @arr; - my $result = \@arr; - print("testSet({"); - my $first = 1; - foreach my $key (keys %$thing) { - if ($first) { - $first = 0; - } else { - print(", "); - } - print("$key"); - push(@arr, $key); - } - print("})\n"); - return $result; + my @result = sort keys %$thing; + printf "testSet({%s})\n", join(', ', @result ); + return \@result; } -sub testList() { +sub testList { my $self = shift; my $thing = shift; - print("testList({"); - my $first = 1; - foreach my $key (@$thing) { - if ($first) { - $first = 0; - } else { - print(", "); - } - print("$key"); - } - print("})\n"); + print "testList({%s})\n", join(', ', @$thing); return $thing; } -sub testEnum() { +sub testEnum { my $self = shift; my $thing = shift; - print("testEnum($thing)\n"); + print "testEnum($thing)\n"; return $thing; } -sub testTypedef() { +sub testTypedef { my $self = shift; my $thing = shift; print("testTypedef($thing)\n"); return $thing; } -sub testMapMap() { +sub testMapMap { my $self = shift; my $hello = shift; @@ -348,25 +317,25 @@ sub testMapMap() { return $result; } -sub testInsanity() { +sub testInsanity { my $self = shift; my $argument = shift; print("testInsanity()\n"); - my $hello = new ThriftTest::Xtruct({string_thing => "Hello2", byte_thing => 2, i32_thing => 2, i64_thing => 2}); + my $hello = ThriftTest::Xtruct->new({string_thing => 'Hello2', byte_thing => 2, i32_thing => 2, i64_thing => 2}); my @hellos; push(@hellos, $hello); - my $goodbye = new ThriftTest::Xtruct({string_thing => "Goodbye4", byte_thing => 4, i32_thing => 4, i64_thing => 4}); + my $goodbye = ThriftTest::Xtruct->new({string_thing => 'Goodbye4', byte_thing => 4, i32_thing => 4, i64_thing => 4}); my @goodbyes; push(@goodbyes, $goodbye); - my $crazy = new ThriftTest::Insanity({userMap => { ThriftTest::Numberz::EIGHT => 8 }, xtructs => \@goodbyes}); - my $loony = new ThriftTest::Insanity(); + my $crazy = ThriftTest::Insanity->new({userMap => { ThriftTest::Numberz::EIGHT => 8 }, xtructs => \@goodbyes}); + my $loony = ThriftTest::Insanity->new(); my $result = { 1 => { ThriftTest::Numberz::TWO => $argument, ThriftTest::Numberz::THREE => $argument }, 2 => { ThriftTest::Numberz::SIX => $loony } }; return $result; } -sub testMulti() { +sub testMulti { my $self = shift; my $arg0 = shift; my $arg1 = shift; @@ -376,39 +345,43 @@ sub testMulti() { my $arg5 = shift; print("testMulti()\n"); - return new ThriftTest::Xtruct({string_thing => "Hello2", byte_thing => $arg0, i32_thing => $arg1, i64_thing => $arg2}); + return ThriftTest::Xtruct->new({string_thing => 'Hello2', byte_thing => $arg0, i32_thing => $arg1, i64_thing => $arg2}); } -sub testException() { +sub testException { my $self = shift; my $arg = shift; print("testException($arg)\n"); - if ($arg eq "Xception") { - die new ThriftTest::Xception({errorCode => 1001, message => $arg}); - } elsif ($arg eq "TException") { - die "astring"; # all unhandled exceptions become TExceptions - } else { - return new ThriftTest::Xtruct({string_thing => $arg}); + if ($arg eq 'Xception') { + die ThriftTest::Xception->new({errorCode => 1001, message => $arg}); + } + elsif ($arg eq 'TException') { + die 'astring'; # all unhandled exceptions become TExceptions + } + else { + return ThriftTest::Xtruct->new({string_thing => $arg}); } } -sub testMultiException() { +sub testMultiException { my $self = shift; my $arg0 = shift; my $arg1 = shift; printf("testMultiException(%s, %s)\n", $arg0, $arg1); - if ($arg0 eq "Xception") { - die new ThriftTest::Xception({errorCode => 1001, message => "This is an Xception"}); - } elsif ($arg0 eq "Xception2") { - my $struct_thing = new ThriftTest::Xtruct({string_thing => "This is an Xception2"}); - die new ThriftTest::Xception2({errorCode => 2002, struct_thing => $struct_thing}); - } else { - return new ThriftTest::Xtruct({string_thing => $arg1}); + if ($arg0 eq 'Xception') { + die ThriftTest::Xception->new({errorCode => 1001, message => 'This is an Xception'}); + } + elsif ($arg0 eq 'Xception2') { + my $struct_thing = ThriftTest::Xtruct->new({string_thing => 'This is an Xception2'}); + die ThriftTest::Xception2->new({errorCode => 2002, struct_thing => $struct_thing}); + } + else { + return ThriftTest::Xtruct->new({string_thing => $arg1}); } } -sub testOneway() { +sub testOneway { my $self = shift; my $num = shift; print("testOneway($num): received\n"); @@ -428,11 +401,11 @@ sub new { return bless($self, $classname); } -sub secondtestString() { +sub secondtestString { my $self = shift; my $thing = shift; print("testString($thing)\n"); - return "testString(\"" . $thing . "\")"; + return qq|testString("$thing")|; } 1; diff --git a/vendor/git.apache.org/thrift.git/test/rs/src/bin/test_client.rs b/vendor/git.apache.org/thrift.git/test/rs/src/bin/test_client.rs index 297faf9..29b5b88 100644 --- a/vendor/git.apache.org/thrift.git/test/rs/src/bin/test_client.rs +++ b/vendor/git.apache.org/thrift.git/test/rs/src/bin/test_client.rs @@ -216,7 +216,7 @@ fn make_thrift_calls( info!("testEnum"); { - verify_expected_result(thrift_test_client.test_enum(Numberz::TWO), Numberz::TWO)?; + verify_expected_result(thrift_test_client.test_enum(Numberz::Two), Numberz::Two)?; } info!("testBinary"); @@ -391,7 +391,7 @@ fn make_thrift_calls( }; verify_expected_result( - thrift_test_client.test_multi(1, -123948, -19234123981, m_snd, Numberz::EIGHT, 81), + thrift_test_client.test_multi(1, -123948, -19234123981, m_snd, Numberz::Eight, 81), s_cmp, )?; } @@ -405,8 +405,8 @@ fn make_thrift_calls( // } { let mut arg_map_usermap: BTreeMap = BTreeMap::new(); - arg_map_usermap.insert(Numberz::ONE, 4289); - arg_map_usermap.insert(Numberz::EIGHT, 19); + arg_map_usermap.insert(Numberz::One, 4289); + arg_map_usermap.insert(Numberz::Eight, 19); let mut arg_vec_xtructs: Vec = Vec::new(); arg_vec_xtructs.push( @@ -439,15 +439,15 @@ fn make_thrift_calls( user_map: Some(arg_map_usermap), xtructs: Some(arg_vec_xtructs), }; - s_cmp_nested_1.insert(Numberz::TWO, insanity.clone()); - s_cmp_nested_1.insert(Numberz::THREE, insanity.clone()); + s_cmp_nested_1.insert(Numberz::Two, insanity.clone()); + s_cmp_nested_1.insert(Numberz::Three, insanity.clone()); let mut s_cmp_nested_2: BTreeMap = BTreeMap::new(); let empty_insanity = Insanity { user_map: Some(BTreeMap::new()), xtructs: Some(Vec::new()), }; - s_cmp_nested_2.insert(Numberz::SIX, empty_insanity); + s_cmp_nested_2.insert(Numberz::Six, empty_insanity); let mut s_cmp: BTreeMap> = BTreeMap::new(); s_cmp.insert(1 as UserId, s_cmp_nested_1); diff --git a/vendor/git.apache.org/thrift.git/test/rs/src/bin/test_server.rs b/vendor/git.apache.org/thrift.git/test/rs/src/bin/test_server.rs index 1976bf4..81c1ec7 100644 --- a/vendor/git.apache.org/thrift.git/test/rs/src/bin/test_server.rs +++ b/vendor/git.apache.org/thrift.git/test/rs/src/bin/test_server.rs @@ -273,15 +273,15 @@ impl ThriftTestSyncHandler for ThriftTestSyncHandlerImpl { ) -> thrift::Result>> { info!("testInsanity({:?})", argument); let mut map_0: BTreeMap = BTreeMap::new(); - map_0.insert(Numberz::TWO, argument.clone()); - map_0.insert(Numberz::THREE, argument.clone()); + map_0.insert(Numberz::Two, argument.clone()); + map_0.insert(Numberz::Three, argument.clone()); let mut map_1: BTreeMap = BTreeMap::new(); let insanity = Insanity { user_map: None, xtructs: None, }; - map_1.insert(Numberz::SIX, insanity); + map_1.insert(Numberz::Six, insanity); let mut ret: BTreeMap> = BTreeMap::new(); ret.insert(1, map_0); diff --git a/vendor/git.apache.org/thrift.git/test/tests.json b/vendor/git.apache.org/thrift.git/test/tests.json index 27e75cc..43d6ded 100644 --- a/vendor/git.apache.org/thrift.git/test/tests.json +++ b/vendor/git.apache.org/thrift.git/test/tests.json @@ -718,5 +718,32 @@ "multic" ], "workdir": "rs/bin" + }, + { + "name": "nodets", + "env": { + "NODE_PATH": "../lib" + }, + "server": { + "command": [ + "runServer.sh" + ] + }, + "client": { + "timeout": 6, + "command": [ + "runClient.sh" + ] + }, + "protocols": [ + "binary" + ], + "sockets": [ + "ip" + ], + "transports": [ + "buffered" + ], + "workdir": "../lib/nodets/test" } ] diff --git a/vendor/git.apache.org/thrift.git/tutorial/cl/Makefile.am b/vendor/git.apache.org/thrift.git/tutorial/cl/Makefile.am index fb6e83a..2b2013a 100755 --- a/vendor/git.apache.org/thrift.git/tutorial/cl/Makefile.am +++ b/vendor/git.apache.org/thrift.git/tutorial/cl/Makefile.am @@ -15,19 +15,30 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -# + +setup-local-lisp-env: ensure-externals.sh + bash ensure-externals.sh gen-cl: $(top_srcdir)/tutorial/tutorial.thrift $(THRIFT) --gen cl -r $< -TutorialServer: make-tutorial-server.lisp +ALL_FILE_PREREQS = \ + load-locally.lisp \ + make-tutorial-server.lisp \ + make-tutorial-client.lisp \ + shared-implementation.lisp \ + thrift-tutorial.asd \ + tutorial-implementation.lisp + +# NOTE: the server and client cannot be built in parallel +# because on loading the make-tutorial-* scripts SBCL will +# attempt to compile their dependencies. Unfortunately, +# because their dependencies are shared, parallel jobs can +# end up overwriting or corrupting the compiled files +all-local: gen-cl setup-local-lisp-env $(ALL_FILE_PREREQS) $(SBCL) --script make-tutorial-server.lisp - -TutorialClient: make-tutorial-client.lisp $(SBCL) --script make-tutorial-client.lisp -all-local: gen-cl TutorialClient TutorialServer - tutorialserver: all ./TutorialServer @@ -35,9 +46,16 @@ tutorialclient: all ./TutorialClient clean-local: - $(RM) -r gen-* - $(RM) TutorialServer - $(RM) TutorialClient + -$(RM) -r gen-* + -$(RM) -r externals + -$(RM) -r quicklisp + -$(RM) -r lib + -$(RM) quicklisp.lisp + -$(RM) backport-update.zip + -$(RM) shared-implementation.fasl + -$(RM) tutorial-implementation.fasl + -$(RM) TutorialServer + -$(RM) TutorialClient EXTRA_DIST = \ tutorial-implementation.lisp \ diff --git a/vendor/git.apache.org/thrift.git/tutorial/cl/ensure-externals.sh b/vendor/git.apache.org/thrift.git/tutorial/cl/ensure-externals.sh new file mode 120000 index 0000000..5ae8c56 --- /dev/null +++ b/vendor/git.apache.org/thrift.git/tutorial/cl/ensure-externals.sh @@ -0,0 +1 @@ +../../lib/cl/ensure-externals.sh \ No newline at end of file diff --git a/vendor/git.apache.org/thrift.git/tutorial/cl/load-locally.lisp b/vendor/git.apache.org/thrift.git/tutorial/cl/load-locally.lisp new file mode 100644 index 0000000..b52a0a2 --- /dev/null +++ b/vendor/git.apache.org/thrift.git/tutorial/cl/load-locally.lisp @@ -0,0 +1,22 @@ +(in-package #:cl-user) + +;;;; 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. + +;;;; Just a script for loading the library itself, using bundled dependencies. +;;;; This is an identical copy of the file in lib/cl. + +(require "asdf") + +(load (merge-pathnames "externals/bundle.lisp" *load-truename*)) +(asdf:load-asd (merge-pathnames "lib/de.setf.thrift-backport-update/thrift.asd" *load-truename*)) +(asdf:load-system :thrift) diff --git a/vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-client.lisp b/vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-client.lisp index 59450a2..3a6d861 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-client.lisp +++ b/vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-client.lisp @@ -13,7 +13,7 @@ ;;;; limitations under the License. (require "asdf") -(load (merge-pathnames "../../lib/cl/load-locally.lisp" *load-truename*)) +(load (merge-pathnames "load-locally.lisp" *load-truename*)) (asdf:load-system :net.didierverna.clon) (asdf:load-asd (merge-pathnames "gen-cl/shared/thrift-gen-shared.asd" *load-truename*)) (asdf:load-asd (merge-pathnames "gen-cl/tutorial/thrift-gen-tutorial.asd" *load-truename*)) diff --git a/vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-server.lisp b/vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-server.lisp index 5621ff3..4cf1a90 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-server.lisp +++ b/vendor/git.apache.org/thrift.git/tutorial/cl/make-tutorial-server.lisp @@ -13,7 +13,7 @@ ;;;; limitations under the License. (require "asdf") -(load (merge-pathnames "../../lib/cl/load-locally.lisp" *load-truename*)) +(load (merge-pathnames "load-locally.lisp" *load-truename*)) (asdf:load-system :net.didierverna.clon) (asdf:load-asd (merge-pathnames "gen-cl/shared/thrift-gen-shared.asd" *load-truename*)) (asdf:load-asd (merge-pathnames "gen-cl/tutorial/thrift-gen-tutorial.asd" *load-truename*)) diff --git a/vendor/git.apache.org/thrift.git/tutorial/csharp/CsharpClient/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/tutorial/csharp/CsharpClient/Properties/AssemblyInfo.cs index 1ff658c..2e7f736 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/csharp/CsharpClient/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/tutorial/csharp/CsharpClient/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.12.0.0")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/vendor/git.apache.org/thrift.git/tutorial/csharp/CsharpServer/Properties/AssemblyInfo.cs b/vendor/git.apache.org/thrift.git/tutorial/csharp/CsharpServer/Properties/AssemblyInfo.cs index 74fa476..14067dd 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/csharp/CsharpServer/Properties/AssemblyInfo.cs +++ b/vendor/git.apache.org/thrift.git/tutorial/csharp/CsharpServer/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.12.0.0")] +[assembly: AssemblyFileVersion("0.12.0.0")] diff --git a/vendor/git.apache.org/thrift.git/tutorial/dart/client/pubspec.yaml b/vendor/git.apache.org/thrift.git/tutorial/dart/client/pubspec.yaml index db64afc..78ee527 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/dart/client/pubspec.yaml +++ b/vendor/git.apache.org/thrift.git/tutorial/dart/client/pubspec.yaml @@ -16,7 +16,7 @@ # under the License. name: tutorial_client -version: 1.0.0-dev +version: 0.12.0 description: A Dart client implementation of the Apache Thrift tutorial author: Apache Thrift Developers homepage: http://thrift.apache.org diff --git a/vendor/git.apache.org/thrift.git/tutorial/dart/console_client/pubspec.yaml b/vendor/git.apache.org/thrift.git/tutorial/dart/console_client/pubspec.yaml index cea13ac..be7328e 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/dart/console_client/pubspec.yaml +++ b/vendor/git.apache.org/thrift.git/tutorial/dart/console_client/pubspec.yaml @@ -16,7 +16,7 @@ # under the License. name: tutorial_console_client -version: 1.0.0-dev +version: 0.12.0 description: > A Dart console client to implementation of the Apache Thrift tutorial author: Apache Thrift Developers diff --git a/vendor/git.apache.org/thrift.git/tutorial/dart/server/pubspec.yaml b/vendor/git.apache.org/thrift.git/tutorial/dart/server/pubspec.yaml index 4833a4a..6c616b3 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/dart/server/pubspec.yaml +++ b/vendor/git.apache.org/thrift.git/tutorial/dart/server/pubspec.yaml @@ -16,7 +16,7 @@ # under the License. name: tutorial_server -version: 1.0.0-dev +version: 0.12.0 description: A Dart server to support the Apache Thrift tutorial author: Apache Thrift Developers homepage: http://thrift.apache.org diff --git a/vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiClient/DelphiClient.dproj b/vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiClient/DelphiClient.dproj index ead7bce..dd58781 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiClient/DelphiClient.dproj +++ b/vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiClient/DelphiClient.dproj @@ -82,8 +82,8 @@ True False - 1 - 0 + 0 + 12 0 0 False @@ -97,7 +97,7 @@ Thrift Tutorial - 1.0.0.0 + 0.12.0.0 DelphiClient Copyright © 2012 The Apache Software Foundation diff --git a/vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiServer/DelphiServer.dproj b/vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiServer/DelphiServer.dproj index a26d952..3f9fc4d 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiServer/DelphiServer.dproj +++ b/vendor/git.apache.org/thrift.git/tutorial/delphi/DelphiServer/DelphiServer.dproj @@ -81,8 +81,8 @@ True False - 1 - 0 + 0 + 12 0 0 False @@ -96,7 +96,7 @@ Thrift Tutorial - 1.0.0.0 + 0.12.0.0 DelphiServer Copyright © 2012 The Apache Software Foundation diff --git a/vendor/git.apache.org/thrift.git/tutorial/go/Makefile.am b/vendor/git.apache.org/thrift.git/tutorial/go/Makefile.am index 87a8f5a..bd57d65 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/go/Makefile.am +++ b/vendor/git.apache.org/thrift.git/tutorial/go/Makefile.am @@ -22,15 +22,15 @@ gen-go/tutorial/calculator.go gen-go/shared/shared_service.go: $(top_srcdir)/tut all-local: gen-go/tutorial/calculator.go -check: src/git.apache.org/thrift.git/lib/go/thrift thirdparty-dep +check: src/github.com/apache/thrift/lib/go/thrift thirdparty-dep $(THRIFT) -r --gen go$(COMPILER_EXTRAFLAG) $(top_srcdir)/tutorial/tutorial.thrift cp -r gen-go/* src/ GOPATH=`pwd` $(GO) build -o go-tutorial ./src GOPATH=`pwd` $(GO) build -o calculator-remote src/tutorial/calculator-remote/calculator-remote.go -src/git.apache.org/thrift.git/lib/go/thrift: - mkdir -p src/git.apache.org/thrift.git/lib/go - ln -sf $(realpath $(top_srcdir)/lib/go/thrift) src/git.apache.org/thrift.git/lib/go/thrift +src/github.com/apache/thrift/lib/go/thrift: + mkdir -p src/github.com/apache/thrift/lib/go + ln -sf $(realpath $(top_srcdir)/lib/go/thrift) src/github.com/apache/thrift/lib/go/thrift thirdparty-dep: diff --git a/vendor/git.apache.org/thrift.git/tutorial/go/src/client.go b/vendor/git.apache.org/thrift.git/tutorial/go/src/client.go index 1d658b9..e3ebe00 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/go/src/client.go +++ b/vendor/git.apache.org/thrift.git/tutorial/go/src/client.go @@ -25,7 +25,7 @@ import ( "fmt" "tutorial" - "git.apache.org/thrift.git/lib/go/thrift" + "github.com/apache/thrift/lib/go/thrift" ) var defaultCtx = context.Background() diff --git a/vendor/git.apache.org/thrift.git/tutorial/go/src/main.go b/vendor/git.apache.org/thrift.git/tutorial/go/src/main.go index 63154e3..7730d7b 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/go/src/main.go +++ b/vendor/git.apache.org/thrift.git/tutorial/go/src/main.go @@ -22,7 +22,7 @@ package main import ( "flag" "fmt" - "git.apache.org/thrift.git/lib/go/thrift" + "github.com/apache/thrift/lib/go/thrift" "os" ) diff --git a/vendor/git.apache.org/thrift.git/tutorial/go/src/server.go b/vendor/git.apache.org/thrift.git/tutorial/go/src/server.go index e4c4b97..95708eb 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/go/src/server.go +++ b/vendor/git.apache.org/thrift.git/tutorial/go/src/server.go @@ -22,7 +22,7 @@ package main import ( "crypto/tls" "fmt" - "git.apache.org/thrift.git/lib/go/thrift" + "github.com/apache/thrift/lib/go/thrift" "tutorial" ) diff --git a/vendor/git.apache.org/thrift.git/tutorial/hs/ThriftTutorial.cabal b/vendor/git.apache.org/thrift.git/tutorial/hs/ThriftTutorial.cabal index 88f1379..64af3ec 100755 --- a/vendor/git.apache.org/thrift.git/tutorial/hs/ThriftTutorial.cabal +++ b/vendor/git.apache.org/thrift.git/tutorial/hs/ThriftTutorial.cabal @@ -18,7 +18,7 @@ -- Name: ThriftTutorial -Version: 0.1.0 +Version: 0.12.0 Cabal-Version: >= 1.4 License: OtherLicense Category: Foreign diff --git a/vendor/git.apache.org/thrift.git/tutorial/ocaml/_oasis b/vendor/git.apache.org/thrift.git/tutorial/ocaml/_oasis index 4cab080..a0ea6c5 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/ocaml/_oasis +++ b/vendor/git.apache.org/thrift.git/tutorial/ocaml/_oasis @@ -1,5 +1,5 @@ Name: tutorial -Version: 1.0 +Version: 0.12.0 OASISFormat: 0.3 Synopsis: OCaml Tutorial example Authors: Apache Thrift Developers diff --git a/vendor/git.apache.org/thrift.git/tutorial/perl/PerlClient.pl b/vendor/git.apache.org/thrift.git/tutorial/perl/PerlClient.pl index 1d59656..7c23289 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/perl/PerlClient.pl +++ b/vendor/git.apache.org/thrift.git/tutorial/perl/PerlClient.pl @@ -37,10 +37,10 @@ use tutorial::Types; use Data::Dumper; -my $socket = new Thrift::Socket('localhost',9090); -my $transport = new Thrift::BufferedTransport($socket,1024,1024); -my $protocol = new Thrift::BinaryProtocol($transport); -my $client = new tutorial::CalculatorClient($protocol); +my $socket = Thrift::Socket->new('localhost',9090); +my $transport = Thrift::BufferedTransport->new($socket,1024,1024); +my $protocol = Thrift::BinaryProtocol->new($transport); +my $client = tutorial::CalculatorClient->new($protocol); eval{ @@ -53,7 +53,7 @@ eval{ my $sum = $client->add(1,1); print "1+1=$sum\n"; - my $work = new tutorial::Work(); + my $work = tutorial::Work->new(); $work->op(tutorial::Operation::DIVIDE); $work->num1(1); @@ -63,7 +63,7 @@ eval{ $client->calculate(1, $work); print "Whoa! We can divide by zero?\n"; }; if($@) { - warn "InvalidOperation: ".Dumper($@); + warn 'InvalidOperation: '.Dumper($@); } $work->op(tutorial::Operation::SUBTRACT); diff --git a/vendor/git.apache.org/thrift.git/tutorial/perl/PerlServer.pl b/vendor/git.apache.org/thrift.git/tutorial/perl/PerlServer.pl index adec978..dfe6b89 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/perl/PerlServer.pl +++ b/vendor/git.apache.org/thrift.git/tutorial/perl/PerlServer.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # Licensed to the Apache Software Foundation (ASF) under one @@ -67,20 +67,20 @@ sub calculate } elsif ($op == tutorial::Operation::DIVIDE) { if ($num2 == 0) { - my $x = new tutorial::InvalidOperation; + my $x = tutorial::InvalidOperation->new(); $x->whatOp($op); $x->why('Cannot divide by 0'); die $x; } $val = $num1 / $num2; } else { - my $x = new tutorial::InvalidOperation; + my $x = tutorial::InvalidOperation->new(); $x->whatOp($op); $x->why('Invalid operation'); die $x; } - my $log = new shared::SharedStruct; + my $log = shared::SharedStruct->new(); $log->key($logid); $log->value(int($val)); $self->{log}->{$logid} = $log; @@ -104,10 +104,10 @@ sub zip eval { - my $handler = new CalculatorHandler; - my $processor = new tutorial::CalculatorProcessor($handler); - my $serversocket = new Thrift::ServerSocket(9090); - my $forkingserver = new Thrift::ForkingServer($processor, $serversocket); + my $handler = CalculatorHandler->new(); + my $processor = tutorial::CalculatorProcessor->new($handler); + my $serversocket = Thrift::ServerSocket->new(9090); + my $forkingserver = Thrift::ForkingServer->new($processor, $serversocket); print "Starting the server...\n"; $forkingserver->serve(); print "done.\n"; diff --git a/vendor/git.apache.org/thrift.git/tutorial/rs/src/bin/tutorial_client.rs b/vendor/git.apache.org/thrift.git/tutorial/rs/src/bin/tutorial_client.rs index 24ab4be..c80fafc 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/rs/src/bin/tutorial_client.rs +++ b/vendor/git.apache.org/thrift.git/tutorial/rs/src/bin/tutorial_client.rs @@ -22,8 +22,9 @@ extern crate thrift; extern crate thrift_tutorial; use thrift::protocol::{TCompactInputProtocol, TCompactOutputProtocol}; -use thrift::transport::{ReadHalf, TFramedReadTransport, TFramedWriteTransport, TIoChannel, - TTcpChannel, WriteHalf}; +use thrift::transport::{ + ReadHalf, TFramedReadTransport, TFramedWriteTransport, TIoChannel, TTcpChannel, WriteHalf, +}; use thrift_tutorial::shared::TSharedServiceSyncClient; use thrift_tutorial::tutorial::{CalculatorSyncClient, Operation, TCalculatorSyncClient, Work}; @@ -70,8 +71,7 @@ fn run() -> thrift::Result<()> { let logid = 32; // let's do...a multiply! - let res = client - .calculate(logid, Work::new(7, 8, Operation::MULTIPLY, None))?; + let res = client.calculate(logid, Work::new(7, 8, Operation::Multiply, None))?; println!("multiplied 7 and 8 and got {}", res); // let's get the log for it @@ -81,7 +81,7 @@ fn run() -> thrift::Result<()> { // ok - let's be bad :( // do a divide by 0 // logid doesn't matter; won't be recorded - let res = client.calculate(77, Work::new(2, 0, Operation::DIVIDE, "we bad".to_owned())); + let res = client.calculate(77, Work::new(2, 0, Operation::Divide, "we bad".to_owned())); // we should have gotten an exception back match res { @@ -103,8 +103,7 @@ fn run() -> thrift::Result<()> { type ClientInputProtocol = TCompactInputProtocol>>; type ClientOutputProtocol = TCompactOutputProtocol>>; -fn new_client - ( +fn new_client( host: &str, port: u16, ) -> thrift::Result> { diff --git a/vendor/git.apache.org/thrift.git/tutorial/rs/src/bin/tutorial_server.rs b/vendor/git.apache.org/thrift.git/tutorial/rs/src/bin/tutorial_server.rs index 8db8eed..95b1a2b 100644 --- a/vendor/git.apache.org/thrift.git/tutorial/rs/src/bin/tutorial_server.rs +++ b/vendor/git.apache.org/thrift.git/tutorial/rs/src/bin/tutorial_server.rs @@ -65,7 +65,9 @@ fn run() -> thrift::Result<()> { let o_prot_fact = TCompactOutputProtocolFactory::new(); // demux incoming messages - let processor = CalculatorSyncProcessor::new(CalculatorServer { ..Default::default() }); + let processor = CalculatorSyncProcessor::new(CalculatorServer { + ..Default::default() + }); // create the server and start listening let mut server = TServer::new( @@ -87,7 +89,9 @@ struct CalculatorServer { impl Default for CalculatorServer { fn default() -> CalculatorServer { - CalculatorServer { log: Mutex::new(HashMap::new()) } + CalculatorServer { + log: Mutex::new(HashMap::new()), + } } } @@ -122,29 +126,25 @@ impl CalculatorSyncHandler for CalculatorServer { let res = if let Some(ref op) = w.op { if w.num1.is_none() || w.num2.is_none() { - Err( - InvalidOperation { - what_op: Some(*op as i32), - why: Some("no operands specified".to_owned()), - }, - ) + Err(InvalidOperation { + what_op: Some(*op as i32), + why: Some("no operands specified".to_owned()), + }) } else { // so that I don't have to call unwrap() multiple times below let num1 = w.num1.as_ref().expect("operands checked"); let num2 = w.num2.as_ref().expect("operands checked"); match *op { - Operation::ADD => Ok(num1 + num2), - Operation::SUBTRACT => Ok(num1 - num2), - Operation::MULTIPLY => Ok(num1 * num2), - Operation::DIVIDE => { + Operation::Add => Ok(num1 + num2), + Operation::Subtract => Ok(num1 - num2), + Operation::Multiply => Ok(num1 * num2), + Operation::Divide => { if *num2 == 0 { - Err( - InvalidOperation { - what_op: Some(*op as i32), - why: Some("divide by 0".to_owned()), - }, - ) + Err(InvalidOperation { + what_op: Some(*op as i32), + why: Some("divide by 0".to_owned()), + }) } else { Ok(num1 / num2) } @@ -152,7 +152,10 @@ impl CalculatorSyncHandler for CalculatorServer { } } } else { - Err(InvalidOperation::new(None, "no operation specified".to_owned()),) + Err(InvalidOperation::new( + None, + "no operation specified".to_owned(), + )) }; // if the operation was successful log it diff --git a/vendor/github.com/davecgh/go-spew/.travis.yml b/vendor/github.com/davecgh/go-spew/.travis.yml index 984e073..1f4cbf5 100644 --- a/vendor/github.com/davecgh/go-spew/.travis.yml +++ b/vendor/github.com/davecgh/go-spew/.travis.yml @@ -1,14 +1,28 @@ language: go +go_import_path: github.com/davecgh/go-spew go: - - 1.5.4 - - 1.6.3 - - 1.7 + - 1.6.x + - 1.7.x + - 1.8.x + - 1.9.x + - 1.10.x + - tip +sudo: false install: - - go get -v golang.org/x/tools/cmd/cover + - go get -v github.com/alecthomas/gometalinter + - gometalinter --install script: - - go test -v -tags=safe ./spew - - go test -v -tags=testcgo ./spew -covermode=count -coverprofile=profile.cov + - export PATH=$PATH:$HOME/gopath/bin + - export GORACE="halt_on_error=1" + - test -z "$(gometalinter --disable-all + --enable=gofmt + --enable=golint + --enable=vet + --enable=gosimple + --enable=unconvert + --deadline=4m ./spew | tee /dev/stderr)" + - go test -v -race -tags safe ./spew + - go test -v -race -tags testcgo ./spew -covermode=atomic -coverprofile=profile.cov after_success: - go get -v github.com/mattn/goveralls - - export PATH=$PATH:$HOME/gopath/bin - goveralls -coverprofile=profile.cov -service=travis-ci diff --git a/vendor/github.com/davecgh/go-spew/LICENSE b/vendor/github.com/davecgh/go-spew/LICENSE index c836416..bc52e96 100644 --- a/vendor/github.com/davecgh/go-spew/LICENSE +++ b/vendor/github.com/davecgh/go-spew/LICENSE @@ -2,7 +2,7 @@ ISC License Copyright (c) 2012-2016 Dave Collins -Permission to use, copy, modify, and distribute this software for any +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. diff --git a/vendor/github.com/davecgh/go-spew/README.md b/vendor/github.com/davecgh/go-spew/README.md index 2624304..f6ed02c 100644 --- a/vendor/github.com/davecgh/go-spew/README.md +++ b/vendor/github.com/davecgh/go-spew/README.md @@ -1,12 +1,9 @@ go-spew ======= -[![Build Status](https://img.shields.io/travis/davecgh/go-spew.svg)] -(https://travis-ci.org/davecgh/go-spew) [![ISC License] -(http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) [![Coverage Status] -(https://img.shields.io/coveralls/davecgh/go-spew.svg)] -(https://coveralls.io/r/davecgh/go-spew?branch=master) - +[![Build Status](https://img.shields.io/travis/davecgh/go-spew.svg)](https://travis-ci.org/davecgh/go-spew) +[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) +[![Coverage Status](https://img.shields.io/coveralls/davecgh/go-spew.svg)](https://coveralls.io/r/davecgh/go-spew?branch=master) Go-spew implements a deep pretty printer for Go data structures to aid in debugging. A comprehensive suite of tests with 100% test coverage is provided @@ -21,8 +18,7 @@ post about it ## Documentation -[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)] -(http://godoc.org/github.com/davecgh/go-spew/spew) +[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/davecgh/go-spew/spew) Full `go doc` style documentation for the project can be viewed online without installing this package by using the excellent GoDoc site here: diff --git a/vendor/github.com/davecgh/go-spew/spew/bypass.go b/vendor/github.com/davecgh/go-spew/spew/bypass.go index 8a4a658..7929947 100644 --- a/vendor/github.com/davecgh/go-spew/spew/bypass.go +++ b/vendor/github.com/davecgh/go-spew/spew/bypass.go @@ -16,7 +16,9 @@ // when the code is not running on Google App Engine, compiled by GopherJS, and // "-tags safe" is not added to the go build command line. The "disableunsafe" // tag is deprecated and thus should not be used. -// +build !js,!appengine,!safe,!disableunsafe +// Go versions prior to 1.4 are disabled because they use a different layout +// for interfaces which make the implementation of unsafeReflectValue more complex. +// +build !js,!appengine,!safe,!disableunsafe,go1.4 package spew @@ -34,80 +36,49 @@ const ( ptrSize = unsafe.Sizeof((*byte)(nil)) ) -var ( - // offsetPtr, offsetScalar, and offsetFlag are the offsets for the - // internal reflect.Value fields. These values are valid before golang - // commit ecccf07e7f9d which changed the format. The are also valid - // after commit 82f48826c6c7 which changed the format again to mirror - // the original format. Code in the init function updates these offsets - // as necessary. - offsetPtr = uintptr(ptrSize) - offsetScalar = uintptr(0) - offsetFlag = uintptr(ptrSize * 2) +type flag uintptr - // flagKindWidth and flagKindShift indicate various bits that the - // reflect package uses internally to track kind information. - // - // flagRO indicates whether or not the value field of a reflect.Value is - // read-only. - // - // flagIndir indicates whether the value field of a reflect.Value is - // the actual data or a pointer to the data. - // - // These values are valid before golang commit 90a7c3c86944 which - // changed their positions. Code in the init function updates these - // flags as necessary. - flagKindWidth = uintptr(5) - flagKindShift = uintptr(flagKindWidth - 1) - flagRO = uintptr(1 << 0) - flagIndir = uintptr(1 << 1) +var ( + // flagRO indicates whether the value field of a reflect.Value + // is read-only. + flagRO flag + + // flagAddr indicates whether the address of the reflect.Value's + // value may be taken. + flagAddr flag ) -func init() { - // Older versions of reflect.Value stored small integers directly in the - // ptr field (which is named val in the older versions). Versions - // between commits ecccf07e7f9d and 82f48826c6c7 added a new field named - // scalar for this purpose which unfortunately came before the flag - // field, so the offset of the flag field is different for those - // versions. - // - // This code constructs a new reflect.Value from a known small integer - // and checks if the size of the reflect.Value struct indicates it has - // the scalar field. When it does, the offsets are updated accordingly. - vv := reflect.ValueOf(0xf00) - if unsafe.Sizeof(vv) == (ptrSize * 4) { - offsetScalar = ptrSize * 2 - offsetFlag = ptrSize * 3 - } +// flagKindMask holds the bits that make up the kind +// part of the flags field. In all the supported versions, +// it is in the lower 5 bits. +const flagKindMask = flag(0x1f) - // Commit 90a7c3c86944 changed the flag positions such that the low - // order bits are the kind. This code extracts the kind from the flags - // field and ensures it's the correct type. When it's not, the flag - // order has been changed to the newer format, so the flags are updated - // accordingly. - upf := unsafe.Pointer(uintptr(unsafe.Pointer(&vv)) + offsetFlag) - upfv := *(*uintptr)(upf) - flagKindMask := uintptr((1<>flagKindShift != uintptr(reflect.Int) { - flagKindShift = 0 - flagRO = 1 << 5 - flagIndir = 1 << 6 +// Different versions of Go have used different +// bit layouts for the flags type. This table +// records the known combinations. +var okFlags = []struct { + ro, addr flag +}{{ + // From Go 1.4 to 1.5 + ro: 1 << 5, + addr: 1 << 7, +}, { + // Up to Go tip. + ro: 1<<5 | 1<<6, + addr: 1 << 8, +}} - // Commit adf9b30e5594 modified the flags to separate the - // flagRO flag into two bits which specifies whether or not the - // field is embedded. This causes flagIndir to move over a bit - // and means that flagRO is the combination of either of the - // original flagRO bit and the new bit. - // - // This code detects the change by extracting what used to be - // the indirect bit to ensure it's set. When it's not, the flag - // order has been changed to the newer format, so the flags are - // updated accordingly. - if upfv&flagIndir == 0 { - flagRO = 3 << 5 - flagIndir = 1 << 7 - } +var flagValOffset = func() uintptr { + field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") + if !ok { + panic("reflect.Value has no flag field") } + return field.Offset +}() + +// flagField returns a pointer to the flag field of a reflect.Value. +func flagField(v *reflect.Value) *flag { + return (*flag)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + flagValOffset)) } // unsafeReflectValue converts the passed reflect.Value into a one that bypasses @@ -119,34 +90,56 @@ func init() { // This allows us to check for implementations of the Stringer and error // interfaces to be used for pretty printing ordinarily unaddressable and // inaccessible values such as unexported struct fields. -func unsafeReflectValue(v reflect.Value) (rv reflect.Value) { - indirects := 1 - vt := v.Type() - upv := unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetPtr) - rvf := *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetFlag)) - if rvf&flagIndir != 0 { - vt = reflect.PtrTo(v.Type()) - indirects++ - } else if offsetScalar != 0 { - // The value is in the scalar field when it's not one of the - // reference types. - switch vt.Kind() { - case reflect.Uintptr: - case reflect.Chan: - case reflect.Func: - case reflect.Map: - case reflect.Ptr: - case reflect.UnsafePointer: - default: - upv = unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + - offsetScalar) +func unsafeReflectValue(v reflect.Value) reflect.Value { + if !v.IsValid() || (v.CanInterface() && v.CanAddr()) { + return v + } + flagFieldPtr := flagField(&v) + *flagFieldPtr &^= flagRO + *flagFieldPtr |= flagAddr + return v +} + +// Sanity checks against future reflect package changes +// to the type or semantics of the Value.flag field. +func init() { + field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") + if !ok { + panic("reflect.Value has no flag field") + } + if field.Type.Kind() != reflect.TypeOf(flag(0)).Kind() { + panic("reflect.Value flag field has changed kind") + } + type t0 int + var t struct { + A t0 + // t0 will have flagEmbedRO set. + t0 + // a will have flagStickyRO set + a t0 + } + vA := reflect.ValueOf(t).FieldByName("A") + va := reflect.ValueOf(t).FieldByName("a") + vt0 := reflect.ValueOf(t).FieldByName("t0") + + // Infer flagRO from the difference between the flags + // for the (otherwise identical) fields in t. + flagPublic := *flagField(&vA) + flagWithRO := *flagField(&va) | *flagField(&vt0) + flagRO = flagPublic ^ flagWithRO + + // Infer flagAddr from the difference between a value + // taken from a pointer and not. + vPtrA := reflect.ValueOf(&t).Elem().FieldByName("A") + flagNoPtr := *flagField(&vA) + flagPtr := *flagField(&vPtrA) + flagAddr = flagNoPtr ^ flagPtr + + // Check that the inferred flags tally with one of the known versions. + for _, f := range okFlags { + if flagRO == f.ro && flagAddr == f.addr { + return } } - - pv := reflect.NewAt(vt, upv) - rv = pv - for i := 0; i < indirects; i++ { - rv = rv.Elem() - } - return rv + panic("reflect.Value read-only flag has changed semantics") } diff --git a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go index 1fe3cf3..205c28d 100644 --- a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go +++ b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go @@ -16,7 +16,7 @@ // when the code is running on Google App Engine, compiled by GopherJS, or // "-tags safe" is added to the go build command line. The "disableunsafe" // tag is deprecated and thus should not be used. -// +build js appengine safe disableunsafe +// +build js appengine safe disableunsafe !go1.4 package spew diff --git a/vendor/github.com/davecgh/go-spew/spew/common.go b/vendor/github.com/davecgh/go-spew/spew/common.go index 7c519ff..1be8ce9 100644 --- a/vendor/github.com/davecgh/go-spew/spew/common.go +++ b/vendor/github.com/davecgh/go-spew/spew/common.go @@ -180,7 +180,7 @@ func printComplex(w io.Writer, c complex128, floatPrecision int) { w.Write(closeParenBytes) } -// printHexPtr outputs a uintptr formatted as hexidecimal with a leading '0x' +// printHexPtr outputs a uintptr formatted as hexadecimal with a leading '0x' // prefix to Writer w. func printHexPtr(w io.Writer, p uintptr) { // Null pointer. diff --git a/vendor/github.com/davecgh/go-spew/spew/dump.go b/vendor/github.com/davecgh/go-spew/spew/dump.go index df1d582..f78d89f 100644 --- a/vendor/github.com/davecgh/go-spew/spew/dump.go +++ b/vendor/github.com/davecgh/go-spew/spew/dump.go @@ -35,16 +35,16 @@ var ( // cCharRE is a regular expression that matches a cgo char. // It is used to detect character arrays to hexdump them. - cCharRE = regexp.MustCompile("^.*\\._Ctype_char$") + cCharRE = regexp.MustCompile(`^.*\._Ctype_char$`) // cUnsignedCharRE is a regular expression that matches a cgo unsigned // char. It is used to detect unsigned character arrays to hexdump // them. - cUnsignedCharRE = regexp.MustCompile("^.*\\._Ctype_unsignedchar$") + cUnsignedCharRE = regexp.MustCompile(`^.*\._Ctype_unsignedchar$`) // cUint8tCharRE is a regular expression that matches a cgo uint8_t. // It is used to detect uint8_t arrays to hexdump them. - cUint8tCharRE = regexp.MustCompile("^.*\\._Ctype_uint8_t$") + cUint8tCharRE = regexp.MustCompile(`^.*\._Ctype_uint8_t$`) ) // dumpState contains information about the state of a dump operation. @@ -143,10 +143,10 @@ func (d *dumpState) dumpPtr(v reflect.Value) { // Display dereferenced value. d.w.Write(openParenBytes) switch { - case nilFound == true: + case nilFound: d.w.Write(nilAngleBytes) - case cycleFound == true: + case cycleFound: d.w.Write(circularBytes) default: diff --git a/vendor/github.com/davecgh/go-spew/spew/dump_test.go b/vendor/github.com/davecgh/go-spew/spew/dump_test.go index 5aad9c7..4a31a2e 100644 --- a/vendor/github.com/davecgh/go-spew/spew/dump_test.go +++ b/vendor/github.com/davecgh/go-spew/spew/dump_test.go @@ -768,7 +768,7 @@ func addUintptrDumpTests() { func addUnsafePointerDumpTests() { // Null pointer. - v := unsafe.Pointer(uintptr(0)) + v := unsafe.Pointer(nil) nv := (*unsafe.Pointer)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) diff --git a/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go b/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go index 6ab1808..108baa5 100644 --- a/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go +++ b/vendor/github.com/davecgh/go-spew/spew/dumpcgo_test.go @@ -82,18 +82,20 @@ func addCgoDumpTests() { v5Len := fmt.Sprintf("%d", v5l) v5Cap := fmt.Sprintf("%d", v5c) v5t := "[6]testdata._Ctype_uint8_t" + v5t2 := "[6]testdata._Ctype_uchar" v5s := "(len=" + v5Len + " cap=" + v5Cap + ") " + "{\n 00000000 74 65 73 74 35 00 " + " |test5.|\n}" - addDumpTest(v5, "("+v5t+") "+v5s+"\n") + addDumpTest(v5, "("+v5t+") "+v5s+"\n", "("+v5t2+") "+v5s+"\n") // C typedefed unsigned char array. v6, v6l, v6c := testdata.GetCgoTypdefedUnsignedCharArray() v6Len := fmt.Sprintf("%d", v6l) v6Cap := fmt.Sprintf("%d", v6c) v6t := "[6]testdata._Ctype_custom_uchar_t" + v6t2 := "[6]testdata._Ctype_uchar" v6s := "(len=" + v6Len + " cap=" + v6Cap + ") " + "{\n 00000000 74 65 73 74 36 00 " + " |test6.|\n}" - addDumpTest(v6, "("+v6t+") "+v6s+"\n") + addDumpTest(v6, "("+v6t+") "+v6s+"\n", "("+v6t2+") "+v6s+"\n") } diff --git a/vendor/github.com/davecgh/go-spew/spew/format.go b/vendor/github.com/davecgh/go-spew/spew/format.go index c49875b..b04edb7 100644 --- a/vendor/github.com/davecgh/go-spew/spew/format.go +++ b/vendor/github.com/davecgh/go-spew/spew/format.go @@ -182,10 +182,10 @@ func (f *formatState) formatPtr(v reflect.Value) { // Display dereferenced value. switch { - case nilFound == true: + case nilFound: f.fs.Write(nilAngleBytes) - case cycleFound == true: + case cycleFound: f.fs.Write(circularShortBytes) default: diff --git a/vendor/github.com/davecgh/go-spew/spew/format_test.go b/vendor/github.com/davecgh/go-spew/spew/format_test.go index f9b93ab..87ee965 100644 --- a/vendor/github.com/davecgh/go-spew/spew/format_test.go +++ b/vendor/github.com/davecgh/go-spew/spew/format_test.go @@ -1083,7 +1083,7 @@ func addUintptrFormatterTests() { func addUnsafePointerFormatterTests() { // Null pointer. - v := unsafe.Pointer(uintptr(0)) + v := unsafe.Pointer(nil) nv := (*unsafe.Pointer)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) @@ -1536,14 +1536,14 @@ func TestPrintSortedKeys(t *testing.T) { t.Errorf("Sorted keys mismatch 3:\n %v %v", s, expected) } - s = cfg.Sprint(map[testStruct]int{testStruct{1}: 1, testStruct{3}: 3, testStruct{2}: 2}) + s = cfg.Sprint(map[testStruct]int{{1}: 1, {3}: 3, {2}: 2}) expected = "map[ts.1:1 ts.2:2 ts.3:3]" if s != expected { t.Errorf("Sorted keys mismatch 4:\n %v %v", s, expected) } if !spew.UnsafeDisabled { - s = cfg.Sprint(map[testStructP]int{testStructP{1}: 1, testStructP{3}: 3, testStructP{2}: 2}) + s = cfg.Sprint(map[testStructP]int{{1}: 1, {3}: 3, {2}: 2}) expected = "map[ts.1:1 ts.2:2 ts.3:3]" if s != expected { t.Errorf("Sorted keys mismatch 5:\n %v %v", s, expected) diff --git a/vendor/github.com/davecgh/go-spew/spew/internal_test.go b/vendor/github.com/davecgh/go-spew/spew/internal_test.go index 20a9cfe..e312b4f 100644 --- a/vendor/github.com/davecgh/go-spew/spew/internal_test.go +++ b/vendor/github.com/davecgh/go-spew/spew/internal_test.go @@ -36,10 +36,7 @@ type dummyFmtState struct { } func (dfs *dummyFmtState) Flag(f int) bool { - if f == int('+') { - return true - } - return false + return f == int('+') } func (dfs *dummyFmtState) Precision() (int, bool) { diff --git a/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go b/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go index a0c612e..80dc221 100644 --- a/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go +++ b/vendor/github.com/davecgh/go-spew/spew/internalunsafe_test.go @@ -16,7 +16,7 @@ // when the code is not running on Google App Engine, compiled by GopherJS, and // "-tags safe" is not added to the go build command line. The "disableunsafe" // tag is deprecated and thus should not be used. -// +build !js,!appengine,!safe,!disableunsafe +// +build !js,!appengine,!safe,!disableunsafe,go1.4 /* This test file is part of the spew package rather than than the spew_test @@ -30,7 +30,6 @@ import ( "bytes" "reflect" "testing" - "unsafe" ) // changeKind uses unsafe to intentionally change the kind of a reflect.Value to @@ -38,13 +37,13 @@ import ( // fallback code which punts to the standard fmt library for new types that // might get added to the language. func changeKind(v *reflect.Value, readOnly bool) { - rvf := (*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + offsetFlag)) - *rvf = *rvf | ((1< delta { @@ -929,9 +972,10 @@ func toFloat(x interface{}) (float64, bool) { // InDelta asserts that the two numerals are within delta of each other. // // assert.InDelta(t, math.Pi, (22 / 7.0), 0.01) -// -// Returns whether the assertion was successful (true) or not (false). func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } af, aok := toFloat(expected) bf, bok := toFloat(actual) @@ -958,6 +1002,9 @@ func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs // InDeltaSlice is the same as InDelta, except it compares two slices. func InDeltaSlice(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } if expected == nil || actual == nil || reflect.TypeOf(actual).Kind() != reflect.Slice || reflect.TypeOf(expected).Kind() != reflect.Slice { @@ -979,6 +1026,9 @@ func InDeltaSlice(t TestingT, expected, actual interface{}, delta float64, msgAn // InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func InDeltaMapValues(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } if expected == nil || actual == nil || reflect.TypeOf(actual).Kind() != reflect.Map || reflect.TypeOf(expected).Kind() != reflect.Map { @@ -989,7 +1039,7 @@ func InDeltaMapValues(t TestingT, expected, actual interface{}, delta float64, m actualMap := reflect.ValueOf(actual) if expectedMap.Len() != actualMap.Len() { - return Fail(t, "Arguments must have the same numbe of keys", msgAndArgs...) + return Fail(t, "Arguments must have the same number of keys", msgAndArgs...) } for _, k := range expectedMap.MapKeys() { @@ -1035,9 +1085,10 @@ func calcRelativeError(expected, actual interface{}) (float64, error) { } // InEpsilon asserts that expected and actual have a relative error less than epsilon -// -// Returns whether the assertion was successful (true) or not (false). func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } actualEpsilon, err := calcRelativeError(expected, actual) if err != nil { return Fail(t, err.Error(), msgAndArgs...) @@ -1052,6 +1103,9 @@ func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAnd // InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } if expected == nil || actual == nil || reflect.TypeOf(actual).Kind() != reflect.Slice || reflect.TypeOf(expected).Kind() != reflect.Slice { @@ -1081,9 +1135,10 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m // if assert.NoError(t, err) { // assert.Equal(t, expectedObj, actualObj) // } -// -// Returns whether the assertion was successful (true) or not (false). func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } if err != nil { return Fail(t, fmt.Sprintf("Received unexpected error:\n%+v", err), msgAndArgs...) } @@ -1097,9 +1152,10 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { // if assert.Error(t, err) { // assert.Equal(t, expectedError, err) // } -// -// Returns whether the assertion was successful (true) or not (false). func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } if err == nil { return Fail(t, "An error is expected but got nil.", msgAndArgs...) @@ -1113,9 +1169,10 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { // // actualObj, err := SomeFunction() // assert.EqualError(t, err, expectedErrorString) -// -// Returns whether the assertion was successful (true) or not (false). func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } if !Error(t, theError, msgAndArgs...) { return false } @@ -1148,9 +1205,10 @@ func matchRegexp(rx interface{}, str interface{}) bool { // // assert.Regexp(t, regexp.MustCompile("start"), "it's starting") // assert.Regexp(t, "start...$", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } match := matchRegexp(rx, str) @@ -1165,9 +1223,10 @@ func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface // // assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") // assert.NotRegexp(t, "^start", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } match := matchRegexp(rx, str) if match { @@ -1178,16 +1237,22 @@ func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interf } -// Zero asserts that i is the zero value for its type and returns the truth. +// Zero asserts that i is the zero value for its type. func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...) } return true } -// NotZero asserts that i is not the zero value for its type and returns the truth. +// NotZero asserts that i is not the zero value for its type. func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } if i == nil || reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { return Fail(t, fmt.Sprintf("Should not be zero, but was %v", i), msgAndArgs...) } @@ -1196,6 +1261,9 @@ func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { // FileExists checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file. func FileExists(t TestingT, path string, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } info, err := os.Lstat(path) if err != nil { if os.IsNotExist(err) { @@ -1211,6 +1279,9 @@ func FileExists(t TestingT, path string, msgAndArgs ...interface{}) bool { // DirExists checks whether a directory exists in the given path. It also fails if the path is a file rather a directory or there is an error checking whether it exists. func DirExists(t TestingT, path string, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } info, err := os.Lstat(path) if err != nil { if os.IsNotExist(err) { @@ -1227,9 +1298,10 @@ func DirExists(t TestingT, path string, msgAndArgs ...interface{}) bool { // JSONEq asserts that two JSON strings are equivalent. // // assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) -// -// Returns whether the assertion was successful (true) or not (false). func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } var expectedJSONAsInterface, actualJSONAsInterface interface{} if err := json.Unmarshal([]byte(expected), &expectedJSONAsInterface); err != nil { @@ -1268,12 +1340,18 @@ func diff(expected interface{}, actual interface{}) string { return "" } - if ek != reflect.Struct && ek != reflect.Map && ek != reflect.Slice && ek != reflect.Array { + if ek != reflect.Struct && ek != reflect.Map && ek != reflect.Slice && ek != reflect.Array && ek != reflect.String { return "" } - e := spewConfig.Sdump(expected) - a := spewConfig.Sdump(actual) + var e, a string + if ek != reflect.String { + e = spewConfig.Sdump(expected) + a = spewConfig.Sdump(actual) + } else { + e = expected.(string) + a = actual.(string) + } diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{ A: difflib.SplitLines(e), @@ -1310,3 +1388,7 @@ var spewConfig = spew.ConfigState{ DisableCapacities: true, SortKeys: true, } + +type tHelper interface { + Helper() +} diff --git a/vendor/github.com/stretchr/testify/assert/assertions_test.go b/vendor/github.com/stretchr/testify/assert/assertions_test.go index 6757bd1..91b5ee9 100644 --- a/vendor/github.com/stretchr/testify/assert/assertions_test.go +++ b/vendor/github.com/stretchr/testify/assert/assertions_test.go @@ -2,6 +2,7 @@ package assert import ( "bytes" + "encoding/json" "errors" "fmt" "io" @@ -250,6 +251,21 @@ func (t *bufferT) Errorf(format string, args ...interface{}) { t.buf.WriteString(decorate(fmt.Sprintf(format, args...))) } +func TestStringEqual(t *testing.T) { + for i, currCase := range []struct { + equalWant string + equalGot string + msgAndArgs []interface{} + want string + }{ + {equalWant: "hi, \nmy name is", equalGot: "what,\nmy name is", want: "\tassertions.go:\\d+: \n\t+Error Trace:\t\n\t+Error:\\s+Not equal:\\s+\n\\s+expected: \"hi, \\\\nmy name is\"\n\\s+actual\\s+: \"what,\\\\nmy name is\"\n\\s+Diff:\n\\s+-+ Expected\n\\s+\\++ Actual\n\\s+@@ -1,2 \\+1,2 @@\n\\s+-hi, \n\\s+\\+what,\n\\s+my name is"}, + } { + mockT := &bufferT{} + Equal(mockT, currCase.equalWant, currCase.equalGot, currCase.msgAndArgs...) + Regexp(t, regexp.MustCompile(currCase.want), mockT.buf.String(), "Case %d", i) + } +} + func TestEqualFormatting(t *testing.T) { for i, currCase := range []struct { equalWant string @@ -257,8 +273,8 @@ func TestEqualFormatting(t *testing.T) { msgAndArgs []interface{} want string }{ - {equalWant: "want", equalGot: "got", want: "\tassertions.go:[0-9]+: \r \r\tError Trace:\t\n\t\t\r\tError: \tNot equal: \n\t\t\r\t \texpected: \"want\"\n\t\t\r\t \tactual : \"got\"\n"}, - {equalWant: "want", equalGot: "got", msgAndArgs: []interface{}{"hello, %v!", "world"}, want: "\tassertions.go:[0-9]+: \r \r\tError Trace:\t\n\t\t\r\tError: \tNot equal: \n\t\t\r\t \texpected: \"want\"\n\t\t\r\t \tactual : \"got\"\n\t\t\r\tMessages: \thello, world!\n"}, + {equalWant: "want", equalGot: "got", want: "\tassertions.go:\\d+: \n\t+Error Trace:\t\n\t+Error:\\s+Not equal:\\s+\n\\s+expected: \"want\"\n\\s+actual\\s+: \"got\"\n\\s+Diff:\n\\s+-+ Expected\n\\s+\\++ Actual\n\\s+@@ -1 \\+1 @@\n\\s+-want\n\\s+\\+got\n"}, + {equalWant: "want", equalGot: "got", msgAndArgs: []interface{}{"hello, %v!", "world"}, want: "\tassertions.go:[0-9]+: \n\t+Error Trace:\t\n\t+Error:\\s+Not equal:\\s+\n\\s+expected: \"want\"\n\\s+actual\\s+: \"got\"\n\\s+Diff:\n\\s+-+ Expected\n\\s+\\++ Actual\n\\s+@@ -1 \\+1 @@\n\\s+-want\n\\s+\\+got\n\\s+Messages:\\s+hello, world!\n"}, } { mockT := &bufferT{} Equal(mockT, currCase.equalWant, currCase.equalGot, currCase.msgAndArgs...) @@ -1579,3 +1595,199 @@ func TestEqualArgsValidation(t *testing.T) { err := validateEqualArgs(time.Now, time.Now) EqualError(t, err, "cannot take func type as argument") } + +func ExampleComparisonAssertionFunc() { + t := &testing.T{} // provided by test + + adder := func(x, y int) int { + return x + y + } + + type args struct { + x int + y int + } + + tests := []struct { + name string + args args + expect int + assertion ComparisonAssertionFunc + }{ + {"2+2=4", args{2, 2}, 4, Equal}, + {"2+2!=5", args{2, 2}, 5, NotEqual}, + {"2+3==5", args{2, 3}, 5, Exactly}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.expect, adder(tt.args.x, tt.args.y)) + }) + } +} + +func TestComparisonAssertionFunc(t *testing.T) { + type iface interface { + Name() string + } + + tests := []struct { + name string + expect interface{} + got interface{} + assertion ComparisonAssertionFunc + }{ + {"implements", (*iface)(nil), t, Implements}, + {"isType", (*testing.T)(nil), t, IsType}, + {"equal", t, t, Equal}, + {"equalValues", t, t, EqualValues}, + {"exactly", t, t, Exactly}, + {"notEqual", t, nil, NotEqual}, + {"notContains", []int{1, 2, 3}, 4, NotContains}, + {"subset", []int{1, 2, 3, 4}, []int{2, 3}, Subset}, + {"notSubset", []int{1, 2, 3, 4}, []int{0, 3}, NotSubset}, + {"elementsMatch", []byte("abc"), []byte("bac"), ElementsMatch}, + {"regexp", "^t.*y$", "testify", Regexp}, + {"notRegexp", "^t.*y$", "Testify", NotRegexp}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.expect, tt.got) + }) + } +} + +func ExampleValueAssertionFunc() { + t := &testing.T{} // provided by test + + dumbParse := func(input string) interface{} { + var x interface{} + json.Unmarshal([]byte(input), &x) + return x + } + + tests := []struct { + name string + arg string + assertion ValueAssertionFunc + }{ + {"true is not nil", "true", NotNil}, + {"empty string is nil", "", Nil}, + {"zero is not nil", "0", NotNil}, + {"zero is zero", "0", Zero}, + {"false is zero", "false", Zero}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, dumbParse(tt.arg)) + }) + } +} + +func TestValueAssertionFunc(t *testing.T) { + tests := []struct { + name string + value interface{} + assertion ValueAssertionFunc + }{ + {"notNil", true, NotNil}, + {"nil", nil, Nil}, + {"empty", []int{}, Empty}, + {"notEmpty", []int{1}, NotEmpty}, + {"zero", false, Zero}, + {"notZero", 42, NotZero}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.value) + }) + } +} + +func ExampleBoolAssertionFunc() { + t := &testing.T{} // provided by test + + isOkay := func(x int) bool { + return x >= 42 + } + + tests := []struct { + name string + arg int + assertion BoolAssertionFunc + }{ + {"-1 is bad", -1, False}, + {"42 is good", 42, True}, + {"41 is bad", 41, False}, + {"45 is cool", 45, True}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, isOkay(tt.arg)) + }) + } +} + +func TestBoolAssertionFunc(t *testing.T) { + tests := []struct { + name string + value bool + assertion BoolAssertionFunc + }{ + {"true", true, True}, + {"false", false, False}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.value) + }) + } +} + +func ExampleErrorAssertionFunc() { + t := &testing.T{} // provided by test + + dumbParseNum := func(input string, v interface{}) error { + return json.Unmarshal([]byte(input), v) + } + + tests := []struct { + name string + arg string + assertion ErrorAssertionFunc + }{ + {"1.2 is number", "1.2", NoError}, + {"1.2.3 not number", "1.2.3", Error}, + {"true is not number", "true", Error}, + {"3 is number", "3", NoError}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var x float64 + tt.assertion(t, dumbParseNum(tt.arg, &x)) + }) + } +} + +func TestErrorAssertionFunc(t *testing.T) { + tests := []struct { + name string + err error + assertion ErrorAssertionFunc + }{ + {"noError", nil, NoError}, + {"error", errors.New("whoops"), Error}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.err) + }) + } +} diff --git a/vendor/github.com/stretchr/testify/assert/http_assertions.go b/vendor/github.com/stretchr/testify/assert/http_assertions.go index 3101e78..df46fa7 100644 --- a/vendor/github.com/stretchr/testify/assert/http_assertions.go +++ b/vendor/github.com/stretchr/testify/assert/http_assertions.go @@ -12,10 +12,11 @@ import ( // an error if building a new request fails. func httpCode(handler http.HandlerFunc, method, url string, values url.Values) (int, error) { w := httptest.NewRecorder() - req, err := http.NewRequest(method, url+"?"+values.Encode(), nil) + req, err := http.NewRequest(method, url, nil) if err != nil { return -1, err } + req.URL.RawQuery = values.Encode() handler(w, req) return w.Code, nil } @@ -26,6 +27,9 @@ func httpCode(handler http.HandlerFunc, method, url string, values url.Values) ( // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } code, err := httpCode(handler, method, url, values) if err != nil { Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err)) @@ -46,6 +50,9 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, value // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } code, err := httpCode(handler, method, url, values) if err != nil { Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err)) @@ -66,6 +73,9 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, valu // // Returns whether the assertion was successful (true) or not (false). func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } code, err := httpCode(handler, method, url, values) if err != nil { Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err)) @@ -95,10 +105,13 @@ func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) s // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // -// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } body := HTTPBody(handler, method, url, values) contains := strings.Contains(body, fmt.Sprint(str)) @@ -112,10 +125,13 @@ func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // -// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } body := HTTPBody(handler, method, url, values) contains := strings.Contains(body, fmt.Sprint(str)) diff --git a/vendor/github.com/stretchr/testify/assert/http_assertions_test.go b/vendor/github.com/stretchr/testify/assert/http_assertions_test.go index 3ab7683..112beaf 100644 --- a/vendor/github.com/stretchr/testify/assert/http_assertions_test.go +++ b/vendor/github.com/stretchr/testify/assert/http_assertions_test.go @@ -89,6 +89,35 @@ func httpHelloName(w http.ResponseWriter, r *http.Request) { w.Write([]byte(fmt.Sprintf("Hello, %s!", name))) } +func TestHTTPRequestWithNoParams(t *testing.T) { + var got *http.Request + handler := func(w http.ResponseWriter, r *http.Request) { + got = r + w.WriteHeader(http.StatusOK) + } + + True(t, HTTPSuccess(t, handler, "GET", "/url", nil)) + + Empty(t, got.URL.Query()) + Equal(t, "/url", got.URL.RequestURI()) +} + +func TestHTTPRequestWithParams(t *testing.T) { + var got *http.Request + handler := func(w http.ResponseWriter, r *http.Request) { + got = r + w.WriteHeader(http.StatusOK) + } + params := url.Values{} + params.Add("id", "12345") + + True(t, HTTPSuccess(t, handler, "GET", "/url", params)) + + Equal(t, url.Values{"id": []string{"12345"}}, got.URL.Query()) + Equal(t, "/url?id=12345", got.URL.String()) + Equal(t, "/url?id=12345", got.URL.RequestURI()) +} + func TestHttpBody(t *testing.T) { assert := New(t) mockT := new(testing.T) diff --git a/vendor/github.com/stretchr/testify/mock/mock.go b/vendor/github.com/stretchr/testify/mock/mock.go index 208b838..cc4f642 100644 --- a/vendor/github.com/stretchr/testify/mock/mock.go +++ b/vendor/github.com/stretchr/testify/mock/mock.go @@ -42,6 +42,9 @@ type Call struct { // this method is called. ReturnArguments Arguments + // Holds the caller info for the On() call + callerInfo []string + // The number of times to return the return arguments when setting // expectations. 0 means to always return the value. Repeatability int @@ -64,12 +67,13 @@ type Call struct { RunFn func(Arguments) } -func newCall(parent *Mock, methodName string, methodArguments ...interface{}) *Call { +func newCall(parent *Mock, methodName string, callerInfo []string, methodArguments ...interface{}) *Call { return &Call{ Parent: parent, Method: methodName, Arguments: methodArguments, ReturnArguments: make([]interface{}, 0), + callerInfo: callerInfo, Repeatability: 0, WaitFor: nil, RunFn: nil, @@ -187,6 +191,10 @@ type Mock struct { // Holds the calls that were made to this mocked object. Calls []Call + // test is An optional variable that holds the test struct, to be used when an + // invalid mock call was made. + test TestingT + // TestData holds any data that might be useful for testing. Testify ignores // this data completely allowing you to do whatever you like with it. testData objx.Map @@ -209,6 +217,27 @@ func (m *Mock) TestData() objx.Map { Setting expectations */ +// Test sets the test struct variable of the mock object +func (m *Mock) Test(t TestingT) { + m.mutex.Lock() + defer m.mutex.Unlock() + m.test = t +} + +// fail fails the current test with the given formatted format and args. +// In case that a test was defined, it uses the test APIs for failing a test, +// otherwise it uses panic. +func (m *Mock) fail(format string, args ...interface{}) { + m.mutex.Lock() + defer m.mutex.Unlock() + + if m.test == nil { + panic(fmt.Sprintf(format, args...)) + } + m.test.Errorf(format, args...) + m.test.FailNow() +} + // On starts a description of an expectation of the specified method // being called. // @@ -222,7 +251,7 @@ func (m *Mock) On(methodName string, arguments ...interface{}) *Call { m.mutex.Lock() defer m.mutex.Unlock() - c := newCall(m, methodName, arguments...) + c := newCall(m, methodName, assert.CallerInfo(), arguments...) m.ExpectedCalls = append(m.ExpectedCalls, c) return c } @@ -245,27 +274,25 @@ func (m *Mock) findExpectedCall(method string, arguments ...interface{}) (int, * return -1, nil } -func (m *Mock) findClosestCall(method string, arguments ...interface{}) (bool, *Call) { - diffCount := 0 +func (m *Mock) findClosestCall(method string, arguments ...interface{}) (*Call, string) { + var diffCount int var closestCall *Call + var err string for _, call := range m.expectedCalls() { if call.Method == method { - _, tempDiffCount := call.Arguments.Diff(arguments) + errInfo, tempDiffCount := call.Arguments.Diff(arguments) if tempDiffCount < diffCount || diffCount == 0 { diffCount = tempDiffCount closestCall = call + err = errInfo } } } - if closestCall == nil { - return false, nil - } - - return true, closestCall + return closestCall, err } func callString(method string, arguments Arguments, includeArgumentValues bool) string { @@ -312,6 +339,7 @@ func (m *Mock) Called(arguments ...interface{}) Arguments { // If Call.WaitFor is set, blocks until the channel is closed or receives a message. func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Arguments { m.mutex.Lock() + //TODO: could combine expected and closes in single loop found, call := m.findExpectedCall(methodName, arguments...) if found < 0 { @@ -322,13 +350,18 @@ func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Argumen // b) the arguments are not what was expected, or // c) the developer has forgotten to add an accompanying On...Return pair. - closestFound, closestCall := m.findClosestCall(methodName, arguments...) + closestCall, mismatch := m.findClosestCall(methodName, arguments...) m.mutex.Unlock() - if closestFound { - panic(fmt.Sprintf("\n\nmock: Unexpected Method Call\n-----------------------------\n\n%s\n\nThe closest call I have is: \n\n%s\n\n%s\n", callString(methodName, arguments, true), callString(methodName, closestCall.Arguments, true), diffArguments(closestCall.Arguments, arguments))) + if closestCall != nil { + m.fail("\n\nmock: Unexpected Method Call\n-----------------------------\n\n%s\n\nThe closest call I have is: \n\n%s\n\n%s\nDiff: %s", + callString(methodName, arguments, true), + callString(methodName, closestCall.Arguments, true), + diffArguments(closestCall.Arguments, arguments), + strings.TrimSpace(mismatch), + ) } else { - panic(fmt.Sprintf("\nassert: mock: I don't know what to return because the method call was unexpected.\n\tEither do Mock.On(\"%s\").Return(...) first, or remove the %s() call.\n\tThis method was unexpected:\n\t\t%s\n\tat: %s", methodName, methodName, callString(methodName, arguments, true), assert.CallerInfo())) + m.fail("\nassert: mock: I don't know what to return because the method call was unexpected.\n\tEither do Mock.On(\"%s\").Return(...) first, or remove the %s() call.\n\tThis method was unexpected:\n\t\t%s\n\tat: %s", methodName, methodName, callString(methodName, arguments, true), assert.CallerInfo()) } } @@ -340,7 +373,7 @@ func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Argumen call.totalCalls++ // add the call - m.Calls = append(m.Calls, *newCall(m, methodName, arguments...)) + m.Calls = append(m.Calls, *newCall(m, methodName, assert.CallerInfo(), arguments...)) m.mutex.Unlock() // block if specified @@ -378,6 +411,9 @@ type assertExpectationser interface { // // Calls may have occurred in any order. func AssertExpectationsForObjects(t TestingT, testObjects ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } for _, obj := range testObjects { if m, ok := obj.(Mock); ok { t.Logf("Deprecated mock.AssertExpectationsForObjects(myMock.Mock) use mock.AssertExpectationsForObjects(myMock)") @@ -385,6 +421,7 @@ func AssertExpectationsForObjects(t TestingT, testObjects ...interface{}) bool { } m := obj.(assertExpectationser) if !m.AssertExpectations(t) { + t.Logf("Expectations didn't match for Mock: %+v", reflect.TypeOf(m)) return false } } @@ -394,6 +431,9 @@ func AssertExpectationsForObjects(t TestingT, testObjects ...interface{}) bool { // AssertExpectations asserts that everything specified with On and Return was // in fact called as expected. Calls may have occurred in any order. func (m *Mock) AssertExpectations(t TestingT) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } m.mutex.Lock() defer m.mutex.Unlock() var somethingMissing bool @@ -405,13 +445,14 @@ func (m *Mock) AssertExpectations(t TestingT) bool { if !expectedCall.optional && !m.methodWasCalled(expectedCall.Method, expectedCall.Arguments) && expectedCall.totalCalls == 0 { somethingMissing = true failedExpectations++ - t.Logf("\u274C\t%s(%s)", expectedCall.Method, expectedCall.Arguments.String()) + t.Logf("FAIL:\t%s(%s)\n\t\tat: %s", expectedCall.Method, expectedCall.Arguments.String(), expectedCall.callerInfo) } else { if expectedCall.Repeatability > 0 { somethingMissing = true failedExpectations++ + t.Logf("FAIL:\t%s(%s)\n\t\tat: %s", expectedCall.Method, expectedCall.Arguments.String(), expectedCall.callerInfo) } else { - t.Logf("\u2705\t%s(%s)", expectedCall.Method, expectedCall.Arguments.String()) + t.Logf("PASS:\t%s(%s)", expectedCall.Method, expectedCall.Arguments.String()) } } } @@ -425,6 +466,9 @@ func (m *Mock) AssertExpectations(t TestingT) bool { // AssertNumberOfCalls asserts that the method was called expectedCalls times. func (m *Mock) AssertNumberOfCalls(t TestingT, methodName string, expectedCalls int) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } m.mutex.Lock() defer m.mutex.Unlock() var actualCalls int @@ -439,11 +483,22 @@ func (m *Mock) AssertNumberOfCalls(t TestingT, methodName string, expectedCalls // AssertCalled asserts that the method was called. // It can produce a false result when an argument is a pointer type and the underlying value changed after calling the mocked method. func (m *Mock) AssertCalled(t TestingT, methodName string, arguments ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } m.mutex.Lock() defer m.mutex.Unlock() - if !assert.True(t, m.methodWasCalled(methodName, arguments), fmt.Sprintf("The \"%s\" method should have been called with %d argument(s), but was not.", methodName, len(arguments))) { - t.Logf("%v", m.expectedCalls()) - return false + if !m.methodWasCalled(methodName, arguments) { + var calledWithArgs []string + for _, call := range m.calls() { + calledWithArgs = append(calledWithArgs, fmt.Sprintf("%v", call.Arguments)) + } + if len(calledWithArgs) == 0 { + return assert.Fail(t, "Should have called with given arguments", + fmt.Sprintf("Expected %q to have been called with:\n%v\nbut no actual calls happened", methodName, arguments)) + } + return assert.Fail(t, "Should have called with given arguments", + fmt.Sprintf("Expected %q to have been called with:\n%v\nbut actual calls were:\n %v", methodName, arguments, strings.Join(calledWithArgs, "\n"))) } return true } @@ -451,11 +506,14 @@ func (m *Mock) AssertCalled(t TestingT, methodName string, arguments ...interfac // AssertNotCalled asserts that the method was not called. // It can produce a false result when an argument is a pointer type and the underlying value changed after calling the mocked method. func (m *Mock) AssertNotCalled(t TestingT, methodName string, arguments ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } m.mutex.Lock() defer m.mutex.Unlock() - if !assert.False(t, m.methodWasCalled(methodName, arguments), fmt.Sprintf("The \"%s\" method was called with %d argument(s), but should NOT have been.", methodName, len(arguments))) { - t.Logf("%v", m.expectedCalls()) - return false + if m.methodWasCalled(methodName, arguments) { + return assert.Fail(t, "Should not have called with given arguments", + fmt.Sprintf("Expected %q to not have been called with:\n%v\nbut actually it was.", methodName, arguments)) } return true } @@ -495,7 +553,7 @@ type Arguments []interface{} const ( // Anything is used in Diff and Assert when the argument being tested // shouldn't be taken into consideration. - Anything string = "mock.Anything" + Anything = "mock.Anything" ) // AnythingOfTypeArgument is a string that contains the type of an argument @@ -598,6 +656,7 @@ func (args Arguments) Is(objects ...interface{}) bool { // // Returns the diff string and number of differences found. func (args Arguments) Diff(objects []interface{}) (string, int) { + //TODO: could return string as error and nil for No difference var output = "\n" var differences int @@ -609,25 +668,30 @@ func (args Arguments) Diff(objects []interface{}) (string, int) { for i := 0; i < maxArgCount; i++ { var actual, expected interface{} + var actualFmt, expectedFmt string if len(objects) <= i { actual = "(Missing)" + actualFmt = "(Missing)" } else { actual = objects[i] + actualFmt = fmt.Sprintf("(%[1]T=%[1]v)", actual) } if len(args) <= i { expected = "(Missing)" + expectedFmt = "(Missing)" } else { expected = args[i] + expectedFmt = fmt.Sprintf("(%[1]T=%[1]v)", expected) } if matcher, ok := expected.(argumentMatcher); ok { if matcher.Matches(actual) { - output = fmt.Sprintf("%s\t%d: \u2705 %s matched by %s\n", output, i, actual, matcher) + output = fmt.Sprintf("%s\t%d: PASS: %s matched by %s\n", output, i, actualFmt, matcher) } else { differences++ - output = fmt.Sprintf("%s\t%d: \u2705 %s not matched by %s\n", output, i, actual, matcher) + output = fmt.Sprintf("%s\t%d: PASS: %s not matched by %s\n", output, i, actualFmt, matcher) } } else if reflect.TypeOf(expected) == reflect.TypeOf((*AnythingOfTypeArgument)(nil)).Elem() { @@ -635,7 +699,7 @@ func (args Arguments) Diff(objects []interface{}) (string, int) { if reflect.TypeOf(actual).Name() != string(expected.(AnythingOfTypeArgument)) && reflect.TypeOf(actual).String() != string(expected.(AnythingOfTypeArgument)) { // not match differences++ - output = fmt.Sprintf("%s\t%d: \u274C type %s != type %s - %s\n", output, i, expected, reflect.TypeOf(actual).Name(), actual) + output = fmt.Sprintf("%s\t%d: FAIL: type %s != type %s - %s\n", output, i, expected, reflect.TypeOf(actual).Name(), actualFmt) } } else { @@ -644,11 +708,11 @@ func (args Arguments) Diff(objects []interface{}) (string, int) { if assert.ObjectsAreEqual(expected, Anything) || assert.ObjectsAreEqual(actual, Anything) || assert.ObjectsAreEqual(actual, expected) { // match - output = fmt.Sprintf("%s\t%d: \u2705 %s == %s\n", output, i, actual, expected) + output = fmt.Sprintf("%s\t%d: PASS: %s == %s\n", output, i, actualFmt, expectedFmt) } else { // not match differences++ - output = fmt.Sprintf("%s\t%d: \u274C %s != %s\n", output, i, actual, expected) + output = fmt.Sprintf("%s\t%d: FAIL: %s != %s\n", output, i, actualFmt, expectedFmt) } } @@ -665,6 +729,9 @@ func (args Arguments) Diff(objects []interface{}) (string, int) { // Assert compares the arguments with the specified objects and fails if // they do not exactly match. func (args Arguments) Assert(t TestingT, objects ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } // get the differences diff, diffCount := args.Diff(objects) @@ -812,3 +879,7 @@ var spewConfig = spew.ConfigState{ DisableCapacities: true, SortKeys: true, } + +type tHelper interface { + Helper() +} diff --git a/vendor/github.com/stretchr/testify/mock/mock_test.go b/vendor/github.com/stretchr/testify/mock/mock_test.go index cb245ba..978eae2 100644 --- a/vendor/github.com/stretchr/testify/mock/mock_test.go +++ b/vendor/github.com/stretchr/testify/mock/mock_test.go @@ -3,6 +3,8 @@ package mock import ( "errors" "fmt" + "regexp" + "runtime" "sync" "testing" "time" @@ -90,6 +92,34 @@ func (i *TestExampleImplementation) TheExampleMethodFuncType(fn ExampleFuncType) return args.Error(0) } +// MockTestingT mocks a test struct +type MockTestingT struct { + logfCount, errorfCount, failNowCount int +} + +const mockTestingTFailNowCalled = "FailNow was called" + +func (m *MockTestingT) Logf(string, ...interface{}) { + m.logfCount++ +} + +func (m *MockTestingT) Errorf(string, ...interface{}) { + m.errorfCount++ +} + +// FailNow mocks the FailNow call. +// It panics in order to mimic the FailNow behavior in the sense that +// the execution stops. +// When expecting this method, the call that invokes it should use the following code: +// +// assert.PanicsWithValue(t, mockTestingTFailNowCalled, func() {...}) +func (m *MockTestingT) FailNow() { + m.failNowCount++ + + // this function should panic now to stop the execution as expected + panic(mockTestingTFailNowCalled) +} + /* Mock */ @@ -119,6 +149,8 @@ func Test_Mock_Chained_On(t *testing.T) { // make a test impl object var mockedService = new(TestExampleImplementation) + // determine our current line number so we can assert the expected calls callerInfo properly + _, _, line, _ := runtime.Caller(0) mockedService. On("TheExampleMethod", 1, 2, 3). Return(0). @@ -126,17 +158,19 @@ func Test_Mock_Chained_On(t *testing.T) { Return(nil) expectedCalls := []*Call{ - &Call{ + { Parent: &mockedService.Mock, Method: "TheExampleMethod", Arguments: []interface{}{1, 2, 3}, ReturnArguments: []interface{}{0}, + callerInfo: []string{fmt.Sprintf("mock_test.go:%d", line+2)}, }, - &Call{ + { Parent: &mockedService.Mock, Method: "TheExampleMethod3", Arguments: []interface{}{AnythingOfType("*mock.ExampleType")}, ReturnArguments: []interface{}{nil}, + callerInfo: []string{fmt.Sprintf("mock_test.go:%d", line+4)}, }, } assert.Equal(t, expectedCalls, mockedService.ExpectedCalls) @@ -198,6 +232,34 @@ func Test_Mock_On_WithIntArgMatcher(t *testing.T) { }) } +func TestMock_WithTest(t *testing.T) { + var ( + mockedService TestExampleImplementation + mockedTest MockTestingT + ) + + mockedService.Test(&mockedTest) + mockedService.On("TheExampleMethod", 1, 2, 3).Return(0, nil) + + // Test that on an expected call, the test was not failed + + mockedService.TheExampleMethod(1, 2, 3) + + // Assert that Errorf and FailNow were not called + assert.Equal(t, 0, mockedTest.errorfCount) + assert.Equal(t, 0, mockedTest.failNowCount) + + // Test that on unexpected call, the mocked test was called to fail the test + + assert.PanicsWithValue(t, mockTestingTFailNowCalled, func() { + mockedService.TheExampleMethod(1, 1, 1) + }) + + // Assert that Errorf and FailNow were called once + assert.Equal(t, 1, mockedTest.errorfCount) + assert.Equal(t, 1, mockedTest.failNowCount) +} + func Test_Mock_On_WithPtrArgMatcher(t *testing.T) { var mockedService TestExampleImplementation @@ -1125,8 +1187,8 @@ func Test_Arguments_Diff(t *testing.T) { diff, count = args.Diff([]interface{}{"Hello World", 456, "false"}) assert.Equal(t, 2, count) - assert.Contains(t, diff, `%!s(int=456) != %!s(int=123)`) - assert.Contains(t, diff, `false != %!s(bool=true)`) + assert.Contains(t, diff, `(int=456) != (int=123)`) + assert.Contains(t, diff, `(string=false) != (bool=true)`) } @@ -1138,7 +1200,7 @@ func Test_Arguments_Diff_DifferentNumberOfArgs(t *testing.T) { diff, count = args.Diff([]interface{}{"string", 456, "false", "extra"}) assert.Equal(t, 3, count) - assert.Contains(t, diff, `extra != (Missing)`) + assert.Contains(t, diff, `(string=extra) != (Missing)`) } @@ -1180,7 +1242,7 @@ func Test_Arguments_Diff_WithAnythingOfTypeArgument_Failing(t *testing.T) { diff, count = args.Diff([]interface{}{"string", 123, true}) assert.Equal(t, 1, count) - assert.Contains(t, diff, `string != type int - %!s(int=123)`) + assert.Contains(t, diff, `string != type int - (int=123)`) } @@ -1192,14 +1254,14 @@ func Test_Arguments_Diff_WithArgMatcher(t *testing.T) { diff, count := args.Diff([]interface{}{"string", 124, true}) assert.Equal(t, 1, count) - assert.Contains(t, diff, `%!s(int=124) not matched by func(int) bool`) + assert.Contains(t, diff, `(int=124) not matched by func(int) bool`) diff, count = args.Diff([]interface{}{"string", false, true}) assert.Equal(t, 1, count) - assert.Contains(t, diff, `%!s(bool=false) not matched by func(int) bool`) + assert.Contains(t, diff, `(bool=false) not matched by func(int) bool`) diff, count = args.Diff([]interface{}{"string", 123, false}) - assert.Contains(t, diff, `%!s(int=123) matched by func(int) bool`) + assert.Contains(t, diff, `(int=123) matched by func(int) bool`) diff, count = args.Diff([]interface{}{"string", 123, true}) assert.Equal(t, 0, count) @@ -1260,7 +1322,7 @@ func Test_Arguments_Bool(t *testing.T) { func Test_WaitUntil_Parallel(t *testing.T) { // make a test impl object - var mockedService *TestExampleImplementation = new(TestExampleImplementation) + var mockedService = new(TestExampleImplementation) ch1 := make(chan time.Time) ch2 := make(chan time.Time) @@ -1323,6 +1385,37 @@ func (s *timer) GetTime(i int) string { return s.Called(i).Get(0).(string) } +type tCustomLogger struct { + *testing.T + logs []string + errs []string +} + +func (tc *tCustomLogger) Logf(format string, args ...interface{}) { + tc.T.Logf(format, args...) + tc.logs = append(tc.logs, fmt.Sprintf(format, args...)) +} + +func (tc *tCustomLogger) Errorf(format string, args ...interface{}) { + tc.errs = append(tc.errs, fmt.Sprintf(format, args...)) +} + +func (tc *tCustomLogger) FailNow() {} + +func TestLoggingAssertExpectations(t *testing.T) { + m := new(timer) + m.On("GetTime", 0).Return("") + tcl := &tCustomLogger{t, []string{}, []string{}} + + AssertExpectationsForObjects(tcl, m, new(TestExampleImplementation)) + + require.Equal(t, 1, len(tcl.errs)) + assert.Regexp(t, regexp.MustCompile("(?s)FAIL: 0 out of 1 expectation\\(s\\) were met.*The code you are testing needs to make 1 more call\\(s\\).*"), tcl.errs[0]) + require.Equal(t, 2, len(tcl.logs)) + assert.Regexp(t, regexp.MustCompile("(?s)FAIL:\tGetTime\\(int\\).*"), tcl.logs[0]) + require.Equal(t, "Expectations didn't match for Mock: *mock.timer", tcl.logs[1]) +} + func TestAfterTotalWaitTimeWhileExecution(t *testing.T) { waitDuration := 1 total, waitMs := 5, time.Millisecond*time.Duration(waitDuration) @@ -1342,11 +1435,63 @@ func TestAfterTotalWaitTimeWhileExecution(t *testing.T) { elapsedTime := end.Sub(start) assert.True(t, elapsedTime > waitMs, fmt.Sprintf("Total elapsed time:%v should be atleast greater than %v", elapsedTime, waitMs)) assert.Equal(t, total, len(results)) - for i, _ := range results { + for i := range results { assert.Equal(t, fmt.Sprintf("Time%d", i), results[i], "Return value of method should be same") } } +func TestArgumentMatcherToPrintMismatch(t *testing.T) { + defer func() { + if r := recover(); r != nil { + matchingExp := regexp.MustCompile( + `\s+mock: Unexpected Method Call\s+-*\s+GetTime\(int\)\s+0: 1\s+The closest call I have is:\s+GetTime\(mock.argumentMatcher\)\s+0: mock.argumentMatcher\{.*?\}\s+Diff:.*\(int=1\) not matched by func\(int\) bool`) + assert.Regexp(t, matchingExp, r) + } + }() + + m := new(timer) + m.On("GetTime", MatchedBy(func(i int) bool { return false })).Return("SomeTime").Once() + + res := m.GetTime(1) + require.Equal(t, "SomeTime", res) + m.AssertExpectations(t) +} + +func TestClosestCallMismatchedArgumentInformationShowsTheClosest(t *testing.T) { + defer func() { + if r := recover(); r != nil { + matchingExp := regexp.MustCompile(unexpectedCallRegex(`TheExampleMethod(int,int,int)`, `0: 1\s+1: 1\s+2: 2`, `0: 1\s+1: 1\s+2: 1`, `0: PASS: \(int=1\) == \(int=1\)\s+1: PASS: \(int=1\) == \(int=1\)\s+2: FAIL: \(int=2\) != \(int=1\)`)) + assert.Regexp(t, matchingExp, r) + } + }() + + m := new(TestExampleImplementation) + m.On("TheExampleMethod", 1, 1, 1).Return(1, nil).Once() + m.On("TheExampleMethod", 2, 2, 2).Return(2, nil).Once() + + m.TheExampleMethod(1, 1, 2) +} + +func TestClosestCallMismatchedArgumentValueInformation(t *testing.T) { + defer func() { + if r := recover(); r != nil { + matchingExp := regexp.MustCompile(unexpectedCallRegex(`GetTime(int)`, "0: 1", "0: 999", `0: FAIL: \(int=1\) != \(int=999\)`)) + assert.Regexp(t, matchingExp, r) + } + }() + + m := new(timer) + m.On("GetTime", 999).Return("SomeTime").Once() + + _ = m.GetTime(1) +} + +func unexpectedCallRegex(method, calledArg, expectedArg, diff string) string { + rMethod := regexp.QuoteMeta(method) + return fmt.Sprintf(`\s+mock: Unexpected Method Call\s+-*\s+%s\s+%s\s+The closest call I have is:\s+%s\s+%s\s+Diff: %s`, + rMethod, calledArg, rMethod, expectedArg, diff) +} + func ConcurrencyTestMethod(m *Mock) { m.Called() } diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go index a21d02f..535f293 100644 --- a/vendor/github.com/stretchr/testify/require/require.go +++ b/vendor/github.com/stretchr/testify/require/require.go @@ -14,16 +14,24 @@ import ( // Condition uses a Comparison to assert a complex condition. func Condition(t TestingT, comp assert.Comparison, msgAndArgs ...interface{}) { - if !assert.Condition(t, comp, msgAndArgs...) { - t.FailNow() + if assert.Condition(t, comp, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Conditionf uses a Comparison to assert a complex condition. func Conditionf(t TestingT, comp assert.Comparison, msg string, args ...interface{}) { - if !assert.Conditionf(t, comp, msg, args...) { - t.FailNow() + if assert.Conditionf(t, comp, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Contains asserts that the specified string, list(array, slice...) or map contains the @@ -32,12 +40,14 @@ func Conditionf(t TestingT, comp assert.Comparison, msg string, args ...interfac // assert.Contains(t, "Hello World", "World") // assert.Contains(t, ["Hello", "World"], "World") // assert.Contains(t, {"Hello": "World"}, "Hello") -// -// Returns whether the assertion was successful (true) or not (false). func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { - if !assert.Contains(t, s, contains, msgAndArgs...) { - t.FailNow() + if assert.Contains(t, s, contains, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Containsf asserts that the specified string, list(array, slice...) or map contains the @@ -46,91 +56,111 @@ func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...int // assert.Containsf(t, "Hello World", "World", "error message %s", "formatted") // assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted") // assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) { - if !assert.Containsf(t, s, contains, msg, args...) { - t.FailNow() + if assert.Containsf(t, s, contains, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // DirExists checks whether a directory exists in the given path. It also fails if the path is a file rather a directory or there is an error checking whether it exists. func DirExists(t TestingT, path string, msgAndArgs ...interface{}) { - if !assert.DirExists(t, path, msgAndArgs...) { - t.FailNow() + if assert.DirExists(t, path, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // DirExistsf checks whether a directory exists in the given path. It also fails if the path is a file rather a directory or there is an error checking whether it exists. func DirExistsf(t TestingT, path string, msg string, args ...interface{}) { - if !assert.DirExistsf(t, path, msg, args...) { - t.FailNow() + if assert.DirExistsf(t, path, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // ElementsMatch asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // -// assert.ElementsMatch(t, [1, 3, 2, 3], [1, 3, 3, 2])) -// -// Returns whether the assertion was successful (true) or not (false). +// assert.ElementsMatch(t, [1, 3, 2, 3], [1, 3, 3, 2]) func ElementsMatch(t TestingT, listA interface{}, listB interface{}, msgAndArgs ...interface{}) { - if !assert.ElementsMatch(t, listA, listB, msgAndArgs...) { - t.FailNow() + if assert.ElementsMatch(t, listA, listB, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // -// assert.ElementsMatchf(t, [1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted")) -// -// Returns whether the assertion was successful (true) or not (false). +// assert.ElementsMatchf(t, [1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted") func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string, args ...interface{}) { - if !assert.ElementsMatchf(t, listA, listB, msg, args...) { - t.FailNow() + if assert.ElementsMatchf(t, listA, listB, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // // assert.Empty(t, obj) -// -// Returns whether the assertion was successful (true) or not (false). func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if !assert.Empty(t, object, msgAndArgs...) { - t.FailNow() + if assert.Empty(t, object, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // // assert.Emptyf(t, obj, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) { - if !assert.Emptyf(t, object, msg, args...) { - t.FailNow() + if assert.Emptyf(t, object, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Equal asserts that two objects are equal. // // assert.Equal(t, 123, 123) // -// Returns whether the assertion was successful (true) or not (false). -// // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - if !assert.Equal(t, expected, actual, msgAndArgs...) { - t.FailNow() + if assert.Equal(t, expected, actual, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // EqualError asserts that a function returned an error (i.e. not `nil`) @@ -138,12 +168,14 @@ func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...i // // actualObj, err := SomeFunction() // assert.EqualError(t, err, expectedErrorString) -// -// Returns whether the assertion was successful (true) or not (false). func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) { - if !assert.EqualError(t, theError, errString, msgAndArgs...) { - t.FailNow() + if assert.EqualError(t, theError, errString, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // EqualErrorf asserts that a function returned an error (i.e. not `nil`) @@ -151,51 +183,59 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte // // actualObj, err := SomeFunction() // assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) { - if !assert.EqualErrorf(t, theError, errString, msg, args...) { - t.FailNow() + if assert.EqualErrorf(t, theError, errString, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // EqualValues asserts that two objects are equal or convertable to the same types // and equal. // // assert.EqualValues(t, uint32(123), int32(123)) -// -// Returns whether the assertion was successful (true) or not (false). func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - if !assert.EqualValues(t, expected, actual, msgAndArgs...) { - t.FailNow() + if assert.EqualValues(t, expected, actual, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // EqualValuesf asserts that two objects are equal or convertable to the same types // and equal. // // assert.EqualValuesf(t, uint32(123, "error message %s", "formatted"), int32(123)) -// -// Returns whether the assertion was successful (true) or not (false). func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { - if !assert.EqualValuesf(t, expected, actual, msg, args...) { - t.FailNow() + if assert.EqualValuesf(t, expected, actual, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Equalf asserts that two objects are equal. // // assert.Equalf(t, 123, 123, "error message %s", "formatted") // -// Returns whether the assertion was successful (true) or not (false). -// // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { - if !assert.Equalf(t, expected, actual, msg, args...) { - t.FailNow() + if assert.Equalf(t, expected, actual, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Error asserts that a function returned an error (i.e. not `nil`). @@ -204,12 +244,14 @@ func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, ar // if assert.Error(t, err) { // assert.Equal(t, expectedError, err) // } -// -// Returns whether the assertion was successful (true) or not (false). func Error(t TestingT, err error, msgAndArgs ...interface{}) { - if !assert.Error(t, err, msgAndArgs...) { - t.FailNow() + if assert.Error(t, err, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Errorf asserts that a function returned an error (i.e. not `nil`). @@ -218,146 +260,196 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) { // if assert.Errorf(t, err, "error message %s", "formatted") { // assert.Equal(t, expectedErrorf, err) // } -// -// Returns whether the assertion was successful (true) or not (false). func Errorf(t TestingT, err error, msg string, args ...interface{}) { - if !assert.Errorf(t, err, msg, args...) { - t.FailNow() + if assert.Errorf(t, err, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Exactly asserts that two objects are equal in value and type. // // assert.Exactly(t, int32(123), int64(123)) -// -// Returns whether the assertion was successful (true) or not (false). func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - if !assert.Exactly(t, expected, actual, msgAndArgs...) { - t.FailNow() + if assert.Exactly(t, expected, actual, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Exactlyf asserts that two objects are equal in value and type. // // assert.Exactlyf(t, int32(123, "error message %s", "formatted"), int64(123)) -// -// Returns whether the assertion was successful (true) or not (false). func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { - if !assert.Exactlyf(t, expected, actual, msg, args...) { - t.FailNow() + if assert.Exactlyf(t, expected, actual, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Fail reports a failure through func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) { - if !assert.Fail(t, failureMessage, msgAndArgs...) { - t.FailNow() + if assert.Fail(t, failureMessage, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // FailNow fails test func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) { - if !assert.FailNow(t, failureMessage, msgAndArgs...) { - t.FailNow() + if assert.FailNow(t, failureMessage, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // FailNowf fails test func FailNowf(t TestingT, failureMessage string, msg string, args ...interface{}) { - if !assert.FailNowf(t, failureMessage, msg, args...) { - t.FailNow() + if assert.FailNowf(t, failureMessage, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Failf reports a failure through func Failf(t TestingT, failureMessage string, msg string, args ...interface{}) { - if !assert.Failf(t, failureMessage, msg, args...) { - t.FailNow() + if assert.Failf(t, failureMessage, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // False asserts that the specified value is false. // // assert.False(t, myBool) -// -// Returns whether the assertion was successful (true) or not (false). func False(t TestingT, value bool, msgAndArgs ...interface{}) { - if !assert.False(t, value, msgAndArgs...) { - t.FailNow() + if assert.False(t, value, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Falsef asserts that the specified value is false. // // assert.Falsef(t, myBool, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func Falsef(t TestingT, value bool, msg string, args ...interface{}) { - if !assert.Falsef(t, value, msg, args...) { - t.FailNow() + if assert.Falsef(t, value, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // FileExists checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file. func FileExists(t TestingT, path string, msgAndArgs ...interface{}) { - if !assert.FileExists(t, path, msgAndArgs...) { - t.FailNow() + if assert.FileExists(t, path, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // FileExistsf checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file. func FileExistsf(t TestingT, path string, msg string, args ...interface{}) { - if !assert.FileExistsf(t, path, msg, args...) { - t.FailNow() + if assert.FileExistsf(t, path, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // -// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { - if !assert.HTTPBodyContains(t, handler, method, url, values, str, msgAndArgs...) { - t.FailNow() + if assert.HTTPBodyContains(t, handler, method, url, values, str, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // -// assert.HTTPBodyContainsf(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { - if !assert.HTTPBodyContainsf(t, handler, method, url, values, str, msg, args...) { - t.FailNow() + if assert.HTTPBodyContainsf(t, handler, method, url, values, str, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // -// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { - if !assert.HTTPBodyNotContains(t, handler, method, url, values, str, msgAndArgs...) { - t.FailNow() + if assert.HTTPBodyNotContains(t, handler, method, url, values, str, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // -// assert.HTTPBodyNotContainsf(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { - if !assert.HTTPBodyNotContainsf(t, handler, method, url, values, str, msg, args...) { - t.FailNow() + if assert.HTTPBodyNotContainsf(t, handler, method, url, values, str, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPError asserts that a specified handler returns an error status code. @@ -366,9 +458,13 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u // // Returns whether the assertion was successful (true) or not (false). func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { - if !assert.HTTPError(t, handler, method, url, values, msgAndArgs...) { - t.FailNow() + if assert.HTTPError(t, handler, method, url, values, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPErrorf asserts that a specified handler returns an error status code. @@ -377,9 +473,13 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, // // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { - if !assert.HTTPErrorf(t, handler, method, url, values, msg, args...) { - t.FailNow() + if assert.HTTPErrorf(t, handler, method, url, values, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPRedirect asserts that a specified handler returns a redirect status code. @@ -388,9 +488,13 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { - if !assert.HTTPRedirect(t, handler, method, url, values, msgAndArgs...) { - t.FailNow() + if assert.HTTPRedirect(t, handler, method, url, values, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPRedirectf asserts that a specified handler returns a redirect status code. @@ -399,9 +503,13 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url strin // // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { - if !assert.HTTPRedirectf(t, handler, method, url, values, msg, args...) { - t.FailNow() + if assert.HTTPRedirectf(t, handler, method, url, values, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPSuccess asserts that a specified handler returns a success status code. @@ -410,9 +518,13 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { - if !assert.HTTPSuccess(t, handler, method, url, values, msgAndArgs...) { - t.FailNow() + if assert.HTTPSuccess(t, handler, method, url, values, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // HTTPSuccessf asserts that a specified handler returns a success status code. @@ -421,191 +533,255 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { - if !assert.HTTPSuccessf(t, handler, method, url, values, msg, args...) { - t.FailNow() + if assert.HTTPSuccessf(t, handler, method, url, values, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Implements asserts that an object is implemented by the specified interface. // // assert.Implements(t, (*MyInterface)(nil), new(MyObject)) func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { - if !assert.Implements(t, interfaceObject, object, msgAndArgs...) { - t.FailNow() + if assert.Implements(t, interfaceObject, object, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Implementsf asserts that an object is implemented by the specified interface. // // assert.Implementsf(t, (*MyInterface, "error message %s", "formatted")(nil), new(MyObject)) func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { - if !assert.Implementsf(t, interfaceObject, object, msg, args...) { - t.FailNow() + if assert.Implementsf(t, interfaceObject, object, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InDelta asserts that the two numerals are within delta of each other. // // assert.InDelta(t, math.Pi, (22 / 7.0), 0.01) -// -// Returns whether the assertion was successful (true) or not (false). func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { - if !assert.InDelta(t, expected, actual, delta, msgAndArgs...) { - t.FailNow() + if assert.InDelta(t, expected, actual, delta, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func InDeltaMapValues(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { - if !assert.InDeltaMapValues(t, expected, actual, delta, msgAndArgs...) { - t.FailNow() + if assert.InDeltaMapValues(t, expected, actual, delta, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func InDeltaMapValuesf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { - if !assert.InDeltaMapValuesf(t, expected, actual, delta, msg, args...) { - t.FailNow() + if assert.InDeltaMapValuesf(t, expected, actual, delta, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InDeltaSlice is the same as InDelta, except it compares two slices. func InDeltaSlice(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { - if !assert.InDeltaSlice(t, expected, actual, delta, msgAndArgs...) { - t.FailNow() + if assert.InDeltaSlice(t, expected, actual, delta, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InDeltaSlicef is the same as InDelta, except it compares two slices. func InDeltaSlicef(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { - if !assert.InDeltaSlicef(t, expected, actual, delta, msg, args...) { - t.FailNow() + if assert.InDeltaSlicef(t, expected, actual, delta, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InDeltaf asserts that the two numerals are within delta of each other. // // assert.InDeltaf(t, math.Pi, (22 / 7.0, "error message %s", "formatted"), 0.01) -// -// Returns whether the assertion was successful (true) or not (false). func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { - if !assert.InDeltaf(t, expected, actual, delta, msg, args...) { - t.FailNow() + if assert.InDeltaf(t, expected, actual, delta, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InEpsilon asserts that expected and actual have a relative error less than epsilon -// -// Returns whether the assertion was successful (true) or not (false). func InEpsilon(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { - if !assert.InEpsilon(t, expected, actual, epsilon, msgAndArgs...) { - t.FailNow() + if assert.InEpsilon(t, expected, actual, epsilon, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. func InEpsilonSlice(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { - if !assert.InEpsilonSlice(t, expected, actual, epsilon, msgAndArgs...) { - t.FailNow() + if assert.InEpsilonSlice(t, expected, actual, epsilon, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices. func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) { - if !assert.InEpsilonSlicef(t, expected, actual, epsilon, msg, args...) { - t.FailNow() + if assert.InEpsilonSlicef(t, expected, actual, epsilon, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // InEpsilonf asserts that expected and actual have a relative error less than epsilon -// -// Returns whether the assertion was successful (true) or not (false). func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) { - if !assert.InEpsilonf(t, expected, actual, epsilon, msg, args...) { - t.FailNow() + if assert.InEpsilonf(t, expected, actual, epsilon, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // IsType asserts that the specified objects are of the same type. func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { - if !assert.IsType(t, expectedType, object, msgAndArgs...) { - t.FailNow() + if assert.IsType(t, expectedType, object, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // IsTypef asserts that the specified objects are of the same type. func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) { - if !assert.IsTypef(t, expectedType, object, msg, args...) { - t.FailNow() + if assert.IsTypef(t, expectedType, object, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // JSONEq asserts that two JSON strings are equivalent. // // assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) -// -// Returns whether the assertion was successful (true) or not (false). func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) { - if !assert.JSONEq(t, expected, actual, msgAndArgs...) { - t.FailNow() + if assert.JSONEq(t, expected, actual, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // JSONEqf asserts that two JSON strings are equivalent. // // assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func JSONEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) { - if !assert.JSONEqf(t, expected, actual, msg, args...) { - t.FailNow() + if assert.JSONEqf(t, expected, actual, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Len asserts that the specified object has specific length. // Len also fails if the object has a type that len() not accept. // // assert.Len(t, mySlice, 3) -// -// Returns whether the assertion was successful (true) or not (false). func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) { - if !assert.Len(t, object, length, msgAndArgs...) { - t.FailNow() + if assert.Len(t, object, length, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Lenf asserts that the specified object has specific length. // Lenf also fails if the object has a type that len() not accept. // // assert.Lenf(t, mySlice, 3, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) { - if !assert.Lenf(t, object, length, msg, args...) { - t.FailNow() + if assert.Lenf(t, object, length, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Nil asserts that the specified object is nil. // // assert.Nil(t, err) -// -// Returns whether the assertion was successful (true) or not (false). func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if !assert.Nil(t, object, msgAndArgs...) { - t.FailNow() + if assert.Nil(t, object, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Nilf asserts that the specified object is nil. // // assert.Nilf(t, err, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) { - if !assert.Nilf(t, object, msg, args...) { - t.FailNow() + if assert.Nilf(t, object, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NoError asserts that a function returned no error (i.e. `nil`). @@ -614,12 +790,14 @@ func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) { // if assert.NoError(t, err) { // assert.Equal(t, expectedObj, actualObj) // } -// -// Returns whether the assertion was successful (true) or not (false). func NoError(t TestingT, err error, msgAndArgs ...interface{}) { - if !assert.NoError(t, err, msgAndArgs...) { - t.FailNow() + if assert.NoError(t, err, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NoErrorf asserts that a function returned no error (i.e. `nil`). @@ -628,12 +806,14 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) { // if assert.NoErrorf(t, err, "error message %s", "formatted") { // assert.Equal(t, expectedObj, actualObj) // } -// -// Returns whether the assertion was successful (true) or not (false). func NoErrorf(t TestingT, err error, msg string, args ...interface{}) { - if !assert.NoErrorf(t, err, msg, args...) { - t.FailNow() + if assert.NoErrorf(t, err, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the @@ -642,12 +822,14 @@ func NoErrorf(t TestingT, err error, msg string, args ...interface{}) { // assert.NotContains(t, "Hello World", "Earth") // assert.NotContains(t, ["Hello", "World"], "Earth") // assert.NotContains(t, {"Hello": "World"}, "Earth") -// -// Returns whether the assertion was successful (true) or not (false). func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { - if !assert.NotContains(t, s, contains, msgAndArgs...) { - t.FailNow() + if assert.NotContains(t, s, contains, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the @@ -656,12 +838,14 @@ func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ... // assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted") // assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted") // assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) { - if !assert.NotContainsf(t, s, contains, msg, args...) { - t.FailNow() + if assert.NotContainsf(t, s, contains, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either @@ -670,12 +854,14 @@ func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, a // if assert.NotEmpty(t, obj) { // assert.Equal(t, "two", obj[1]) // } -// -// Returns whether the assertion was successful (true) or not (false). func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if !assert.NotEmpty(t, object, msgAndArgs...) { - t.FailNow() + if assert.NotEmpty(t, object, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either @@ -684,296 +870,358 @@ func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) { // if assert.NotEmptyf(t, obj, "error message %s", "formatted") { // assert.Equal(t, "two", obj[1]) // } -// -// Returns whether the assertion was successful (true) or not (false). func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) { - if !assert.NotEmptyf(t, object, msg, args...) { - t.FailNow() + if assert.NotEmptyf(t, object, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotEqual asserts that the specified values are NOT equal. // // assert.NotEqual(t, obj1, obj2) // -// Returns whether the assertion was successful (true) or not (false). -// // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - if !assert.NotEqual(t, expected, actual, msgAndArgs...) { - t.FailNow() + if assert.NotEqual(t, expected, actual, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotEqualf asserts that the specified values are NOT equal. // // assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted") // -// Returns whether the assertion was successful (true) or not (false). -// // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { - if !assert.NotEqualf(t, expected, actual, msg, args...) { - t.FailNow() + if assert.NotEqualf(t, expected, actual, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotNil asserts that the specified object is not nil. // // assert.NotNil(t, err) -// -// Returns whether the assertion was successful (true) or not (false). func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if !assert.NotNil(t, object, msgAndArgs...) { - t.FailNow() + if assert.NotNil(t, object, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotNilf asserts that the specified object is not nil. // // assert.NotNilf(t, err, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) { - if !assert.NotNilf(t, object, msg, args...) { - t.FailNow() + if assert.NotNilf(t, object, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // // assert.NotPanics(t, func(){ RemainCalm() }) -// -// Returns whether the assertion was successful (true) or not (false). func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { - if !assert.NotPanics(t, f, msgAndArgs...) { - t.FailNow() + if assert.NotPanics(t, f, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // // assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func NotPanicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) { - if !assert.NotPanicsf(t, f, msg, args...) { - t.FailNow() + if assert.NotPanicsf(t, f, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotRegexp asserts that a specified regexp does not match a string. // // assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") // assert.NotRegexp(t, "^start", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { - if !assert.NotRegexp(t, rx, str, msgAndArgs...) { - t.FailNow() + if assert.NotRegexp(t, rx, str, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotRegexpf asserts that a specified regexp does not match a string. // // assert.NotRegexpf(t, regexp.MustCompile("starts", "error message %s", "formatted"), "it's starting") // assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) { - if !assert.NotRegexpf(t, rx, str, msg, args...) { - t.FailNow() + if assert.NotRegexpf(t, rx, str, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotSubset asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // // assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") -// -// Returns whether the assertion was successful (true) or not (false). func NotSubset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) { - if !assert.NotSubset(t, list, subset, msgAndArgs...) { - t.FailNow() + if assert.NotSubset(t, list, subset, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // NotSubsetf asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // // assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func NotSubsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) { - if !assert.NotSubsetf(t, list, subset, msg, args...) { - t.FailNow() + if assert.NotSubsetf(t, list, subset, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } -// NotZero asserts that i is not the zero value for its type and returns the truth. +// NotZero asserts that i is not the zero value for its type. func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) { - if !assert.NotZero(t, i, msgAndArgs...) { - t.FailNow() + if assert.NotZero(t, i, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } -// NotZerof asserts that i is not the zero value for its type and returns the truth. +// NotZerof asserts that i is not the zero value for its type. func NotZerof(t TestingT, i interface{}, msg string, args ...interface{}) { - if !assert.NotZerof(t, i, msg, args...) { - t.FailNow() + if assert.NotZerof(t, i, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Panics asserts that the code inside the specified PanicTestFunc panics. // // assert.Panics(t, func(){ GoCrazy() }) -// -// Returns whether the assertion was successful (true) or not (false). func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { - if !assert.Panics(t, f, msgAndArgs...) { - t.FailNow() + if assert.Panics(t, f, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() }) -// -// Returns whether the assertion was successful (true) or not (false). func PanicsWithValue(t TestingT, expected interface{}, f assert.PanicTestFunc, msgAndArgs ...interface{}) { - if !assert.PanicsWithValue(t, expected, f, msgAndArgs...) { - t.FailNow() + if assert.PanicsWithValue(t, expected, f, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // // assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func PanicsWithValuef(t TestingT, expected interface{}, f assert.PanicTestFunc, msg string, args ...interface{}) { - if !assert.PanicsWithValuef(t, expected, f, msg, args...) { - t.FailNow() + if assert.PanicsWithValuef(t, expected, f, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Panicsf asserts that the code inside the specified PanicTestFunc panics. // // assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) { - if !assert.Panicsf(t, f, msg, args...) { - t.FailNow() + if assert.Panicsf(t, f, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Regexp asserts that a specified regexp matches a string. // // assert.Regexp(t, regexp.MustCompile("start"), "it's starting") // assert.Regexp(t, "start...$", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { - if !assert.Regexp(t, rx, str, msgAndArgs...) { - t.FailNow() + if assert.Regexp(t, rx, str, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Regexpf asserts that a specified regexp matches a string. // // assert.Regexpf(t, regexp.MustCompile("start", "error message %s", "formatted"), "it's starting") // assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) { - if !assert.Regexpf(t, rx, str, msg, args...) { - t.FailNow() + if assert.Regexpf(t, rx, str, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Subset asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // // assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") -// -// Returns whether the assertion was successful (true) or not (false). func Subset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) { - if !assert.Subset(t, list, subset, msgAndArgs...) { - t.FailNow() + if assert.Subset(t, list, subset, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Subsetf asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // // assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) { - if !assert.Subsetf(t, list, subset, msg, args...) { - t.FailNow() + if assert.Subsetf(t, list, subset, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // True asserts that the specified value is true. // // assert.True(t, myBool) -// -// Returns whether the assertion was successful (true) or not (false). func True(t TestingT, value bool, msgAndArgs ...interface{}) { - if !assert.True(t, value, msgAndArgs...) { - t.FailNow() + if assert.True(t, value, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // Truef asserts that the specified value is true. // // assert.Truef(t, myBool, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func Truef(t TestingT, value bool, msg string, args ...interface{}) { - if !assert.Truef(t, value, msg, args...) { - t.FailNow() + if assert.Truef(t, value, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // WithinDuration asserts that the two times are within duration delta of each other. // // assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second) -// -// Returns whether the assertion was successful (true) or not (false). func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { - if !assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) { - t.FailNow() + if assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } // WithinDurationf asserts that the two times are within duration delta of each other. // // assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) { - if !assert.WithinDurationf(t, expected, actual, delta, msg, args...) { - t.FailNow() + if assert.WithinDurationf(t, expected, actual, delta, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } -// Zero asserts that i is the zero value for its type and returns the truth. +// Zero asserts that i is the zero value for its type. func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) { - if !assert.Zero(t, i, msgAndArgs...) { - t.FailNow() + if assert.Zero(t, i, msgAndArgs...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } -// Zerof asserts that i is the zero value for its type and returns the truth. +// Zerof asserts that i is the zero value for its type. func Zerof(t TestingT, i interface{}, msg string, args ...interface{}) { - if !assert.Zerof(t, i, msg, args...) { - t.FailNow() + if assert.Zerof(t, i, msg, args...) { + return } + if h, ok := t.(tHelper); ok { + h.Helper() + } + t.FailNow() } diff --git a/vendor/github.com/stretchr/testify/require/require.go.tmpl b/vendor/github.com/stretchr/testify/require/require.go.tmpl index d2c38f6..6ffc751 100644 --- a/vendor/github.com/stretchr/testify/require/require.go.tmpl +++ b/vendor/github.com/stretchr/testify/require/require.go.tmpl @@ -1,6 +1,6 @@ {{.Comment}} func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { - if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { - t.FailNow() - } + if assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { return } + if h, ok := t.(tHelper); ok { h.Helper() } + t.FailNow() } diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go index 7694085..9fe41db 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/vendor/github.com/stretchr/testify/require/require_forward.go @@ -14,11 +14,17 @@ import ( // Condition uses a Comparison to assert a complex condition. func (a *Assertions) Condition(comp assert.Comparison, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Condition(a.t, comp, msgAndArgs...) } // Conditionf uses a Comparison to assert a complex condition. func (a *Assertions) Conditionf(comp assert.Comparison, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Conditionf(a.t, comp, msg, args...) } @@ -28,9 +34,10 @@ func (a *Assertions) Conditionf(comp assert.Comparison, msg string, args ...inte // a.Contains("Hello World", "World") // a.Contains(["Hello", "World"], "World") // a.Contains({"Hello": "World"}, "Hello") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Contains(a.t, s, contains, msgAndArgs...) } @@ -40,19 +47,26 @@ func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs .. // a.Containsf("Hello World", "World", "error message %s", "formatted") // a.Containsf(["Hello", "World"], "World", "error message %s", "formatted") // a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Containsf(s interface{}, contains interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Containsf(a.t, s, contains, msg, args...) } // DirExists checks whether a directory exists in the given path. It also fails if the path is a file rather a directory or there is an error checking whether it exists. func (a *Assertions) DirExists(path string, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } DirExists(a.t, path, msgAndArgs...) } // DirExistsf checks whether a directory exists in the given path. It also fails if the path is a file rather a directory or there is an error checking whether it exists. func (a *Assertions) DirExistsf(path string, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } DirExistsf(a.t, path, msg, args...) } @@ -60,10 +74,11 @@ func (a *Assertions) DirExistsf(path string, msg string, args ...interface{}) { // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // -// a.ElementsMatch([1, 3, 2, 3], [1, 3, 3, 2])) -// -// Returns whether the assertion was successful (true) or not (false). +// a.ElementsMatch([1, 3, 2, 3], [1, 3, 3, 2]) func (a *Assertions) ElementsMatch(listA interface{}, listB interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } ElementsMatch(a.t, listA, listB, msgAndArgs...) } @@ -71,10 +86,11 @@ func (a *Assertions) ElementsMatch(listA interface{}, listB interface{}, msgAndA // listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, // the number of appearances of each of them in both lists should match. // -// a.ElementsMatchf([1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted")) -// -// Returns whether the assertion was successful (true) or not (false). +// a.ElementsMatchf([1, 3, 2, 3], [1, 3, 3, 2], "error message %s", "formatted") func (a *Assertions) ElementsMatchf(listA interface{}, listB interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } ElementsMatchf(a.t, listA, listB, msg, args...) } @@ -82,9 +98,10 @@ func (a *Assertions) ElementsMatchf(listA interface{}, listB interface{}, msg st // a slice or a channel with len == 0. // // a.Empty(obj) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Empty(a.t, object, msgAndArgs...) } @@ -92,9 +109,10 @@ func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) { // a slice or a channel with len == 0. // // a.Emptyf(obj, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Emptyf(a.t, object, msg, args...) } @@ -102,12 +120,13 @@ func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) // // a.Equal(123, 123) // -// Returns whether the assertion was successful (true) or not (false). -// // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Equal(a.t, expected, actual, msgAndArgs...) } @@ -116,9 +135,10 @@ func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs // // actualObj, err := SomeFunction() // a.EqualError(err, expectedErrorString) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } EqualError(a.t, theError, errString, msgAndArgs...) } @@ -127,9 +147,10 @@ func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ... // // actualObj, err := SomeFunction() // a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } EqualErrorf(a.t, theError, errString, msg, args...) } @@ -137,9 +158,10 @@ func (a *Assertions) EqualErrorf(theError error, errString string, msg string, a // and equal. // // a.EqualValues(uint32(123), int32(123)) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } EqualValues(a.t, expected, actual, msgAndArgs...) } @@ -147,9 +169,10 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn // and equal. // // a.EqualValuesf(uint32(123, "error message %s", "formatted"), int32(123)) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } EqualValuesf(a.t, expected, actual, msg, args...) } @@ -157,12 +180,13 @@ func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg // // a.Equalf(123, 123, "error message %s", "formatted") // -// Returns whether the assertion was successful (true) or not (false). -// // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality // cannot be determined and will always fail. func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Equalf(a.t, expected, actual, msg, args...) } @@ -172,9 +196,10 @@ func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string // if a.Error(err) { // assert.Equal(t, expectedError, err) // } -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Error(a.t, err, msgAndArgs...) } @@ -184,115 +209,150 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { // if a.Errorf(err, "error message %s", "formatted") { // assert.Equal(t, expectedErrorf, err) // } -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Errorf(err error, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Errorf(a.t, err, msg, args...) } // Exactly asserts that two objects are equal in value and type. // // a.Exactly(int32(123), int64(123)) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Exactly(a.t, expected, actual, msgAndArgs...) } // Exactlyf asserts that two objects are equal in value and type. // // a.Exactlyf(int32(123, "error message %s", "formatted"), int64(123)) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Exactlyf(a.t, expected, actual, msg, args...) } // Fail reports a failure through func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Fail(a.t, failureMessage, msgAndArgs...) } // FailNow fails test func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } FailNow(a.t, failureMessage, msgAndArgs...) } // FailNowf fails test func (a *Assertions) FailNowf(failureMessage string, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } FailNowf(a.t, failureMessage, msg, args...) } // Failf reports a failure through func (a *Assertions) Failf(failureMessage string, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Failf(a.t, failureMessage, msg, args...) } // False asserts that the specified value is false. // // a.False(myBool) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) False(value bool, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } False(a.t, value, msgAndArgs...) } // Falsef asserts that the specified value is false. // // a.Falsef(myBool, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Falsef(value bool, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Falsef(a.t, value, msg, args...) } // FileExists checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file. func (a *Assertions) FileExists(path string, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } FileExists(a.t, path, msgAndArgs...) } // FileExistsf checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file. func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } FileExistsf(a.t, path, msg, args...) } // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // -// a.HTTPBodyContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPBodyContains(a.t, handler, method, url, values, str, msgAndArgs...) } // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // -// a.HTTPBodyContainsf(myHandler, "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPBodyContainsf(a.t, handler, method, url, values, str, msg, args...) } // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // -// a.HTTPBodyNotContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") +// a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPBodyNotContains(a.t, handler, method, url, values, str, msgAndArgs...) } // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // -// a.HTTPBodyNotContainsf(myHandler, "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPBodyNotContainsf(a.t, handler, method, url, values, str, msg, args...) } @@ -302,6 +362,9 @@ func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method strin // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPError(a.t, handler, method, url, values, msgAndArgs...) } @@ -311,6 +374,9 @@ func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url stri // // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPErrorf(a.t, handler, method, url, values, msg, args...) } @@ -320,6 +386,9 @@ func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url str // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPRedirect(a.t, handler, method, url, values, msgAndArgs...) } @@ -329,6 +398,9 @@ func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url s // // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPRedirectf(a.t, handler, method, url, values, msg, args...) } @@ -338,6 +410,9 @@ func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPSuccess(a.t, handler, method, url, values, msgAndArgs...) } @@ -347,6 +422,9 @@ func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url st // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } HTTPSuccessf(a.t, handler, method, url, values, msg, args...) } @@ -354,6 +432,9 @@ func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url s // // a.Implements((*MyInterface)(nil), new(MyObject)) func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Implements(a.t, interfaceObject, object, msgAndArgs...) } @@ -361,96 +442,129 @@ func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, // // a.Implementsf((*MyInterface, "error message %s", "formatted")(nil), new(MyObject)) func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Implementsf(a.t, interfaceObject, object, msg, args...) } // InDelta asserts that the two numerals are within delta of each other. // // a.InDelta(math.Pi, (22 / 7.0), 0.01) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InDelta(a.t, expected, actual, delta, msgAndArgs...) } // InDeltaMapValues is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func (a *Assertions) InDeltaMapValues(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InDeltaMapValues(a.t, expected, actual, delta, msgAndArgs...) } // InDeltaMapValuesf is the same as InDelta, but it compares all values between two maps. Both maps must have exactly the same keys. func (a *Assertions) InDeltaMapValuesf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InDeltaMapValuesf(a.t, expected, actual, delta, msg, args...) } // InDeltaSlice is the same as InDelta, except it compares two slices. func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...) } // InDeltaSlicef is the same as InDelta, except it compares two slices. func (a *Assertions) InDeltaSlicef(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InDeltaSlicef(a.t, expected, actual, delta, msg, args...) } // InDeltaf asserts that the two numerals are within delta of each other. // // a.InDeltaf(math.Pi, (22 / 7.0, "error message %s", "formatted"), 0.01) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) InDeltaf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InDeltaf(a.t, expected, actual, delta, msg, args...) } // InEpsilon asserts that expected and actual have a relative error less than epsilon -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...) } // InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InEpsilonSlice(a.t, expected, actual, epsilon, msgAndArgs...) } // InEpsilonSlicef is the same as InEpsilon, except it compares each value from two slices. func (a *Assertions) InEpsilonSlicef(expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InEpsilonSlicef(a.t, expected, actual, epsilon, msg, args...) } // InEpsilonf asserts that expected and actual have a relative error less than epsilon -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilon float64, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } // IsType asserts that the specified objects are of the same type. func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } IsType(a.t, expectedType, object, msgAndArgs...) } // IsTypef asserts that the specified objects are of the same type. func (a *Assertions) IsTypef(expectedType interface{}, object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } IsTypef(a.t, expectedType, object, msg, args...) } // JSONEq asserts that two JSON strings are equivalent. // // a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } JSONEq(a.t, expected, actual, msgAndArgs...) } // JSONEqf asserts that two JSON strings are equivalent. // // a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } JSONEqf(a.t, expected, actual, msg, args...) } @@ -458,9 +572,10 @@ func (a *Assertions) JSONEqf(expected string, actual string, msg string, args .. // Len also fails if the object has a type that len() not accept. // // a.Len(mySlice, 3) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Len(a.t, object, length, msgAndArgs...) } @@ -468,27 +583,30 @@ func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface // Lenf also fails if the object has a type that len() not accept. // // a.Lenf(mySlice, 3, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Lenf(a.t, object, length, msg, args...) } // Nil asserts that the specified object is nil. // // a.Nil(err) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Nil(a.t, object, msgAndArgs...) } // Nilf asserts that the specified object is nil. // // a.Nilf(err, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Nilf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Nilf(a.t, object, msg, args...) } @@ -498,9 +616,10 @@ func (a *Assertions) Nilf(object interface{}, msg string, args ...interface{}) { // if a.NoError(err) { // assert.Equal(t, expectedObj, actualObj) // } -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NoError(a.t, err, msgAndArgs...) } @@ -510,9 +629,10 @@ func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) { // if a.NoErrorf(err, "error message %s", "formatted") { // assert.Equal(t, expectedObj, actualObj) // } -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NoErrorf(a.t, err, msg, args...) } @@ -522,9 +642,10 @@ func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) { // a.NotContains("Hello World", "Earth") // a.NotContains(["Hello", "World"], "Earth") // a.NotContains({"Hello": "World"}, "Earth") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotContains(a.t, s, contains, msgAndArgs...) } @@ -534,9 +655,10 @@ func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs // a.NotContainsf("Hello World", "Earth", "error message %s", "formatted") // a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted") // a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotContainsf(a.t, s, contains, msg, args...) } @@ -546,9 +668,10 @@ func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg strin // if a.NotEmpty(obj) { // assert.Equal(t, "two", obj[1]) // } -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotEmpty(a.t, object, msgAndArgs...) } @@ -558,9 +681,10 @@ func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) { // if a.NotEmptyf(obj, "error message %s", "formatted") { // assert.Equal(t, "two", obj[1]) // } -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotEmptyf(a.t, object, msg, args...) } @@ -568,11 +692,12 @@ func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface // // a.NotEqual(obj1, obj2) // -// Returns whether the assertion was successful (true) or not (false). -// // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotEqual(a.t, expected, actual, msgAndArgs...) } @@ -580,47 +705,52 @@ func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndAr // // a.NotEqualf(obj1, obj2, "error message %s", "formatted") // -// Returns whether the assertion was successful (true) or not (false). -// // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotEqualf(a.t, expected, actual, msg, args...) } // NotNil asserts that the specified object is not nil. // // a.NotNil(err) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotNil(a.t, object, msgAndArgs...) } // NotNilf asserts that the specified object is not nil. // // a.NotNilf(err, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotNilf(a.t, object, msg, args...) } // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // // a.NotPanics(func(){ RemainCalm() }) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotPanics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotPanics(a.t, f, msgAndArgs...) } // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // // a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotPanicsf(f assert.PanicTestFunc, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotPanicsf(a.t, f, msg, args...) } @@ -628,9 +758,10 @@ func (a *Assertions) NotPanicsf(f assert.PanicTestFunc, msg string, args ...inte // // a.NotRegexp(regexp.MustCompile("starts"), "it's starting") // a.NotRegexp("^start", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotRegexp(a.t, rx, str, msgAndArgs...) } @@ -638,9 +769,10 @@ func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...in // // a.NotRegexpf(regexp.MustCompile("starts", "error message %s", "formatted"), "it's starting") // a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotRegexpf(a.t, rx, str, msg, args...) } @@ -648,9 +780,10 @@ func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, arg // elements given in the specified subset(array, slice...). // // a.NotSubset([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotSubset(a.t, list, subset, msgAndArgs...) } @@ -658,28 +791,36 @@ func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs // elements given in the specified subset(array, slice...). // // a.NotSubsetf([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) NotSubsetf(list interface{}, subset interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotSubsetf(a.t, list, subset, msg, args...) } -// NotZero asserts that i is not the zero value for its type and returns the truth. +// NotZero asserts that i is not the zero value for its type. func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotZero(a.t, i, msgAndArgs...) } -// NotZerof asserts that i is not the zero value for its type and returns the truth. +// NotZerof asserts that i is not the zero value for its type. func (a *Assertions) NotZerof(i interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } NotZerof(a.t, i, msg, args...) } // Panics asserts that the code inside the specified PanicTestFunc panics. // // a.Panics(func(){ GoCrazy() }) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Panics(a.t, f, msgAndArgs...) } @@ -687,9 +828,10 @@ func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { // the recovered panic value equals the expected panic value. // // a.PanicsWithValue("crazy error", func(){ GoCrazy() }) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) PanicsWithValue(expected interface{}, f assert.PanicTestFunc, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } PanicsWithValue(a.t, expected, f, msgAndArgs...) } @@ -697,18 +839,20 @@ func (a *Assertions) PanicsWithValue(expected interface{}, f assert.PanicTestFun // the recovered panic value equals the expected panic value. // // a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) PanicsWithValuef(expected interface{}, f assert.PanicTestFunc, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } PanicsWithValuef(a.t, expected, f, msg, args...) } // Panicsf asserts that the code inside the specified PanicTestFunc panics. // // a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Panicsf(a.t, f, msg, args...) } @@ -716,9 +860,10 @@ func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interfa // // a.Regexp(regexp.MustCompile("start"), "it's starting") // a.Regexp("start...$", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Regexp(a.t, rx, str, msgAndArgs...) } @@ -726,9 +871,10 @@ func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...inter // // a.Regexpf(regexp.MustCompile("start", "error message %s", "formatted"), "it's starting") // a.Regexpf("start...$", "it's not starting", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Regexpf(a.t, rx, str, msg, args...) } @@ -736,9 +882,10 @@ func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args . // elements given in the specified subset(array, slice...). // // a.Subset([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Subset(a.t, list, subset, msgAndArgs...) } @@ -746,54 +893,65 @@ func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ... // elements given in the specified subset(array, slice...). // // a.Subsetf([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Subsetf(a.t, list, subset, msg, args...) } // True asserts that the specified value is true. // // a.True(myBool) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) True(value bool, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } True(a.t, value, msgAndArgs...) } // Truef asserts that the specified value is true. // // a.Truef(myBool, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) Truef(value bool, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Truef(a.t, value, msg, args...) } // WithinDuration asserts that the two times are within duration delta of each other. // // a.WithinDuration(time.Now(), time.Now(), 10*time.Second) -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } WithinDuration(a.t, expected, actual, delta, msgAndArgs...) } // WithinDurationf asserts that the two times are within duration delta of each other. // // a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") -// -// Returns whether the assertion was successful (true) or not (false). func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } WithinDurationf(a.t, expected, actual, delta, msg, args...) } -// Zero asserts that i is the zero value for its type and returns the truth. +// Zero asserts that i is the zero value for its type. func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Zero(a.t, i, msgAndArgs...) } -// Zerof asserts that i is the zero value for its type and returns the truth. +// Zerof asserts that i is the zero value for its type. func (a *Assertions) Zerof(i interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } Zerof(a.t, i, msg, args...) } diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl b/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl index b93569e..54124df 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl +++ b/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl @@ -1,4 +1,5 @@ {{.CommentWithoutT "a"}} func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { + if h, ok := a.t.(tHelper); ok { h.Helper() } {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) } diff --git a/vendor/github.com/stretchr/testify/require/requirements.go b/vendor/github.com/stretchr/testify/require/requirements.go index e404f01..690583a 100644 --- a/vendor/github.com/stretchr/testify/require/requirements.go +++ b/vendor/github.com/stretchr/testify/require/requirements.go @@ -6,4 +6,24 @@ type TestingT interface { FailNow() } +type tHelper interface { + Helper() +} + +// ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful +// for table driven tests. +type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) + +// ValueAssertionFunc is a common function prototype when validating a single value. Can be useful +// for table driven tests. +type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) + +// BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful +// for table driven tests. +type BoolAssertionFunc func(TestingT, bool, ...interface{}) + +// ValuesAssertionFunc is a common function prototype when validating an error value. Can be useful +// for table driven tests. +type ErrorAssertionFunc func(TestingT, error, ...interface{}) + //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl -include-format-funcs diff --git a/vendor/github.com/stretchr/testify/require/requirements_test.go b/vendor/github.com/stretchr/testify/require/requirements_test.go index d2ccc99..39467d9 100644 --- a/vendor/github.com/stretchr/testify/require/requirements_test.go +++ b/vendor/github.com/stretchr/testify/require/requirements_test.go @@ -1,6 +1,7 @@ package require import ( + "encoding/json" "errors" "testing" "time" @@ -367,3 +368,199 @@ func TestJSONEq_ArraysOfDifferentOrder(t *testing.T) { t.Error("Check should fail") } } + +func ExampleComparisonAssertionFunc() { + t := &testing.T{} // provided by test + + adder := func(x, y int) int { + return x + y + } + + type args struct { + x int + y int + } + + tests := []struct { + name string + args args + expect int + assertion ComparisonAssertionFunc + }{ + {"2+2=4", args{2, 2}, 4, Equal}, + {"2+2!=5", args{2, 2}, 5, NotEqual}, + {"2+3==5", args{2, 3}, 5, Exactly}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.expect, adder(tt.args.x, tt.args.y)) + }) + } +} + +func TestComparisonAssertionFunc(t *testing.T) { + type iface interface { + Name() string + } + + tests := []struct { + name string + expect interface{} + got interface{} + assertion ComparisonAssertionFunc + }{ + {"implements", (*iface)(nil), t, Implements}, + {"isType", (*testing.T)(nil), t, IsType}, + {"equal", t, t, Equal}, + {"equalValues", t, t, EqualValues}, + {"exactly", t, t, Exactly}, + {"notEqual", t, nil, NotEqual}, + {"notContains", []int{1, 2, 3}, 4, NotContains}, + {"subset", []int{1, 2, 3, 4}, []int{2, 3}, Subset}, + {"notSubset", []int{1, 2, 3, 4}, []int{0, 3}, NotSubset}, + {"elementsMatch", []byte("abc"), []byte("bac"), ElementsMatch}, + {"regexp", "^t.*y$", "testify", Regexp}, + {"notRegexp", "^t.*y$", "Testify", NotRegexp}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.expect, tt.got) + }) + } +} + +func ExampleValueAssertionFunc() { + t := &testing.T{} // provided by test + + dumbParse := func(input string) interface{} { + var x interface{} + json.Unmarshal([]byte(input), &x) + return x + } + + tests := []struct { + name string + arg string + assertion ValueAssertionFunc + }{ + {"true is not nil", "true", NotNil}, + {"empty string is nil", "", Nil}, + {"zero is not nil", "0", NotNil}, + {"zero is zero", "0", Zero}, + {"false is zero", "false", Zero}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, dumbParse(tt.arg)) + }) + } +} + +func TestValueAssertionFunc(t *testing.T) { + tests := []struct { + name string + value interface{} + assertion ValueAssertionFunc + }{ + {"notNil", true, NotNil}, + {"nil", nil, Nil}, + {"empty", []int{}, Empty}, + {"notEmpty", []int{1}, NotEmpty}, + {"zero", false, Zero}, + {"notZero", 42, NotZero}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.value) + }) + } +} + +func ExampleBoolAssertionFunc() { + t := &testing.T{} // provided by test + + isOkay := func(x int) bool { + return x >= 42 + } + + tests := []struct { + name string + arg int + assertion BoolAssertionFunc + }{ + {"-1 is bad", -1, False}, + {"42 is good", 42, True}, + {"41 is bad", 41, False}, + {"45 is cool", 45, True}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, isOkay(tt.arg)) + }) + } +} + +func TestBoolAssertionFunc(t *testing.T) { + tests := []struct { + name string + value bool + assertion BoolAssertionFunc + }{ + {"true", true, True}, + {"false", false, False}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.value) + }) + } +} + +func ExampleErrorAssertionFunc() { + t := &testing.T{} // provided by test + + dumbParseNum := func(input string, v interface{}) error { + return json.Unmarshal([]byte(input), v) + } + + tests := []struct { + name string + arg string + assertion ErrorAssertionFunc + }{ + {"1.2 is number", "1.2", NoError}, + {"1.2.3 not number", "1.2.3", Error}, + {"true is not number", "true", Error}, + {"3 is number", "3", NoError}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var x float64 + tt.assertion(t, dumbParseNum(tt.arg, &x)) + }) + } +} + +func TestErrorAssertionFunc(t *testing.T) { + tests := []struct { + name string + err error + assertion ErrorAssertionFunc + }{ + {"noError", nil, NoError}, + {"error", errors.New("whoops"), Error}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.assertion(t, tt.err) + }) + } +}