diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index fa2795c8f..0e6b2bb35 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -9,15 +9,12 @@ branchProtectionRules: - "ci/kokoro: System test" - "ci/kokoro: Browser test" - docs - - lint-gax - - lint-tools - - test-gax (14) - - test-gax (16) - - test-tools (14) - - test-tools (16) + - lint + - test (12) + - test (14) + - test (16) - cla/google - - windows-gax - - windows-tools + - windows - OwlBot Post Processor permissionRules: - team: yoshi-admins diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7e0f51b1b..f447b84ab 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,11 +5,11 @@ on: pull_request: name: ci jobs: - test-gax: + test: runs-on: ubuntu-latest strategy: matrix: - node: [14, 16] + node: [12, 14, 16] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -26,28 +26,7 @@ jobs: - run: npm test env: MOCHA_THROW_DEPRECATION: false - test-tools: - runs-on: ubuntu-latest - strategy: - matrix: - node: [14, 16] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - run: node --version - # The first installation step ensures that all of our production - # dependencies work on the given Node.js version, this helps us find - # dependencies that don't match our engines field: - - run: cd tools; npm install --engine-strict --no-package-lock - # Clean up the production install, before installing dev/production: - - run: cd tools; rm -rf node_modules - - run: cd tools; npm install - - run: cd tools; npm test - env: - MOCHA_THROW_DEPRECATION: false - windows-gax: + windows: runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -58,18 +37,7 @@ jobs: - run: npm test env: MOCHA_THROW_DEPRECATION: false - windows-tools: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 14 - - run: cd tools; npm install - - run: cd tools; npm test - env: - MOCHA_THROW_DEPRECATION: false - lint-gax: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -78,15 +46,6 @@ jobs: node-version: 14 - run: npm install - run: npm run lint - lint-tools: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 14 - - run: cd tools; npm install - - run: cd tools; npm run lint docs: runs-on: ubuntu-latest steps: diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index bda58c77b..533859379 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -16,7 +16,7 @@ build_file: "gax-nodejs/.kokoro/trampoline_v2.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" diff --git a/.kokoro/continuous/node14/browser-test.cfg b/.kokoro/continuous/node12/browser-test.cfg similarity index 84% rename from .kokoro/continuous/node14/browser-test.cfg rename to .kokoro/continuous/node12/browser-test.cfg index 82fa75dd6..273b11b10 100644 --- a/.kokoro/continuous/node14/browser-test.cfg +++ b/.kokoro/continuous/node12/browser-test.cfg @@ -4,7 +4,7 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:14-puppeteer" + value: "gcr.io/cloud-devrel-kokoro-resources/node:12-puppeteer" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" diff --git a/.kokoro/continuous/node12/common.cfg b/.kokoro/continuous/node12/common.cfg index bda58c77b..533859379 100644 --- a/.kokoro/continuous/node12/common.cfg +++ b/.kokoro/continuous/node12/common.cfg @@ -16,7 +16,7 @@ build_file: "gax-nodejs/.kokoro/trampoline_v2.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" diff --git a/.kokoro/continuous/node14/common.cfg b/.kokoro/continuous/node14/common.cfg deleted file mode 100644 index bda58c77b..000000000 --- a/.kokoro/continuous/node14/common.cfg +++ /dev/null @@ -1,24 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "gax-nodejs/.kokoro/trampoline_v2.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" -} -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-nodejs/.kokoro/test.sh" -} diff --git a/.kokoro/continuous/node14/lint.cfg b/.kokoro/continuous/node14/lint.cfg deleted file mode 100644 index 018ec7aa0..000000000 --- a/.kokoro/continuous/node14/lint.cfg +++ /dev/null @@ -1,4 +0,0 @@ -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-nodejs/.kokoro/lint.sh" -} diff --git a/.kokoro/continuous/node14/samples-test.cfg b/.kokoro/continuous/node14/samples-test.cfg deleted file mode 100644 index 3fb9c46ca..000000000 --- a/.kokoro/continuous/node14/samples-test.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Download resources for system tests (service account key, etc.) -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-nodejs/.kokoro/samples-test.sh" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "long-door-651-kokoro-system-test-service-account" -} \ No newline at end of file diff --git a/.kokoro/continuous/node14/system-test.cfg b/.kokoro/continuous/node14/system-test.cfg deleted file mode 100644 index 8a980142a..000000000 --- a/.kokoro/continuous/node14/system-test.cfg +++ /dev/null @@ -1,12 +0,0 @@ -# Download resources for system tests (service account key, etc.) -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/gax-nodejs/.kokoro/system-test.sh" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "long-door-651-kokoro-system-test-service-account" -} \ No newline at end of file diff --git a/.kokoro/continuous/node14/test.cfg b/.kokoro/continuous/node14/test.cfg deleted file mode 100644 index e69de29bb..000000000 diff --git a/.kokoro/presubmit/node12/browser-test.cfg b/.kokoro/presubmit/node12/browser-test.cfg index 82fa75dd6..273b11b10 100644 --- a/.kokoro/presubmit/node12/browser-test.cfg +++ b/.kokoro/presubmit/node12/browser-test.cfg @@ -4,7 +4,7 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:14-puppeteer" + value: "gcr.io/cloud-devrel-kokoro-resources/node:12-puppeteer" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" diff --git a/.kokoro/presubmit/node12/common.cfg b/.kokoro/presubmit/node12/common.cfg index bda58c77b..533859379 100644 --- a/.kokoro/presubmit/node12/common.cfg +++ b/.kokoro/presubmit/node12/common.cfg @@ -16,7 +16,7 @@ build_file: "gax-nodejs/.kokoro/trampoline_v2.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" } env_vars: { key: "TRAMPOLINE_BUILD_FILE" diff --git a/.kokoro/publish-single.sh b/.kokoro/publish-single.sh deleted file mode 100755 index da83d60be..000000000 --- a/.kokoro/publish-single.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -npm install -npm pack . -# npm provides no way to specify, observe, or predict the name of the tarball -# file it generates. We have to look in the current directory for the freshest -# .tgz file. -TARBALL=$(ls -1 -t *.tgz | head -1) - -npm publish --access=public --registry=https://wombat-dressing-room.appspot.com "$TARBALL" - -# Kokoro collects *.tgz and package-lock.json files and stores them in Placer -# so we can generate SBOMs and attestations. -# However, we *don't* want Kokoro to collect package-lock.json and *.tgz files -# that happened to be installed with dependencies. -find node_modules -name package-lock.json -o -name "*.tgz" | xargs rm -f \ No newline at end of file diff --git a/.kokoro/publish.sh b/.kokoro/publish.sh index 4567e4576..ca1d47af3 100755 --- a/.kokoro/publish.sh +++ b/.kokoro/publish.sh @@ -1,11 +1,12 @@ #!/bin/bash -# Copyright 2022 Google LLC + +# Copyright 2018 Google LLC # # 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 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -13,25 +14,29 @@ # See the License for the specific language governing permissions and # limitations under the License. - -# `-e` enables the script to automatically fail when a command fails -# `-o pipefail` sets the exit code to the rightmost comment to exit -# with a non-zero set -eo pipefail -if [ -z "${AUTORELEASE_PR}" ] -then - echo "Need to provide URL to release PR via AUTORELEASE_PR environment variable" - exit 1 -fi - -export NPM_CONFIG_PREFIX=/home/node/.npm-global +export NPM_CONFIG_PREFIX=${HOME}/.npm-global # Start the releasetool reporter python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script +cd $(dirname $0)/.. + NPM_TOKEN=$(cat $KOKORO_KEYSTORE_DIR/73713_google-cloud-npm-token-1) echo "//wombat-dressing-room.appspot.com/:_authToken=${NPM_TOKEN}" > ~/.npmrc -SCRIPT=$(realpath $(dirname $0)/./publish-single.sh) -npx @google-cloud/mono-repo-publish custom --script="${SCRIPT}" --pr-url="${AUTORELEASE_PR}" --exclude-files=**/samples/* \ No newline at end of file +npm install +npm pack . +# npm provides no way to specify, observe, or predict the name of the tarball +# file it generates. We have to look in the current directory for the freshest +# .tgz file. +TARBALL=$(ls -1 -t *.tgz | head -1) + +npm publish --access=public --registry=https://wombat-dressing-room.appspot.com "$TARBALL" + +# Kokoro collects *.tgz and package-lock.json files and stores them in Placer +# so we can generate SBOMs and attestations. +# However, we *don't* want Kokoro to collect package-lock.json and *.tgz files +# that happened to be installed with dependencies. +find node_modules -name package-lock.json -o -name "*.tgz" | xargs rm -f \ No newline at end of file diff --git a/.kokoro/release/docs.cfg b/.kokoro/release/docs.cfg index e83e720e8..e4d025bc9 100644 --- a/.kokoro/release/docs.cfg +++ b/.kokoro/release/docs.cfg @@ -11,7 +11,7 @@ before_action { # doc publications use a Python image. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" } # Download trampoline resources. diff --git a/.kokoro/release/publish.cfg b/.kokoro/release/publish.cfg index 4f0c30a47..1aba90cb5 100644 --- a/.kokoro/release/publish.cfg +++ b/.kokoro/release/publish.cfg @@ -30,7 +30,7 @@ build_file: "gax-nodejs/.kokoro/trampoline_v2.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:14-user" + value: "gcr.io/cloud-devrel-kokoro-resources/node:12-user" } env_vars: { diff --git a/.kokoro/samples-test.sh b/.kokoro/samples-test.sh index 8c5d108cb..806c00822 100755 --- a/.kokoro/samples-test.sh +++ b/.kokoro/samples-test.sh @@ -56,7 +56,7 @@ fi # codecov combines coverage across integration and unit tests. Include # the logic below for any environment you wish to collect coverage for: -COVERAGE_NODE=14 +COVERAGE_NODE=12 if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then NYC_BIN=./node_modules/nyc/bin/nyc.js if [ -f "$NYC_BIN" ]; then diff --git a/.kokoro/system-test.sh b/.kokoro/system-test.sh index 0b3043d26..0201e9dfd 100755 --- a/.kokoro/system-test.sh +++ b/.kokoro/system-test.sh @@ -49,7 +49,7 @@ npm run system-test # codecov combines coverage across integration and unit tests. Include # the logic below for any environment you wish to collect coverage for: -COVERAGE_NODE=14 +COVERAGE_NODE=12 if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then NYC_BIN=./node_modules/nyc/bin/nyc.js if [ -f "$NYC_BIN" ]; then diff --git a/.kokoro/test.bat b/.kokoro/test.bat index 0bb124052..ae59e59be 100644 --- a/.kokoro/test.bat +++ b/.kokoro/test.bat @@ -21,7 +21,7 @@ cd .. @rem we upgrade Node.js in the image: SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm -call nvm use v14.17.3 +call nvm use v12.14.1 call which node call npm install || goto :error diff --git a/.kokoro/test.sh b/.kokoro/test.sh index 862d478d3..a5c7ac04c 100755 --- a/.kokoro/test.sh +++ b/.kokoro/test.sh @@ -39,7 +39,7 @@ npm test # codecov combines coverage across integration and unit tests. Include # the logic below for any environment you wish to collect coverage for: -COVERAGE_NODE=14 +COVERAGE_NODE=12 if npx check-node-version@3.3.0 --silent --node $COVERAGE_NODE; then NYC_BIN=./node_modules/nyc/bin/nyc.js if [ -f "$NYC_BIN" ]; then diff --git a/owlbot.py b/owlbot.py index 124a2ecda..9612005c6 100644 --- a/owlbot.py +++ b/owlbot.py @@ -14,4 +14,4 @@ import synthtool.languages.node as node -node.owlbot_main(templates_excludes=["LICENSE", "README.md", ".github/sync-repo-settings.yaml", ".github/workflows/ci.yaml",".kokoro/", ".kokoro/continuous/node12/common.cfg", ".kokoro/presubmit/node12/common.cfg", ".kokoro/release/docs.cfg", ".kokoro/release/publish.cfg"]) +node.owlbot_main(templates_excludes=["LICENSE", "README.md", ".github/sync-repo-settings.yaml"]) diff --git a/package.json b/package.json index caa8a2249..c8cf0bb10 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,14 @@ "types": "build/src/index.d.ts", "files": [ "build/src", - "build/protos/", - "!build/src/**/*.map" + "build/tools/compileProtos.js", + "build/tools/minify.js", + "build/protos/" ], + "bin": { + "compileProtos": "build/tools/compileProtos.js", + "minifyProtoJson": "build/tools/minify.js" + }, "dependencies": { "@grpc/grpc-js": "~1.8.0", "@grpc/proto-loader": "^0.7.0", @@ -35,13 +40,11 @@ "@types/object-hash": "^3.0.0", "@types/proxyquire": "^1.3.28", "@types/pumpify": "^1.4.1", - "@types/rimraf": "^3.0.2", "@types/sinon": "^10.0.0", "@types/uglify-js": "^3.17.0", "c8": "^7.0.0", "codecov": "^3.1.0", "execa": "^5.0.0", - "gapic-tools": "^0.1.7", "google-proto-files": "^3.0.0", "gts": "^3.1.0", "linkinator": "^4.0.0", @@ -50,7 +53,6 @@ "mocha": "^9.0.0", "ncp": "^2.0.0", "null-loader": "^4.0.0", - "protobufjs-cli": "1.1.1", "proxyquire": "^2.0.1", "pumpify": "^2.0.0", "rimraf": "^3.0.2", @@ -67,7 +69,7 @@ "docs": "compodoc src/", "pretest": "npm run prepare", "test": "c8 mocha build/test/unit", - "lint": "gts check src samples test", + "lint": "gts check", "clean": "gts clean", "compile": "tsc -p . && cp src/*.json build/src && cp -r test/fixtures build/test && cp -r protos build/", "compile-operation-protos": "pbjs -t json google/longrunning/operations.proto -p ./protos > protos/operations.json && pbjs -t static-module -r operations_protos google/longrunning/operations.proto -p ./protos > protos/operations.js && pbts protos/operations.js -o protos/operations.d.ts", @@ -78,7 +80,7 @@ "compile-http-protos": "pbjs -t static-module -r http_proto --keep-case google/api/http.proto -p ./protos > protos/http.js && pbts protos/http.js -o protos/http.d.ts", "compile-showcase-proto": "pbjs -t json google/showcase/v1beta1/echo.proto google/showcase/v1beta1/identity.proto google/showcase/v1beta1/messaging.proto google/showcase/v1beta1/testing.proto -p ./protos > test/fixtures/google-gax-packaging-test-app/protos/protos.json && pbjs -t static-module -r showcase_protos google/showcase/v1beta1/echo.proto google/showcase/v1beta1/identity.proto google/showcase/v1beta1/messaging.proto google/showcase/v1beta1/testing.proto -p ./protos > test/fixtures/google-gax-packaging-test-app/protos/protos.js && pbts test/fixtures/google-gax-packaging-test-app/protos/protos.js -o test/fixtures/google-gax-packaging-test-app/protos/protos.d.ts", "fix": "gts fix", - "prepare": "npm run compile && prepublishProtos . && mkdirp build/protos && cp -r protos/* build/protos/ && npm run minify-proto-json", + "prepare": "npm run compile && node ./build/tools/prepublish.js && mkdirp build/protos && cp -r protos/* build/protos/ && npm run minify-proto-json", "system-test": "c8 mocha build/test/system-test --timeout 600000 && npm run test-application", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "docs-test": "linkinator docs", @@ -87,8 +89,8 @@ "test-application": "cd test/test-application && npm run prefetch && npm install && npm start", "prelint": "cd samples; npm link ../; npm install", "precompile": "gts clean", - "update-protos": "listProtos .", - "minify-proto-json": "minifyProtoJson" + "update-protos": "node ./build/tools/listProtos.js", + "minify-proto-json": "node ./build/tools/minify.js" }, "repository": "googleapis/gax-nodejs", "keywords": [ @@ -101,7 +103,7 @@ }, "homepage": "https://github.com/googleapis/gax-nodejs#readme", "engines": { - "node": ">=14" + "node": ">=12" }, "browser": "build/src/fallback.js" } diff --git a/release-please-config.json b/release-please-config.json deleted file mode 100644 index a6ee711d8..000000000 --- a/release-please-config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "initial-version": "0.1.0", - "packages": { - ".": {}, - "tools": {} - }, - "release-type": "node" - } - \ No newline at end of file diff --git a/release-please-manifest.json b/release-please-manifest.json deleted file mode 100644 index 95687d593..000000000 --- a/release-please-manifest.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - ".": "3.6.0", - "tools": "0.1.7" -} diff --git a/tools/test/fixtures/dts-update/google/dts.proto b/test/fixtures/dts-update/google/dts.proto similarity index 100% rename from tools/test/fixtures/dts-update/google/dts.proto rename to test/fixtures/dts-update/google/dts.proto diff --git a/tools/test/fixtures/dts-update/test_proto_list.json b/test/fixtures/dts-update/test_proto_list.json similarity index 100% rename from tools/test/fixtures/dts-update/test_proto_list.json rename to test/fixtures/dts-update/test_proto_list.json diff --git a/tools/test/fixtures/echo.js b/test/fixtures/echo.js similarity index 100% rename from tools/test/fixtures/echo.js rename to test/fixtures/echo.js diff --git a/tools/test/fixtures/package.json b/test/fixtures/package.json similarity index 100% rename from tools/test/fixtures/package.json rename to test/fixtures/package.json diff --git a/tools/test/fixtures/protoLists/empty/README.txt b/test/fixtures/protoLists/empty/README.txt similarity index 100% rename from tools/test/fixtures/protoLists/empty/README.txt rename to test/fixtures/protoLists/empty/README.txt diff --git a/tools/test/fixtures/protoLists/nestedDir/test2_proto_list.json b/test/fixtures/protoLists/nestedDir/test2_proto_list.json similarity index 100% rename from tools/test/fixtures/protoLists/nestedDir/test2_proto_list.json rename to test/fixtures/protoLists/nestedDir/test2_proto_list.json diff --git a/tools/test/fixtures/protoLists/test1_proto_list.json b/test/fixtures/protoLists/test1_proto_list.json similarity index 100% rename from tools/test/fixtures/protoLists/test1_proto_list.json rename to test/fixtures/protoLists/test1_proto_list.json diff --git a/test/showcase-echo-client/package.json b/test/showcase-echo-client/package.json index df4d9a444..2eff9b203 100644 --- a/test/showcase-echo-client/package.json +++ b/test/showcase-echo-client/package.json @@ -43,25 +43,10 @@ "google-gax": "./google-gax.tgz" }, "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.14", - "c8": "^7.13.0", - "gts": "^3.1.1", - "jsdoc": "^4.0.2", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.1.2", - "mocha": "^10.2.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.0.4", - "ts-loader": "^8.4.0", - "typescript": "^4.8.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" + "@types/node": "^16.0.0", + "typescript": "^4.5.5" }, "engines": { - "node": ">=v14" + "node": ">=v12" } } diff --git a/test/test-application/package.json b/test/test-application/package.json index c2ad41876..7000ae7ee 100644 --- a/test/test-application/package.json +++ b/test/test-application/package.json @@ -31,6 +31,6 @@ "protobufjs": "^7.0.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=12.0.0" } } diff --git a/tools/test/compileProtos.ts b/test/unit/compileProtos.ts similarity index 99% rename from tools/test/compileProtos.ts rename to test/unit/compileProtos.ts index 87020b606..0f6c5d41d 100644 --- a/tools/test/compileProtos.ts +++ b/test/unit/compileProtos.ts @@ -21,7 +21,7 @@ import * as rimraf from 'rimraf'; import * as util from 'util'; import * as path from 'path'; import * as protobuf from 'protobufjs'; -import * as compileProtos from '../src/compileProtos'; +import * as compileProtos from '../../tools/compileProtos'; const readFile = util.promisify(fs.readFile); const mkdir = util.promisify(fs.mkdir); diff --git a/tools/test/minify.ts b/test/unit/minify.ts similarity index 95% rename from tools/test/minify.ts rename to test/unit/minify.ts index 14d86eebf..509057add 100644 --- a/tools/test/minify.ts +++ b/test/unit/minify.ts @@ -18,12 +18,12 @@ import * as fs from 'fs'; import {promises as fsp} from 'fs'; import * as rimraf from 'rimraf'; import * as path from 'path'; -import * as minify from '../src/minify'; +import * as minify from '../../tools/minify'; import {promisify} from 'util'; const rmrf = promisify(rimraf); const testDir = path.join(process.cwd(), '.minify-test'); -const fixturesDir = path.join(__dirname, '..', 'test', 'fixtures'); +const fixturesDir = path.join(__dirname, '..', 'fixtures'); describe('minify tool', () => { beforeEach(async () => { diff --git a/tools/.eslintignore b/tools/.eslintignore deleted file mode 100644 index ea5b04aeb..000000000 --- a/tools/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ -samples/generated/ diff --git a/tools/.eslintrc.json b/tools/.eslintrc.json deleted file mode 100644 index 3e8d97ccb..000000000 --- a/tools/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./node_modules/gts", - "root": true -} diff --git a/tools/.gitignore b/tools/.gitignore deleted file mode 100644 index 14c3dc31f..000000000 --- a/tools/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -coverage -npm-debug.log -**/*.log -**/node_modules -.coverage -.nyc_output -docs/ -protos/google/ -out/ -system-test/secrets.js -system-test/*key.json -build -.vscode -package-lock.json -.system-test-run/ -.kitchen-sink/ -.showcase-server-dir/ -.compileProtos-test/ -.minify-test/ -__pycache__ -doc/ -dist/ -*.tgz -**/*.tgz -test/showcase-echo-client/protos/protos.* diff --git a/tools/.prettierignore b/tools/.prettierignore deleted file mode 100644 index 9340ad9b8..000000000 --- a/tools/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/tools/.prettierrc.js b/tools/.prettierrc.js deleted file mode 100644 index 1e6cec783..000000000 --- a/tools/.prettierrc.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/tools/CODE_OF_CONDUCT.md b/tools/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a..000000000 --- a/tools/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/tools/CONTRIBUTING.md b/tools/CONTRIBUTING.md deleted file mode 100644 index 72c44cada..000000000 --- a/tools/CONTRIBUTING.md +++ /dev/null @@ -1,74 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - - -## Running the tests - -1. [Prepare your environment for Node.js setup][setup]. - -1. Install dependencies: - - npm install - -1. Run the tests: - - # Run unit tests. - npm test - - # Run sample integration tests. - npm run samples-test - - # Run all system tests. - npm run system-test - -1. Lint (and maybe fix) any changes: - - npm run fix - -[setup]: https://cloud.google.com/nodejs/docs/setup -[projects]: https://console.cloud.google.com/project -[billing]: https://support.google.com/cloud/answer/6293499#enable-billing - -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/tools/LICENSE b/tools/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/tools/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/tools/src/compileProtos.ts b/tools/compileProtos.ts similarity index 98% rename from tools/src/compileProtos.ts rename to tools/compileProtos.ts index d6245d41e..ddb0fc6af 100644 --- a/tools/src/compileProtos.ts +++ b/tools/compileProtos.ts @@ -215,7 +215,6 @@ async function buildListOfProtos(protoJsonFiles: string[]): Promise { ); result.push(...list); } - return result; } @@ -246,7 +245,7 @@ async function compileProtos( '-p', 'protos', '-p', - path.join(__dirname, '..', '..', '..', 'google-gax', 'build', 'protos'), + path.join(__dirname, '..', '..', 'build', 'protos'), '-o', jsonOutput, ]; @@ -264,7 +263,7 @@ async function compileProtos( '-p', 'protos', '-p', - path.join(__dirname, '..', '..', '..', 'google-gax', 'build', 'protos'), + path.join(__dirname, '..', '..', 'build', 'protos'), '-o', jsOutput, ]; diff --git a/tools/src/listProtos.ts b/tools/listProtos.ts similarity index 53% rename from tools/src/listProtos.ts rename to tools/listProtos.ts index ae797919f..d605a916e 100644 --- a/tools/src/listProtos.ts +++ b/tools/listProtos.ts @@ -22,29 +22,12 @@ import * as fs from 'fs'; import * as path from 'path'; import * as walk from 'walkdir'; -async function main(directory: string) { - const googleProtoFilesDir = path.join(directory, 'protos'); - const outputFile = path.join(directory, 'src', 'protosList.json'); - const commonProtoFiles = walk - .sync(googleProtoFilesDir) - .filter(f => path.extname(f) === '.proto') - .map(f => f.match(/protos\/(.*)/)![1]); +const googleProtoFilesDir = path.join(__dirname, '..', '..', 'protos'); +const outputFile = path.join(__dirname, '..', '..', 'src', 'protosList.json'); - fs.writeFileSync( - outputFile, - JSON.stringify(commonProtoFiles, null, 2) + '\n' - ); -} -/** - * Shows the usage information. - */ -function usage() { - console.log(`Usage: node ${process.argv[1]} directory ...`); -} +const commonProtoFiles = walk + .sync(googleProtoFilesDir) + .filter(f => path.extname(f) === '.proto') + .map(f => path.normalize(f).substring(googleProtoFilesDir.length + 1)); -if (require.main === module) { - if (process.argv.length < 3 || process.argv[2] === '--help') { - usage(); - } - main(process.argv[2]); -} +fs.writeFileSync(outputFile, JSON.stringify(commonProtoFiles, null, 2) + '\n'); diff --git a/tools/src/minify.ts b/tools/minify.ts similarity index 100% rename from tools/src/minify.ts rename to tools/minify.ts diff --git a/tools/package.json b/tools/package.json deleted file mode 100644 index 53b34d894..000000000 --- a/tools/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "gapic-tools", - "version": "0.1.7", - "description": "compiles, updates, and minifies protos", - "main": "build/src/compileProtos.js", - "files": [ - "build/tools/src", - "!build/src/**/*.map" - ], - "scripts": { - "pretest": "npm run prepare", - "test": "c8 mocha build/test", - "lint": "gts check test src", - "clean": "gts clean", - "compile": "tsc -p . && cp -r test/fixtures build/test", - "fix": "gts fix", - "prepare": "npm run compile", - "precompile": "gts clean", - "system-test": "echo 'no system-test'", - "samples-test": "echo 'no samples'" - }, - "bin": { - "compileProtos": "./build/src/compileProtos.js", - "minifyProtoJson": "./build/src/minify.js", - "prepublishProtos": "./build/src/prepublish.js", - "listProtos": "./build/src/listProtos.js" - }, - "author": "Google API Authors", - "license": "Apache-2.0", - "dependencies": { - "@types/rimraf": "^3.0.2", - "google-proto-files": "^3.0.0", - "protobufjs-cli": "1.1.1", - "uglify-js": "^3.17.0", - "walkdir": "^0.4.0", - "rimraf": "^3.0.2" - }, - "repository": "googleapis/gax-nodejs", - "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/ncp": "^2.0.1", - "@types/uglify-js": "^3.17.0", - "c8": "^7.0.0", - "gts": "^3.1.1", - "mocha": "^9.0.0", - "ncp": "^2.0.0", - "protobufjs": "7.2.3", - "typescript": "^4.6.4" - }, - "engines": { - "node": ">=14" - } -} diff --git a/tools/src/prepublish.ts b/tools/prepublish.ts old mode 100755 new mode 100644 similarity index 62% rename from tools/src/prepublish.ts rename to tools/prepublish.ts index 05895f35d..9fc8449cb --- a/tools/src/prepublish.ts +++ b/tools/prepublish.ts @@ -1,5 +1,3 @@ -#!/usr/bin/env node - /** * Copyright 2020 Google LLC * @@ -20,12 +18,14 @@ import {getProtoPath} from 'google-proto-files'; import * as path from 'path'; // Note: the following three imports will be all gone when we support Node.js 16+. // But until then, we'll use these modules. -import * as fs from 'fs'; +import * as rimraf from 'rimraf'; +import mkdirp from 'mkdirp'; import * as ncp from 'ncp'; import {promisify} from 'util'; -const fsp = fs.promises; const ncpp = promisify(ncp); +const rmrf = promisify(rimraf); + const subdirs = [ 'api', 'iam/v1', @@ -38,38 +38,18 @@ const subdirs = [ 'cloud/location', ]; -async function main(directory: string) { - await fsp.rm(path.join(directory, 'protos', 'google'), { - recursive: true, - force: true, - }); - await fsp.mkdir(path.join(directory, 'protos', 'google'), {recursive: true}); +async function main() { + await rmrf(path.join('protos', 'google')); + await mkdirp(path.join('protos', 'google')); for (const subdir of subdirs) { const src = getProtoPath(subdir); - const target = path.join(directory, 'protos', 'google', subdir); + const target = path.join('protos', 'google', subdir); console.log(`Copying protos from ${src} to ${target}`); - await fsp.mkdir(target, {recursive: true}); + await mkdirp(target); await ncpp(src, target); } console.log('Protos have been copied successfully'); } -/** - * Shows the usage information. - */ -function usage() { - console.log(`Usage: node ${process.argv[1]} directory ...`); -} - -if (require.main === module) { - // argv[0] is node.js binary, argv[1] is script path - - if (process.argv[2] === '--help') { - usage(); - // eslint-disable-next-line no-process-exit - process.exit(1); - } - - main(process.argv[2]); -} +main().catch(console.error); diff --git a/tools/test/fixtures/echo.json b/tools/test/fixtures/echo.json deleted file mode 100644 index f545202f4..000000000 --- a/tools/test/fixtures/echo.json +++ /dev/null @@ -1,3257 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "showcase": { - "nested": { - "v1beta1": { - "options": { - "go_package": "github.com/googleapis/gapic-showcase/server/genproto", - "java_package": "com.google.showcase.v1beta1", - "java_multiple_files": true - }, - "nested": { - "Echo": { - "options": { - "(google.api.default_host)": "localhost:7469" - }, - "methods": { - "Echo": { - "requestType": "EchoRequest", - "responseType": "EchoResponse", - "options": { - "(google.api.http).post": "/v1beta1/echo:echo", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/echo:echo", - "body": "*" - } - } - ] - }, - "Expand": { - "requestType": "ExpandRequest", - "responseType": "EchoResponse", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1beta1/echo:expand", - "(google.api.http).body": "*", - "(google.api.method_signature)": "content,error" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/echo:expand", - "body": "*" - } - }, - { - "(google.api.method_signature)": "content,error" - } - ] - }, - "Collect": { - "requestType": "EchoRequest", - "requestStream": true, - "responseType": "EchoResponse", - "options": { - "(google.api.http).post": "/v1beta1/echo:collect", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/echo:collect", - "body": "*" - } - } - ] - }, - "Chat": { - "requestType": "EchoRequest", - "requestStream": true, - "responseType": "EchoResponse", - "responseStream": true - }, - "PagedExpand": { - "requestType": "PagedExpandRequest", - "responseType": "PagedExpandResponse", - "options": { - "(google.api.http).post": "/v1beta1/echo:pagedExpand", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/echo:pagedExpand", - "body": "*" - } - } - ] - }, - "Wait": { - "requestType": "WaitRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/echo:wait", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "WaitResponse", - "(google.longrunning.operation_info).metadata_type": "WaitMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/echo:wait", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "WaitResponse", - "metadata_type": "WaitMetadata" - } - } - ] - }, - "Block": { - "requestType": "BlockRequest", - "responseType": "BlockResponse", - "options": { - "(google.api.http).post": "/v1beta1/echo:block", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/echo:block", - "body": "*" - } - } - ] - } - } - }, - "EchoRequest": { - "oneofs": { - "response": { - "oneof": [ - "content", - "error" - ] - } - }, - "fields": { - "content": { - "type": "string", - "id": 1 - }, - "error": { - "type": "google.rpc.Status", - "id": 2 - } - } - }, - "EchoResponse": { - "fields": { - "content": { - "type": "string", - "id": 1 - } - } - }, - "ExpandRequest": { - "fields": { - "content": { - "type": "string", - "id": 1 - }, - "error": { - "type": "google.rpc.Status", - "id": 2 - } - } - }, - "PagedExpandRequest": { - "fields": { - "content": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "PagedExpandResponse": { - "fields": { - "responses": { - "rule": "repeated", - "type": "EchoResponse", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "WaitRequest": { - "oneofs": { - "end": { - "oneof": [ - "endTime", - "ttl" - ] - }, - "response": { - "oneof": [ - "error", - "success" - ] - } - }, - "fields": { - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "ttl": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "error": { - "type": "google.rpc.Status", - "id": 2 - }, - "success": { - "type": "WaitResponse", - "id": 3 - } - } - }, - "WaitResponse": { - "fields": { - "content": { - "type": "string", - "id": 1 - } - } - }, - "WaitMetadata": { - "fields": { - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - } - } - }, - "BlockRequest": { - "oneofs": { - "response": { - "oneof": [ - "error", - "success" - ] - } - }, - "fields": { - "responseDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "error": { - "type": "google.rpc.Status", - "id": 2 - }, - "success": { - "type": "BlockResponse", - "id": 3 - } - } - }, - "BlockResponse": { - "fields": { - "content": { - "type": "string", - "id": 1 - } - } - }, - "Identity": { - "options": { - "(google.api.default_host)": "localhost:7469" - }, - "methods": { - "CreateUser": { - "requestType": "CreateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).post": "/v1beta1/users", - "(google.api.http).body": "*", - "(google.api.method_signature)": "user.display_name,user.email,user.age,user.nickname,user.enable_notifications,user.height_feet" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/users", - "body": "*" - } - }, - { - "(google.api.method_signature)": "user.display_name,user.email" - }, - { - "(google.api.method_signature)": "user.display_name,user.email,user.age,user.nickname,user.enable_notifications,user.height_feet" - } - ] - }, - "GetUser": { - "requestType": "GetUserRequest", - "responseType": "User", - "options": { - "(google.api.http).get": "/v1beta1/{name=users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateUser": { - "requestType": "UpdateUserRequest", - "responseType": "User", - "options": { - "(google.api.http).patch": "/v1beta1/{user.name=users/*}", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta1/{user.name=users/*}", - "body": "*" - } - } - ] - }, - "DeleteUser": { - "requestType": "DeleteUserRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta1/{name=users/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta1/{name=users/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListUsers": { - "requestType": "ListUsersRequest", - "responseType": "ListUsersResponse", - "options": { - "(google.api.http).get": "/v1beta1/users" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/users" - } - } - ] - } - } - }, - "User": { - "options": { - "(google.api.resource).type": "showcase.googleapis.com/User", - "(google.api.resource).pattern": "users/{user_id}" - }, - "oneofs": { - "_age": { - "oneof": [ - "age" - ] - }, - "_heightFeet": { - "oneof": [ - "heightFeet" - ] - }, - "_nickname": { - "oneof": [ - "nickname" - ] - }, - "_enableNotifications": { - "oneof": [ - "enableNotifications" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "email": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "age": { - "type": "int32", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "heightFeet": { - "type": "double", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "nickname": { - "type": "string", - "id": 8, - "options": { - "proto3_optional": true - } - }, - "enableNotifications": { - "type": "bool", - "id": 9, - "options": { - "proto3_optional": true - } - } - } - }, - "CreateUserRequest": { - "fields": { - "user": { - "type": "User", - "id": 1 - } - } - }, - "GetUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/User", - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateUserRequest": { - "fields": { - "user": { - "type": "User", - "id": 1 - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "DeleteUserRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/User", - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListUsersRequest": { - "fields": { - "pageSize": { - "type": "int32", - "id": 1 - }, - "pageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListUsersResponse": { - "fields": { - "users": { - "rule": "repeated", - "type": "User", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Messaging": { - "options": { - "(google.api.default_host)": "localhost:7469" - }, - "methods": { - "CreateRoom": { - "requestType": "CreateRoomRequest", - "responseType": "Room", - "options": { - "(google.api.http).post": "/v1beta1/rooms", - "(google.api.http).body": "*", - "(google.api.method_signature)": "room.display_name,room.description" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/rooms", - "body": "*" - } - }, - { - "(google.api.method_signature)": "room.display_name,room.description" - } - ] - }, - "GetRoom": { - "requestType": "GetRoomRequest", - "responseType": "Room", - "options": { - "(google.api.http).get": "/v1beta1/{name=rooms/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=rooms/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateRoom": { - "requestType": "UpdateRoomRequest", - "responseType": "Room", - "options": { - "(google.api.http).patch": "/v1beta1/{room.name=rooms/*}", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta1/{room.name=rooms/*}", - "body": "*" - } - } - ] - }, - "DeleteRoom": { - "requestType": "DeleteRoomRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta1/{name=rooms/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta1/{name=rooms/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListRooms": { - "requestType": "ListRoomsRequest", - "responseType": "ListRoomsResponse", - "options": { - "(google.api.http).get": "/v1beta1/rooms" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/rooms" - } - } - ] - }, - "CreateBlurb": { - "requestType": "CreateBlurbRequest", - "responseType": "Blurb", - "options": { - "(google.api.http).post": "/v1beta1/{parent=rooms/*}/blurbs", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1beta1/{parent=users/*/profile}/blurbs", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,blurb.user,blurb.image" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{parent=rooms/*}/blurbs", - "body": "*", - "additional_bindings": { - "post": "/v1beta1/{parent=users/*/profile}/blurbs", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "parent,blurb.user,blurb.text" - }, - { - "(google.api.method_signature)": "parent,blurb.user,blurb.image" - } - ] - }, - "GetBlurb": { - "requestType": "GetBlurbRequest", - "responseType": "Blurb", - "options": { - "(google.api.http).get": "/v1beta1/{name=rooms/*/blurbs/*}", - "(google.api.http).additional_bindings.get": "/v1beta1/{name=users/*/profile/blurbs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=rooms/*/blurbs/*}", - "additional_bindings": { - "get": "/v1beta1/{name=users/*/profile/blurbs/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateBlurb": { - "requestType": "UpdateBlurbRequest", - "responseType": "Blurb", - "options": { - "(google.api.http).patch": "/v1beta1/{blurb.name=rooms/*/blurbs/*}", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.patch": "/v1beta1/{blurb.name=users/*/profile/blurbs/*}", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta1/{blurb.name=rooms/*/blurbs/*}", - "body": "*", - "additional_bindings": { - "patch": "/v1beta1/{blurb.name=users/*/profile/blurbs/*}", - "body": "*" - } - } - } - ] - }, - "DeleteBlurb": { - "requestType": "DeleteBlurbRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta1/{name=rooms/*/blurbs/*}", - "(google.api.http).additional_bindings.delete": "/v1beta1/{name=users/*/profile/blurbs/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta1/{name=rooms/*/blurbs/*}", - "additional_bindings": { - "delete": "/v1beta1/{name=users/*/profile/blurbs/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListBlurbs": { - "requestType": "ListBlurbsRequest", - "responseType": "ListBlurbsResponse", - "options": { - "(google.api.http).get": "/v1beta1/{parent=rooms/*}/blurbs", - "(google.api.http).additional_bindings.get": "/v1beta1/{parent=users/*/profile}/blurbs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{parent=rooms/*}/blurbs", - "additional_bindings": { - "get": "/v1beta1/{parent=users/*/profile}/blurbs" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "SearchBlurbs": { - "requestType": "SearchBlurbsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{parent=rooms/-}/blurbs:search", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1beta1/{parent=users/-/profile}/blurbs:search", - "(google.longrunning.operation_info).response_type": "SearchBlurbsResponse", - "(google.longrunning.operation_info).metadata_type": "SearchBlurbsMetadata", - "(google.api.method_signature)": "query" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{parent=rooms/-}/blurbs:search", - "body": "*", - "additional_bindings": { - "post": "/v1beta1/{parent=users/-/profile}/blurbs:search" - } - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "SearchBlurbsResponse", - "metadata_type": "SearchBlurbsMetadata" - } - }, - { - "(google.api.method_signature)": "query" - } - ] - }, - "StreamBlurbs": { - "requestType": "StreamBlurbsRequest", - "responseType": "StreamBlurbsResponse", - "responseStream": true, - "options": { - "(google.api.http).post": "/v1beta1/{name=rooms/*}/blurbs:stream", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1beta1/{name=users/*/profile}/blurbs:stream", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{name=rooms/*}/blurbs:stream", - "body": "*", - "additional_bindings": { - "post": "/v1beta1/{name=users/*/profile}/blurbs:stream", - "body": "*" - } - } - } - ] - }, - "SendBlurbs": { - "requestType": "CreateBlurbRequest", - "requestStream": true, - "responseType": "SendBlurbsResponse", - "options": { - "(google.api.http).post": "/v1beta1/{parent=rooms/*}/blurbs:send", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1beta1/{parent=users/*/profile}/blurbs:send", - "(google.api.http).additional_bindings.body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{parent=rooms/*}/blurbs:send", - "body": "*", - "additional_bindings": { - "post": "/v1beta1/{parent=users/*/profile}/blurbs:send", - "body": "*" - } - } - } - ] - }, - "Connect": { - "requestType": "ConnectRequest", - "requestStream": true, - "responseType": "StreamBlurbsResponse", - "responseStream": true - } - } - }, - "Room": { - "options": { - "(google.api.resource).type": "showcase.googleapis.com/Room", - "(google.api.resource).pattern": "rooms/{room_id}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CreateRoomRequest": { - "fields": { - "room": { - "type": "Room", - "id": 1 - } - } - }, - "GetRoomRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Room", - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateRoomRequest": { - "fields": { - "room": { - "type": "Room", - "id": 1 - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "DeleteRoomRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Room", - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListRoomsRequest": { - "fields": { - "pageSize": { - "type": "int32", - "id": 1 - }, - "pageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListRoomsResponse": { - "fields": { - "rooms": { - "rule": "repeated", - "type": "Room", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "Blurb": { - "options": { - "(google.api.resource).type": "showcase.googleapis.com/Blurb", - "(google.api.resource).pattern": "user/{user_id}/profile/blurbs/legacy/{legacy_user_id}~{blurb_id}" - }, - "oneofs": { - "content": { - "oneof": [ - "text", - "image" - ] - }, - "legacyId": { - "oneof": [ - "legacyRoomId", - "legacyUserId" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "user": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/User", - "(google.api.field_behavior)": "REQUIRED" - } - }, - "text": { - "type": "string", - "id": 3 - }, - "image": { - "type": "bytes", - "id": 4 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "legacyRoomId": { - "type": "string", - "id": 7 - }, - "legacyUserId": { - "type": "string", - "id": 8 - } - } - }, - "CreateBlurbRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).child_type": "showcase.googleapis.com/Blurb", - "(google.api.field_behavior)": "REQUIRED" - } - }, - "blurb": { - "type": "Blurb", - "id": 2 - } - } - }, - "GetBlurbRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Blurb", - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateBlurbRequest": { - "fields": { - "blurb": { - "type": "Blurb", - "id": 1 - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "DeleteBlurbRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Blurb", - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListBlurbsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).child_type": "showcase.googleapis.com/Blurb", - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListBlurbsResponse": { - "fields": { - "blurbs": { - "rule": "repeated", - "type": "Blurb", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "SearchBlurbsRequest": { - "fields": { - "query": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "parent": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).child_type": "showcase.googleapis.com/Blurb" - } - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "SearchBlurbsMetadata": { - "fields": { - "retryInfo": { - "type": "google.rpc.RetryInfo", - "id": 1 - } - } - }, - "SearchBlurbsResponse": { - "fields": { - "blurbs": { - "rule": "repeated", - "type": "Blurb", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "StreamBlurbsRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).child_type": "showcase.googleapis.com/Blurb", - "(google.api.field_behavior)": "REQUIRED" - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "StreamBlurbsResponse": { - "fields": { - "blurb": { - "type": "Blurb", - "id": 1 - }, - "action": { - "type": "Action", - "id": 2 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "CREATE": 1, - "UPDATE": 2, - "DELETE": 3 - } - } - } - }, - "SendBlurbsResponse": { - "fields": { - "names": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "ConnectRequest": { - "oneofs": { - "request": { - "oneof": [ - "config", - "blurb" - ] - } - }, - "fields": { - "config": { - "type": "ConnectConfig", - "id": 1 - }, - "blurb": { - "type": "Blurb", - "id": 2 - } - }, - "nested": { - "ConnectConfig": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).child_type": "showcase.googleapis.com/Blurb" - } - } - } - } - } - }, - "Testing": { - "options": { - "(google.api.default_host)": "localhost:7469" - }, - "methods": { - "CreateSession": { - "requestType": "CreateSessionRequest", - "responseType": "Session", - "options": { - "(google.api.http).post": "/v1beta1/sessions", - "(google.api.http).body": "session" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/sessions", - "body": "session" - } - } - ] - }, - "GetSession": { - "requestType": "GetSessionRequest", - "responseType": "Session", - "options": { - "(google.api.http).get": "/v1beta1/{name=sessions/*}" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=sessions/*}" - } - } - ] - }, - "ListSessions": { - "requestType": "ListSessionsRequest", - "responseType": "ListSessionsResponse", - "options": { - "(google.api.http).get": "/v1beta1/sessions" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/sessions" - } - } - ] - }, - "DeleteSession": { - "requestType": "DeleteSessionRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta1/{name=sessions/*}" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta1/{name=sessions/*}" - } - } - ] - }, - "ReportSession": { - "requestType": "ReportSessionRequest", - "responseType": "ReportSessionResponse", - "options": { - "(google.api.http).post": "/v1beta1/{name=sessions/*}:report" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{name=sessions/*}:report" - } - } - ] - }, - "ListTests": { - "requestType": "ListTestsRequest", - "responseType": "ListTestsResponse", - "options": { - "(google.api.http).get": "/v1beta1/{parent=sessions/*}/tests" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{parent=sessions/*}/tests" - } - } - ] - }, - "DeleteTest": { - "requestType": "DeleteTestRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta1/{name=sessions/*/tests/*}" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta1/{name=sessions/*/tests/*}" - } - } - ] - }, - "VerifyTest": { - "requestType": "VerifyTestRequest", - "responseType": "VerifyTestResponse", - "options": { - "(google.api.http).post": "/v1beta1/{name=sessions/*/tests/*}:check" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{name=sessions/*/tests/*}:check" - } - } - ] - } - } - }, - "Session": { - "options": { - "(google.api.resource).type": "showcase.googleapis.com/Session", - "(google.api.resource).pattern": "sessions/{session}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "version": { - "type": "Version", - "id": 2 - } - }, - "nested": { - "Version": { - "values": { - "VERSION_UNSPECIFIED": 0, - "V1_LATEST": 1, - "V1_0": 2 - } - } - } - }, - "CreateSessionRequest": { - "fields": { - "session": { - "type": "Session", - "id": 1 - } - } - }, - "GetSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Session" - } - } - } - }, - "ListSessionsRequest": { - "fields": { - "pageSize": { - "type": "int32", - "id": 1 - }, - "pageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListSessionsResponse": { - "fields": { - "sessions": { - "rule": "repeated", - "type": "Session", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Session" - } - } - } - }, - "ReportSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Session" - } - } - } - }, - "ReportSessionResponse": { - "fields": { - "result": { - "type": "Result", - "id": 1 - }, - "testRuns": { - "rule": "repeated", - "type": "TestRun", - "id": 2 - } - }, - "nested": { - "Result": { - "values": { - "RESULT_UNSPECIFIED": 0, - "PASSED": 1, - "FAILED": 2, - "INCOMPLETE": 3 - } - } - } - }, - "Test": { - "options": { - "(google.api.resource).type": "showcase.googleapis.com/Test", - "(google.api.resource).pattern": "sessions/{session}/tests/{test}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "expectationLevel": { - "type": "ExpectationLevel", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "blueprints": { - "rule": "repeated", - "type": "Blueprint", - "id": 4 - } - }, - "nested": { - "ExpectationLevel": { - "values": { - "EXPECTATION_LEVEL_UNSPECIFIED": 0, - "REQUIRED": 1, - "RECOMMENDED": 2, - "OPTIONAL": 3 - } - }, - "Blueprint": { - "options": { - "(google.api.resource).type": "showcase.googleapis.com/Blueprint", - "(google.api.resource).pattern": "sessions/{session}/tests/{test}/blueprints/{blueprint}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - }, - "request": { - "type": "Invocation", - "id": 3 - }, - "additionalRequests": { - "rule": "repeated", - "type": "Invocation", - "id": 4 - } - }, - "nested": { - "Invocation": { - "fields": { - "method": { - "type": "string", - "id": 1 - }, - "serializedRequest": { - "type": "bytes", - "id": 2 - } - } - } - } - } - } - }, - "Issue": { - "fields": { - "type": { - "type": "Type", - "id": 1 - }, - "severity": { - "type": "Severity", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "SKIPPED": 1, - "PENDING": 2, - "INCORRECT_CONFIRMATION": 3 - } - }, - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "ERROR": 1, - "WARNING": 2 - } - } - } - }, - "ListTestsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Session" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListTestsResponse": { - "fields": { - "tests": { - "rule": "repeated", - "type": "Test", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "TestRun": { - "fields": { - "test": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Test" - } - }, - "issue": { - "type": "Issue", - "id": 2 - } - } - }, - "DeleteTestRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Test" - } - } - } - }, - "VerifyTestRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "showcase.googleapis.com/Test" - } - }, - "answer": { - "type": "bytes", - "id": 2 - }, - "answers": { - "rule": "repeated", - "type": "bytes", - "id": 3 - } - } - }, - "VerifyTestResponse": { - "fields": { - "issue": { - "type": "Issue", - "id": 1 - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions" - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "FileDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - } - } - }, - "DescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "FieldDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3 - } - } - } - }, - "OneofDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "phpGenericServices": { - "type": "bool", - "id": 42, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - } - } - }, - "OneofOptions": { - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - } - } - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/errdetails;errdetails", - "java_multiple_files": true, - "java_outer_classname": "ErrorDetailsProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - }, - "RetryInfo": { - "fields": { - "retryDelay": { - "type": "google.protobuf.Duration", - "id": 1 - } - } - }, - "DebugInfo": { - "fields": { - "stackEntries": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "detail": { - "type": "string", - "id": 2 - } - } - }, - "QuotaFailure": { - "fields": { - "violations": { - "rule": "repeated", - "type": "Violation", - "id": 1 - } - }, - "nested": { - "Violation": { - "fields": { - "subject": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - } - } - } - } - }, - "ErrorInfo": { - "fields": { - "reason": { - "type": "string", - "id": 1 - }, - "domain": { - "type": "string", - "id": 2 - }, - "metadata": { - "keyType": "string", - "type": "string", - "id": 3 - } - } - }, - "PreconditionFailure": { - "fields": { - "violations": { - "rule": "repeated", - "type": "Violation", - "id": 1 - } - }, - "nested": { - "Violation": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "subject": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - } - } - } - } - }, - "BadRequest": { - "fields": { - "fieldViolations": { - "rule": "repeated", - "type": "FieldViolation", - "id": 1 - } - }, - "nested": { - "FieldViolation": { - "fields": { - "field": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - } - } - } - } - }, - "RequestInfo": { - "fields": { - "requestId": { - "type": "string", - "id": 1 - }, - "servingData": { - "type": "string", - "id": 2 - } - } - }, - "ResourceInfo": { - "fields": { - "resourceType": { - "type": "string", - "id": 1 - }, - "resourceName": { - "type": "string", - "id": 2 - }, - "owner": { - "type": "string", - "id": 3 - }, - "description": { - "type": "string", - "id": 4 - } - } - }, - "Help": { - "fields": { - "links": { - "rule": "repeated", - "type": "Link", - "id": 1 - } - }, - "nested": { - "Link": { - "fields": { - "description": { - "type": "string", - "id": 1 - }, - "url": { - "type": "string", - "id": 2 - } - } - } - } - }, - "LocalizedMessage": { - "fields": { - "locale": { - "type": "string", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/tools/test/fixtures/google/example/library/v1/library.proto b/tools/test/fixtures/google/example/library/v1/library.proto deleted file mode 100644 index fea4359db..000000000 --- a/tools/test/fixtures/google/example/library/v1/library.proto +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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. - -syntax = "proto3"; - -package google.example.library.v1; - -import "google/api/annotations.proto"; -import "google/protobuf/empty.proto"; - -// This import is not in the canonical library api and is used to test if the -// protobuf loader works with protos that live alongside the main proto. -import "example/library/v1/test.proto"; - -option go_package = "google.golang.org/genproto/googleapis/example/library/v1;library"; -option java_multiple_files = true; -option java_outer_classname = "LibraryProto"; -option java_package = "com.google.example.library.v1"; - -// This API represents a simple digital library. It lets you manage Shelf -// resources and Book resources in the library. It defines the following -// resource model: -// -// - The API has a collection of [Shelf][google.example.library.v1.Shelf] -// resources, named `shelves/*` -// -// - Each Shelf has a collection of [Book][google.example.library.v1.Book] -// resources, named `shelves/*/books/*` -service LibraryService { - // Creates a shelf, and returns the new Shelf. - rpc CreateShelf(CreateShelfRequest) returns (Shelf) { - option (google.api.http) = { post: "/v1/shelves" body: "shelf" }; - } - - // Gets a shelf. Returns NOT_FOUND if the shelf does not exist. - rpc GetShelf(GetShelfRequest) returns (Shelf) { - option (google.api.http) = { get: "/v1/{name=shelves/*}" }; - } - - // Lists shelves. The order is unspecified but deterministic. Newly created - // shelves will not necessarily be added to the end of this list. - rpc ListShelves(ListShelvesRequest) returns (ListShelvesResponse) { - option (google.api.http) = { get: "/v1/shelves" }; - } - - // Deletes a shelf. Returns NOT_FOUND if the shelf does not exist. - rpc DeleteShelf(DeleteShelfRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v1/{name=shelves/*}" }; - } - - // Merges two shelves by adding all books from the shelf named - // `other_shelf_name` to shelf `name`, and deletes - // `other_shelf_name`. Returns the updated shelf. - // The book ids of the moved books may not be the same as the original books. - // - // Returns NOT_FOUND if either shelf does not exist. - // This call is a no-op if the specified shelves are the same. - rpc MergeShelves(MergeShelvesRequest) returns (Shelf) { - option (google.api.http) = { post: "/v1/{name=shelves/*}:merge" body: "*" }; - } - - // Creates a book, and returns the new Book. - rpc CreateBook(CreateBookRequest) returns (Book) { - option (google.api.http) = { post: "/v1/{name=shelves/*}/books" body: "book" }; - } - - // Gets a book. Returns NOT_FOUND if the book does not exist. - rpc GetBook(GetBookRequest) returns (Book) { - option (google.api.http) = { - get: "/v1/{name=shelves/*/books/*}" - additional_bindings: { - get: "/v1/{name=shelves/*/book_id/*}" - } - }; - } - - // Lists books in a shelf. The order is unspecified but deterministic. Newly - // created books will not necessarily be added to the end of this list. - // Returns NOT_FOUND if the shelf does not exist. - rpc ListBooks(ListBooksRequest) returns (ListBooksResponse) { - option (google.api.http) = { get: "/v1/{name=shelves/*}/books" }; - } - - // Deletes a book. Returns NOT_FOUND if the book does not exist. - rpc DeleteBook(DeleteBookRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { delete: "/v1/{name=shelves/*/books/*}" }; - } - - // Updates a book. Returns INVALID_ARGUMENT if the name of the book - // is non-empty and does equal the previous name. - rpc UpdateBook(UpdateBookRequest) returns (Book) { - option (google.api.http) = { put: "/v1/{name=shelves/*/books/*}" body: "book" }; - } - - // Moves a book to another shelf, and returns the new book. The book - // id of the new book may not be the same as the original book. - rpc MoveBook(MoveBookRequest) returns (Book) { - option (google.api.http) = { post: "/v1/{name=shelves/*/books/*}:move" body: "*" }; - } -} - -// A single book in the library. -message Book { - // The resource name of the book. - // Book names have the form `shelves/{shelf_id}/books/{book_id}`. - // The name is ignored when creating a book. - string name = 1; - - // The name of the book author. - string author = 2; - - // The title of the book. - string title = 3; - - // Value indicating whether the book has been read. - bool read = 4; - - // The id of the book. - int64 book_id = 5; -} - -// A Shelf contains a collection of books with a theme. -message Shelf { - // The resource name of the shelf. - // Shelf names have the form `shelves/{shelf_id}`. - // The name is ignored when creating a shelf. - string name = 1; - - // The theme of the shelf - string theme = 2; - - // The enum type of the shelf. - ShelfType type = 3; -} - -// Request message for LibraryService.CreateShelf. -message CreateShelfRequest { - // The shelf to create. - Shelf shelf = 1; - - // Some query string parameter - string query_string_parameter = 2; -} - -// Request message for LibraryService.GetShelf. -message GetShelfRequest { - // The name of the shelf to retrieve. - string name = 1; -} - -// Request message for LibraryService.ListShelves. -message ListShelvesRequest { - // Requested page size. Server may return fewer shelves than requested. - // If unspecified, server will pick an appropriate default. - int32 page_size = 1; - - // A token identifying a page of results the server should return. - // Typically, this is the value of - // [ListShelvesResponse.next_page_token][google.example.library.v1.ListShelvesResponse.next_page_token] - // returned from the previous call to `ListShelves` method. - string page_token = 2; -} - -// Response message for LibraryService.ListShelves. -message ListShelvesResponse { - // The list of shelves. - repeated Shelf shelves = 1; - - // A token to retrieve next page of results. - // Pass this value in the - // [ListShelvesRequest.page_token][google.example.library.v1.ListShelvesRequest.page_token] - // field in the subsequent call to `ListShelves` method to retrieve the next - // page of results. - string next_page_token = 2; -} - -// Request message for LibraryService.DeleteShelf. -message DeleteShelfRequest { - // The name of the shelf to delete. - string name = 1; -} - -// Describes the shelf being removed (other_shelf_name) and updated -// (name) in this merge. -message MergeShelvesRequest { - // The name of the shelf we're adding books to. - string name = 1; - - // The name of the shelf we're removing books from and deleting. - string other_shelf_name = 2; -} - -// Request message for LibraryService.CreateBook. -message CreateBookRequest { - // The name of the shelf in which the book is created. - string name = 1; - - // The book to create. - Book book = 2; -} - -// Request message for LibraryService.GetBook. -message GetBookRequest { - // The name of the book to retrieve. - string name = 1; - - // The the id of the book. - int64 book_id = 2; -} - -// Request message for LibraryService.ListBooks. -message ListBooksRequest { - // The name of the shelf whose books we'd like to list. - string name = 1; - - // Requested page size. Server may return fewer books than requested. - // If unspecified, server will pick an appropriate default. - int32 page_size = 2; - - // A token identifying a page of results the server should return. - // Typically, this is the value of - // [ListBooksResponse.next_page_token][google.example.library.v1.ListBooksResponse.next_page_token]. - // returned from the previous call to `ListBooks` method. - string page_token = 3; -} - -// Response message for LibraryService.ListBooks. -message ListBooksResponse { - // The list of books. - repeated Book books = 1; - - // A token to retrieve next page of results. - // Pass this value in the - // [ListBooksRequest.page_token][google.example.library.v1.ListBooksRequest.page_token] - // field in the subsequent call to `ListBooks` method to retrieve the next - // page of results. - string next_page_token = 2; -} - -// Request message for LibraryService.UpdateBook. -message UpdateBookRequest { - // The name of the book to update. - string name = 1; - - // The book to update with. The name must match or be empty. - Book book = 2; -} - -// Request message for LibraryService.DeleteBook. -message DeleteBookRequest { - // The name of the book to delete. - string name = 1; -} - -// Describes what book to move (name) and what shelf we're moving it -// to (other_shelf_name). -message MoveBookRequest { - // The name of the book to move. - string name = 1; - - // The name of the destination shelf. - string other_shelf_name = 2; -} - -// Enum value for shelf type. -enum ShelfType { - TYPEONE = 1; - - TYPETWO = 2; -} diff --git a/tools/test/fixtures/google/example/library/v1/missing_include.proto b/tools/test/fixtures/google/example/library/v1/missing_include.proto deleted file mode 100644 index d796d4818..000000000 --- a/tools/test/fixtures/google/example/library/v1/missing_include.proto +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2017, Google Inc. -// -// 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. - -syntax = "proto3"; - -import "missing.proto"; - -package test; - -message TestMessage {} - diff --git a/tools/test/fixtures/google/example/library/v1/test.proto b/tools/test/fixtures/google/example/library/v1/test.proto deleted file mode 100644 index 1420aceb8..000000000 --- a/tools/test/fixtures/google/example/library/v1/test.proto +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2017, Google Inc. -// -// 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. - -syntax = "proto3"; - -package test; - -message TestMessage {} - diff --git a/tools/tsconfig.json b/tools/tsconfig.json deleted file mode 100644 index f02fdfdf2..000000000 --- a/tools/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "lib": ["es2018", "dom"], - "rootDir": ".", - "outDir": "build", - "noImplicitAny": true, - "resolveJsonModule": true, - }, - "include": ["src/*.ts","test/minify.ts", "test/compileProtos.ts"] -} diff --git a/tsconfig.json b/tsconfig.json index 0e984ded2..b3b06b224 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,5 +12,6 @@ "src/*/*.ts", "test/system-test/*.ts", "test/unit/*.ts", + "tools/*.ts" ] }