File tree 2 files changed +4
-32
lines changed
2 files changed +4
-32
lines changed 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/v1/recaptcha_enterprise_service_client_config.json`.
@@ -146,22 +147,7 @@ export class RecaptchaEnterpriseServiceClient {
146
147
clientHeader . push ( `${ opts . libName } /${ opts . libVersion } ` ) ;
147
148
}
148
149
// Load the applicable protos.
149
- // For Node.js, pass the path to JSON proto file.
150
- // For browsers, pass the JSON content.
151
-
152
- const nodejsProtoPath = path . join (
153
- __dirname ,
154
- '..' ,
155
- '..' ,
156
- 'protos' ,
157
- 'protos.json'
158
- ) ;
159
- this . _protos = this . _gaxGrpc . loadProto (
160
- opts . fallback
161
- ? // eslint-disable-next-line @typescript-eslint/no-var-requires
162
- require ( '../../protos/protos.json' )
163
- : nodejsProtoPath
164
- ) ;
150
+ this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ;
165
151
166
152
// This API contains "path templates"; forward-slash-separated
167
153
// 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/recaptcha_enterprise_service_v1_beta1_client_config.json`.
@@ -146,22 +147,7 @@ export class RecaptchaEnterpriseServiceV1Beta1Client {
146
147
clientHeader . push ( `${ opts . libName } /${ opts . libVersion } ` ) ;
147
148
}
148
149
// Load the applicable protos.
149
- // For Node.js, pass the path to JSON proto file.
150
- // For browsers, pass the JSON content.
151
-
152
- const nodejsProtoPath = path . join (
153
- __dirname ,
154
- '..' ,
155
- '..' ,
156
- 'protos' ,
157
- 'protos.json'
158
- ) ;
159
- this . _protos = this . _gaxGrpc . loadProto (
160
- opts . fallback
161
- ? // eslint-disable-next-line @typescript-eslint/no-var-requires
162
- require ( '../../protos/protos.json' )
163
- : nodejsProtoPath
164
- ) ;
150
+ this . _protos = this . _gaxGrpc . loadProtoJSON ( jsonProtos ) ;
165
151
166
152
// This API contains "path templates"; forward-slash-separated
167
153
// identifiers to uniquely identify resources within the API.
You can’t perform that action at this time.
0 commit comments