File tree 3 files changed +6
-48
lines changed
packages/google-devtools-containeranalysis/src
3 files changed +6
-48
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import * as path from 'path';
23
23
import { GrafeasClient } from '@google-cloud/grafeas' ;
24
24
25
25
import * as protos from '../../protos/protos' ;
26
+ import jsonProtos = require( '../../protos/protos.json' ) ;
26
27
/**
27
28
* Client JSON configuration object, loaded from
28
29
* `src/v1/container_analysis_client_config.json`.
@@ -149,22 +150,7 @@ export class ContainerAnalysisClient {
149
150
clientHeader . push ( `${ opts . libName } /${ opts . libVersion } ` ) ;
150
151
}
151
152
// Load the applicable protos.
152
- // For Node.js, pass the path to JSON proto file.
153
- // For browsers, pass the JSON content.
154
-
155
- const nodejsProtoPath = path . join (
156
- __dirname ,
157
- '..' ,
158
- '..' ,
159
- 'protos' ,
160
- 'protos.json'
161
- ) ;
162
- this . _protos = this . _gaxGrpc . loadProto (
163
- opts . fallback
164
- ? // eslint-disable-next-line @typescript-eslint/no-var-requires
165
- require ( '../../protos/protos.json' )
166
- : nodejsProtoPath
167
- ) ;
153
+ this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ;
168
154
169
155
// This API contains "path templates"; forward-slash-separated
170
156
// identifiers to uniquely identify resources within the API.
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import * as path from 'path';
31
31
import { Transform } from 'stream' ;
32
32
import { RequestType } from 'google-gax/build/src/apitypes' ;
33
33
import * as protos from '../../protos/protos' ;
34
+ import jsonProtos = require( '../../protos/protos.json' ) ;
34
35
/**
35
36
* Client JSON configuration object, loaded from
36
37
* `src/v1beta1/container_analysis_v1_beta1_client_config.json`.
@@ -158,22 +159,7 @@ export class ContainerAnalysisV1Beta1Client {
158
159
clientHeader . push ( `${ opts . libName } /${ opts . libVersion } ` ) ;
159
160
}
160
161
// Load the applicable protos.
161
- // For Node.js, pass the path to JSON proto file.
162
- // For browsers, pass the JSON content.
163
-
164
- const nodejsProtoPath = path . join (
165
- __dirname ,
166
- '..' ,
167
- '..' ,
168
- 'protos' ,
169
- 'protos.json'
170
- ) ;
171
- this . _protos = this . _gaxGrpc . loadProto (
172
- opts . fallback
173
- ? // eslint-disable-next-line @typescript-eslint/no-var-requires
174
- require ( '../../protos/protos.json' )
175
- : nodejsProtoPath
176
- ) ;
162
+ this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ;
177
163
178
164
// This API contains "path templates"; forward-slash-separated
179
165
// identifiers to uniquely identify resources within the API.
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import * as path from 'path';
31
31
import { Transform } from 'stream' ;
32
32
import { RequestType } from 'google-gax/build/src/apitypes' ;
33
33
import * as protos from '../../protos/protos' ;
34
+ import jsonProtos = require( '../../protos/protos.json' ) ;
34
35
/**
35
36
* Client JSON configuration object, loaded from
36
37
* `src/v1beta1/grafeas_v1_beta1_client_config.json`.
@@ -158,22 +159,7 @@ export class GrafeasV1Beta1Client {
158
159
clientHeader . push ( `${ opts . libName } /${ opts . libVersion } ` ) ;
159
160
}
160
161
// Load the applicable protos.
161
- // For Node.js, pass the path to JSON proto file.
162
- // For browsers, pass the JSON content.
163
-
164
- const nodejsProtoPath = path . join (
165
- __dirname ,
166
- '..' ,
167
- '..' ,
168
- 'protos' ,
169
- 'protos.json'
170
- ) ;
171
- this . _protos = this . _gaxGrpc . loadProto (
172
- opts . fallback
173
- ? // eslint-disable-next-line @typescript-eslint/no-var-requires
174
- require ( '../../protos/protos.json' )
175
- : nodejsProtoPath
176
- ) ;
162
+ this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ;
177
163
178
164
// This API contains "path templates"; forward-slash-separated
179
165
// identifiers to uniquely identify resources within the API.
You can’t perform that action at this time.
0 commit comments