Skip to content

Commit

Permalink
update dependency (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhenliu-gg5 committed Mar 24, 2020
1 parent 68def37 commit eefa5f2
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 96 deletions.
3 changes: 3 additions & 0 deletions packages/google-cloud-asset/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./node_modules/gts"
}
15 changes: 0 additions & 15 deletions packages/google-cloud-asset/.eslintrc.yml

This file was deleted.

8 changes: 0 additions & 8 deletions packages/google-cloud-asset/.prettierrc

This file was deleted.

17 changes: 17 additions & 0 deletions packages/google-cloud-asset/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2020 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
//
// 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')
}
39 changes: 17 additions & 22 deletions packages/google-cloud-asset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"author": "Google LLC",
"engines": {
"node": ">=8.10.0"
"node": ">=10.0.0"
},
"repository": "googleapis/nodejs-asset",
"main": "build/src/index.js",
Expand Down Expand Up @@ -43,30 +43,25 @@
"prelint": "cd samples; npm link ../; npm i"
},
"dependencies": {
"google-gax": "^1.14.1",
"protobufjs": "^6.8.0"
"google-gax": "^1.15.1",
"protobufjs": "^6.8.9"
},
"devDependencies": {
"@types/mocha": "^7.0.0",
"@types/node": "^12.0.0",
"c8": "^7.0.1",
"codecov": "^3.0.4",
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.0.0",
"gts": "^1.0.0",
"jsdoc": "^3.6.2",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"linkinator": "^2.0.0",
"mocha": "^7.0.0",
"@types/mocha": "^7.0.2",
"@types/node": "^13.9.3",
"c8": "^7.1.0",
"codecov": "^3.6.5",
"gts": "^2.0.0-alpha.5",
"jsdoc": "^3.6.3",
"jsdoc-fresh": "^1.0.2",
"jsdoc-region-tag": "^1.0.4",
"linkinator": "^2.0.4",
"mocha": "^7.1.1",
"null-loader": "^3.0.0",
"pack-n-play": "^1.0.0-2",
"prettier": "^1.13.7",
"ts-loader": "^6.2.1",
"typescript": "~3.6.4",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
"ts-loader": "^6.2.2",
"typescript": "~3.8.3",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11"
}
}
5 changes: 4 additions & 1 deletion packages/google-cloud-asset/src/v1/asset_service_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export class AssetServiceClient {
// rather than holding a request open.
const protoFilesRoot = opts.fallback
? this._gaxModule.protobuf.Root.fromJSON(
/* eslint-disable @typescript-eslint/no-var-requires */
require('../../protos/protos.json')
)
: this._gaxModule.protobuf.loadSync(nodejsProtoPath);
Expand Down Expand Up @@ -227,6 +228,7 @@ export class AssetServiceClient {
'google.cloud.asset.v1.AssetService'
)
: // tslint:disable-next-line no-any
/* eslint-disable @typescript-eslint/no-explicit-any */
(this._protos as any).google.cloud.asset.v1.AssetService,
this._opts
) as Promise<{[method: string]: Function}>;
Expand All @@ -249,7 +251,8 @@ export class AssetServiceClient {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
return stub[methodName].apply(stub, args);
const func = stub[methodName];
return func.apply(stub, args);
},
(err: Error | null | undefined) => () => {
throw err;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class AssetServiceClient {
// rather than holding a request open.
const protoFilesRoot = opts.fallback
? this._gaxModule.protobuf.Root.fromJSON(
/* eslint-disable @typescript-eslint/no-var-requires */
require('../../protos/protos.json')
)
: this._gaxModule.protobuf.loadSync(nodejsProtoPath);
Expand Down Expand Up @@ -211,6 +212,7 @@ export class AssetServiceClient {
'google.cloud.asset.v1beta1.AssetService'
)
: // tslint:disable-next-line no-any
/* eslint-disable @typescript-eslint/no-explicit-any */
(this._protos as any).google.cloud.asset.v1beta1.AssetService,
this._opts
) as Promise<{[method: string]: Function}>;
Expand All @@ -225,7 +227,8 @@ export class AssetServiceClient {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
return stub[methodName].apply(stub, args);
const func = stub[methodName];
return func.apply(stub, args);
},
(err: Error | null | undefined) => () => {
throw err;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import {
CallOptions,
Descriptors,
ClientOptions,
PaginationCallback,
PaginationResponse,
} from 'google-gax';
import * as path from 'path';

Expand Down Expand Up @@ -198,6 +196,7 @@ export class AssetServiceClient {
'google.cloud.asset.v1p1beta1.AssetService'
)
: // tslint:disable-next-line no-any
/* eslint-disable @typescript-eslint/no-explicit-any */
(this._protos as any).google.cloud.asset.v1p1beta1.AssetService,
this._opts
) as Promise<{[method: string]: Function}>;
Expand All @@ -215,7 +214,8 @@ export class AssetServiceClient {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
return stub[methodName].apply(stub, args);
const func = stub[methodName];
return func.apply(stub, args);
},
(err: Error | null | undefined) => () => {
throw err;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export class AssetServiceClient {
'google.cloud.asset.v1p2beta1.AssetService'
)
: // tslint:disable-next-line no-any
/* eslint-disable @typescript-eslint/no-explicit-any */
(this._protos as any).google.cloud.asset.v1p2beta1.AssetService,
this._opts
) as Promise<{[method: string]: Function}>;
Expand All @@ -215,7 +216,8 @@ export class AssetServiceClient {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
return stub[methodName].apply(stub, args);
const func = stub[methodName];
return func.apply(stub, args);
},
(err: Error | null | undefined) => () => {
throw err;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class AssetServiceClient {
// rather than holding a request open.
const protoFilesRoot = opts.fallback
? this._gaxModule.protobuf.Root.fromJSON(
/* eslint-disable @typescript-eslint/no-var-requires */
require('../../protos/protos.json')
)
: this._gaxModule.protobuf.loadSync(nodejsProtoPath);
Expand Down Expand Up @@ -215,6 +216,7 @@ export class AssetServiceClient {
'google.cloud.asset.v1p4beta1.AssetService'
)
: // tslint:disable-next-line no-any
/* eslint-disable @typescript-eslint/no-explicit-any */
(this._protos as any).google.cloud.asset.v1p4beta1.AssetService,
this._opts
) as Promise<{[method: string]: Function}>;
Expand All @@ -232,7 +234,8 @@ export class AssetServiceClient {
if (this._terminated) {
return Promise.reject('The client has already been closed.');
}
return stub[methodName].apply(stub, args);
const func = stub[methodName];
return func.apply(stub, args);
},
(err: Error | null | undefined) => () => {
throw err;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **


/* eslint-disable node/no-missing-require, no-unused-vars */
const asset = require('@google-cloud/asset');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {AssetServiceClient} from '@google-cloud/asset';

function main() {
const assetServiceClient = new AssetServiceClient();
new AssetServiceClient();
}

main();
4 changes: 2 additions & 2 deletions packages/google-cloud-asset/system-test/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {readFileSync} from 'fs';
import {describe, it} from 'mocha';

describe('typescript consumer tests', () => {
it('should have correct type signature for typescript users', async function() {
it('should have correct type signature for typescript users', async function () {
this.timeout(300000);
const options = {
packageDir: process.cwd(), // path to your module.
Expand All @@ -35,7 +35,7 @@ describe('typescript consumer tests', () => {
await packNTest(options); // will throw upon error.
});

it('should have correct type signature for javascript users', async function() {
it('should have correct type signature for javascript users', async function () {
this.timeout(300000);
const options = {
packageDir: process.cwd(), // path to your module.
Expand Down
17 changes: 3 additions & 14 deletions packages/google-cloud-asset/test/gapic-asset_service-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import * as protosTypes from '../protos/protos';
import * as assert from 'assert';
import {describe, it} from 'mocha';
/* eslint-disable @typescript-eslint/no-var-requires */
const assetserviceModule = require('../src');

const FAKE_STATUS_CODE = 1;
Expand All @@ -38,7 +39,9 @@ export interface Callback {
}

export class Operation {
/* eslint-disable @typescript-eslint/no-empty-function */
constructor() {}
/* eslint-disable @typescript-eslint/no-empty-function */
promise() {}
}
function mockSimpleGrpcMethod(
Expand Down Expand Up @@ -154,8 +157,6 @@ describe('v1.AssetServiceClient', () => {
// Mock request
const request: protosTypes.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest = {};
request.parent = '';
// Mock response
const expectedResponse = {};
// Mock gRPC layer
client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod(
request,
Expand Down Expand Up @@ -206,8 +207,6 @@ describe('v1.AssetServiceClient', () => {
// Mock request
const request: protosTypes.google.cloud.asset.v1.ICreateFeedRequest = {};
request.parent = '';
// Mock response
const expectedResponse = {};
// Mock gRPC layer
client._innerApiCalls.createFeed = mockSimpleGrpcMethod(
request,
Expand Down Expand Up @@ -258,8 +257,6 @@ describe('v1.AssetServiceClient', () => {
// Mock request
const request: protosTypes.google.cloud.asset.v1.IGetFeedRequest = {};
request.name = '';
// Mock response
const expectedResponse = {};
// Mock gRPC layer
client._innerApiCalls.getFeed = mockSimpleGrpcMethod(
request,
Expand Down Expand Up @@ -310,8 +307,6 @@ describe('v1.AssetServiceClient', () => {
// Mock request
const request: protosTypes.google.cloud.asset.v1.IListFeedsRequest = {};
request.parent = '';
// Mock response
const expectedResponse = {};
// Mock gRPC layer
client._innerApiCalls.listFeeds = mockSimpleGrpcMethod(
request,
Expand Down Expand Up @@ -364,8 +359,6 @@ describe('v1.AssetServiceClient', () => {
const request: protosTypes.google.cloud.asset.v1.IUpdateFeedRequest = {};
request.feed = {};
request.feed.name = '';
// Mock response
const expectedResponse = {};
// Mock gRPC layer
client._innerApiCalls.updateFeed = mockSimpleGrpcMethod(
request,
Expand Down Expand Up @@ -416,8 +409,6 @@ describe('v1.AssetServiceClient', () => {
// Mock request
const request: protosTypes.google.cloud.asset.v1.IDeleteFeedRequest = {};
request.name = '';
// Mock response
const expectedResponse = {};
// Mock gRPC layer
client._innerApiCalls.deleteFeed = mockSimpleGrpcMethod(
request,
Expand Down Expand Up @@ -475,8 +466,6 @@ describe('v1.AssetServiceClient', () => {
// Mock request
const request: protosTypes.google.cloud.asset.v1.IExportAssetsRequest = {};
request.parent = '';
// Mock response
const expectedResponse = {};
// Mock gRPC layer
client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod(
request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import * as protosTypes from '../protos/protos';
import * as assert from 'assert';
import {describe, it} from 'mocha';
/* eslint-disable @typescript-eslint/no-var-requires */
const assetserviceModule = require('../src');

const FAKE_STATUS_CODE = 1;
Expand All @@ -38,7 +39,9 @@ export interface Callback {
}

export class Operation {
/* eslint-disable @typescript-eslint/no-empty-function */
constructor() {}
/* eslint-disable @typescript-eslint/no-empty-function */
promise() {}
}
function mockSimpleGrpcMethod(
Expand Down Expand Up @@ -156,8 +159,6 @@ describe('v1beta1.AssetServiceClient', () => {
// Mock request
const request: protosTypes.google.cloud.asset.v1beta1.IBatchGetAssetsHistoryRequest = {};
request.parent = '';
// Mock response
const expectedResponse = {};
// Mock gRPC layer
client._innerApiCalls.batchGetAssetsHistory = mockSimpleGrpcMethod(
request,
Expand Down Expand Up @@ -215,8 +216,6 @@ describe('v1beta1.AssetServiceClient', () => {
// Mock request
const request: protosTypes.google.cloud.asset.v1beta1.IExportAssetsRequest = {};
request.parent = '';
// Mock response
const expectedResponse = {};
// Mock gRPC layer
client._innerApiCalls.exportAssets = mockLongRunningGrpcMethod(
request,
Expand Down
Loading

0 comments on commit eefa5f2

Please sign in to comment.