Skip to content

Commit

Permalink
chore: run the generator, fix synth script (#755)
Browse files Browse the repository at this point in the history
* chore: run th generator, fix synth script

* test: remove comment
  • Loading branch information
alexander-fenster committed Apr 10, 2020
1 parent a748a48 commit c768b81
Show file tree
Hide file tree
Showing 21 changed files with 147 additions and 121 deletions.
2 changes: 1 addition & 1 deletion packages/google-cloud-vision/.jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2019 Google, LLC.',
copyright: 'Copyright 2020 Google LLC',
includeDate: false,
sourceFiles: false,
systemName: '@google-cloud/vision',
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-vision/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// 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,
Expand Down
3 changes: 1 addition & 2 deletions packages/google-cloud-vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scripts": {
"test": "c8 mocha build/test",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"lint": "gts fix && eslint --fix samples/*.js",
"lint": "gts fix",
"docs": "jsdoc -c .jsdoc.js",
"system-test": "mocha build/system-test",
"fix": "gts fix",
Expand All @@ -52,7 +52,6 @@
"@types/is": "0.0.21",
"@types/mocha": "^7.0.1",
"@types/node": "^13.7.4",
"@types/is": "0.0.21",
"@types/sinon": "^9.0.0",
"@types/uuid": "^3.4.7",
"c8": "^7.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ message ImageContext {
// setting a hint will help get better results (although it will be a
// significant hindrance if the hint is wrong). Text detection returns an
// error if one or more of the specified languages is not one of the
// [supported languages](/vision/docs/languages).
// [supported languages](https://cloud.google.com/vision/docs/languages).
repeated string language_hints = 2;

// Parameters for crop hints annotation request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ message ImageContext {
// setting a hint will help get better results (although it will be a
// significant hindrance if the hint is wrong). Text detection returns an
// error if one or more of the specified languages is not one of the
// [supported languages](/vision/docs/languages).
// [supported languages](https://cloud.google.com/vision/docs/languages).
repeated string language_hints = 2;

// Parameters for crop hints annotation request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ message ImageContext {
// setting a hint will help get better results (although it will be a
// significant hindrance if the hint is wrong). Text detection returns an
// error if one or more of the specified languages is not one of the
// [supported languages](/vision/docs/languages).
// [supported languages](https://cloud.google.com/vision/docs/languages).
repeated string language_hints = 2;

// Parameters for crop hints annotation request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ message ImageContext {
// setting a hint will help get better results (although it will be a
// significant hindrance if the hint is wrong). Text detection returns an
// error if one or more of the specified languages is not one of the
// [supported languages](/vision/docs/languages).
// [supported languages](https://cloud.google.com/vision/docs/languages).
repeated string language_hints = 2;

// Parameters for crop hints annotation request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ message ImageContext {
// setting a hint will help get better results (although it will be a
// significant hindrance if the hint is wrong). Text detection returns an
// error if one or more of the specified languages is not one of the
// [supported languages](/vision/docs/languages).
// [supported languages](https://cloud.google.com/vision/docs/languages).
repeated string language_hints = 2;

// Parameters for crop hints annotation request.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-vision/protos/protos.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
var $root = $protobuf.roots._google_cloud_vision_1_11_0_protos || ($protobuf.roots._google_cloud_vision_1_11_0_protos = {});

$root.google = (function() {

Expand Down
16 changes: 12 additions & 4 deletions packages/google-cloud-vision/protos/protos.json
Original file line number Diff line number Diff line change
Expand Up @@ -9017,34 +9017,41 @@
"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.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.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.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.http).body": "*",
"(google.api.method_signature)": "name"
}
},
"WaitOperation": {
Expand Down Expand Up @@ -9170,6 +9177,7 @@
},
"rpc": {
"options": {
"cc_enable_arenas": true,
"go_package": "google.golang.org/genproto/googleapis/rpc/status;status",
"java_multiple_files": true,
"java_outer_classname": "StatusProto",
Expand Down
19 changes: 18 additions & 1 deletion packages/google-cloud-vision/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{
"updateTime": "2020-03-31T20:16:47.942825Z",
"updateTime": "2020-04-10T20:00:59.209374Z",
"sources": [
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "cf18ab5200e41e9d0cfef88c6c4bcdd394faf1ca",
"internalRef": "305925954"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5"
}
}
],
"destinations": [
{
"client": {
Expand Down
4 changes: 3 additions & 1 deletion packages/google-cloud-vision/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
for version in versions:
client_file = f"src/{version}/image_annotator_client.ts"
s.replace(client_file, '\Z',
'import {FeaturesMethod} from \'../helpers\'; \n export interface ImageAnnotatorClient extends FeaturesMethod {}'
'import {FeaturesMethod} from \'../helpers\';\n' +
'// eslint-disable-next-line @typescript-eslint/no-empty-interface\n' +
'export interface ImageAnnotatorClient extends FeaturesMethod {}\n'
)
# Copy common templates
common_templates = gcp.CommonTemplates()
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-vision/system-test/vision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {Storage} from '@google-cloud/storage';
import * as uuid from 'uuid';
import * as prototypes from '../protos/protos';
import * as vision from '../src';
// const vision = require('../src');

describe('Vision', () => {
const IMAGES = Object.freeze({
document: path.join(
Expand Down
12 changes: 6 additions & 6 deletions packages/google-cloud-vision/test/gapic_image_annotator_v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ describe('v1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.batchAnnotateImages(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -386,7 +386,7 @@ describe('v1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.batchAnnotateFiles(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -510,7 +510,7 @@ describe('v1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.asyncBatchAnnotateImages(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -545,7 +545,7 @@ describe('v1.ImageAnnotatorClient', () => {
expectedError
);
const [operation] = await client.asyncBatchAnnotateImages(request);
assert.rejects(async () => {
await assert.rejects(async () => {
await operation.promise();
}, expectedError);
assert(
Expand Down Expand Up @@ -669,7 +669,7 @@ describe('v1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.asyncBatchAnnotateFiles(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -704,7 +704,7 @@ describe('v1.ImageAnnotatorClient', () => {
expectedError
);
const [operation] = await client.asyncBatchAnnotateFiles(request);
assert.rejects(async () => {
await assert.rejects(async () => {
await operation.promise();
}, expectedError);
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('v1p1beta1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.batchAnnotateImages(request);
}, expectedError);
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe('v1p2beta1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.batchAnnotateImages(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('v1p2beta1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.asyncBatchAnnotateFiles(request);
}, expectedError);
assert(
Expand All @@ -373,7 +373,7 @@ describe('v1p2beta1.ImageAnnotatorClient', () => {
expectedError
);
const [operation] = await client.asyncBatchAnnotateFiles(request);
assert.rejects(async () => {
await assert.rejects(async () => {
await operation.promise();
}, expectedError);
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe('v1p3beta1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.batchAnnotateImages(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('v1p3beta1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.asyncBatchAnnotateFiles(request);
}, expectedError);
assert(
Expand All @@ -373,7 +373,7 @@ describe('v1p3beta1.ImageAnnotatorClient', () => {
expectedError
);
const [operation] = await client.asyncBatchAnnotateFiles(request);
assert.rejects(async () => {
await assert.rejects(async () => {
await operation.promise();
}, expectedError);
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe('v1p4beta1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.batchAnnotateImages(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -338,7 +338,7 @@ describe('v1p4beta1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.batchAnnotateFiles(request);
}, expectedError);
assert(
Expand Down Expand Up @@ -438,7 +438,7 @@ describe('v1p4beta1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.asyncBatchAnnotateImages(request);
}, expectedError);
assert(
Expand All @@ -465,7 +465,7 @@ describe('v1p4beta1.ImageAnnotatorClient', () => {
expectedError
);
const [operation] = await client.asyncBatchAnnotateImages(request);
assert.rejects(async () => {
await assert.rejects(async () => {
await operation.promise();
}, expectedError);
assert(
Expand Down Expand Up @@ -565,7 +565,7 @@ describe('v1p4beta1.ImageAnnotatorClient', () => {
undefined,
expectedError
);
assert.rejects(async () => {
await assert.rejects(async () => {
await client.asyncBatchAnnotateFiles(request);
}, expectedError);
assert(
Expand All @@ -592,7 +592,7 @@ describe('v1p4beta1.ImageAnnotatorClient', () => {
expectedError
);
const [operation] = await client.asyncBatchAnnotateFiles(request);
assert.rejects(async () => {
await assert.rejects(async () => {
await operation.promise();
}, expectedError);
assert(
Expand Down

0 comments on commit c768b81

Please sign in to comment.