@@ -28,6 +28,7 @@ import {
28
28
import * as path from 'path' ;
29
29
30
30
import * as protos from '../../protos/protos' ;
31
+ import jsonProtos = require( '../../protos/protos.json' ) ;
31
32
/**
32
33
* Client JSON configuration object, loaded from
33
34
* `src/v1p1beta1/video_intelligence_service_client_config.json`.
@@ -143,32 +144,13 @@ export class VideoIntelligenceServiceClient {
143
144
clientHeader . push ( `${ opts . libName } /${ opts . libVersion } ` ) ;
144
145
}
145
146
// Load the applicable protos.
146
- // For Node.js, pass the path to JSON proto file.
147
- // For browsers, pass the JSON content.
147
+ this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ;
148
148
149
- const nodejsProtoPath = path . join (
150
- __dirname ,
151
- '..' ,
152
- '..' ,
153
- 'protos' ,
154
- 'protos.json'
155
- ) ;
156
- this . _protos = this . _gaxGrpc . loadProto (
157
- opts . fallback
158
- ? // eslint-disable-next-line @typescript-eslint/no-var-requires
159
- require ( '../../protos/protos.json' )
160
- : nodejsProtoPath
161
- ) ;
149
+ const protoFilesRoot = this . _gaxModule . protobuf . Root . fromJSON ( jsonProtos ) ;
162
150
163
151
// This API contains "long-running operations", which return a
164
152
// an Operation object that allows for tracking of the operation,
165
153
// rather than holding a request open.
166
- const protoFilesRoot = opts . fallback
167
- ? this . _gaxModule . protobuf . Root . fromJSON (
168
- // eslint-disable-next-line @typescript-eslint/no-var-requires
169
- require ( '../../protos/protos.json' )
170
- )
171
- : this . _gaxModule . protobuf . loadSync ( nodejsProtoPath ) ;
172
154
173
155
this . operationsClient = this . _gaxModule
174
156
. lro ( {
0 commit comments