@google-cloud/bigquery-storage
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -1,3 +0,3 @@ | ||
import * as gax from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax'; | ||
import type * as gax from 'google-gax'; | ||
import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax'; | ||
import * as protos from '../../protos/protos'; | ||
@@ -63,4 +63,11 @@ /** | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new BigQueryReadClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts?: ClientOptions); | ||
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); | ||
/** | ||
@@ -67,0 +74,0 @@ * Initialize the client. |
@@ -21,5 +21,2 @@ "use strict"; | ||
exports.BigQueryReadClient = void 0; | ||
/* global window */ | ||
const gax = require("google-gax"); | ||
const google_gax_1 = require("google-gax"); | ||
const stream_1 = require("stream"); | ||
@@ -74,4 +71,11 @@ const jsonProtos = require("../../protos/protos.json"); | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new BigQueryReadClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts) { | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
@@ -97,4 +101,8 @@ this._terminated = false; | ||
} | ||
// Load google-gax module synchronously if needed | ||
if (!gaxInstance) { | ||
gaxInstance = require('google-gax'); | ||
} | ||
// Choose either gRPC or proto-over-HTTP implementation of google-gax. | ||
this._gaxModule = opts.fallback ? gax.fallback : gax; | ||
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; | ||
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client. | ||
@@ -146,3 +154,3 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts); | ||
this.descriptors.stream = { | ||
readRows: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING, opts.fallback === 'rest'), | ||
readRows: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest'), | ||
}; | ||
@@ -156,3 +164,3 @@ // Put together the default options sent with requests. | ||
// Add a warn function to the client constructor so it can be easily tested. | ||
this.warn = gax.warn; | ||
this.warn = this._gaxModule.warn; | ||
} | ||
@@ -194,3 +202,3 @@ /** | ||
setImmediate(() => { | ||
stream.emit('error', new google_gax_1.GoogleError('The client has already been closed.')); | ||
stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); | ||
}); | ||
@@ -270,3 +278,3 @@ return stream; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
'read_session.table': request.readSession.table || '', | ||
@@ -291,3 +299,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
name: request.name || '', | ||
@@ -331,3 +339,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
read_stream: request.readStream || '', | ||
@@ -334,0 +342,0 @@ }); |
@@ -1,3 +0,3 @@ | ||
import * as gax from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax'; | ||
import type * as gax from 'google-gax'; | ||
import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax'; | ||
import * as protos from '../../protos/protos'; | ||
@@ -66,4 +66,11 @@ /** | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new BigQueryWriteClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts?: ClientOptions); | ||
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); | ||
/** | ||
@@ -70,0 +77,0 @@ * Initialize the client. |
@@ -21,5 +21,2 @@ "use strict"; | ||
exports.BigQueryWriteClient = void 0; | ||
/* global window */ | ||
const gax = require("google-gax"); | ||
const google_gax_1 = require("google-gax"); | ||
const stream_1 = require("stream"); | ||
@@ -77,4 +74,11 @@ const jsonProtos = require("../../protos/protos.json"); | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new BigQueryWriteClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts) { | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
@@ -100,4 +104,8 @@ this._terminated = false; | ||
} | ||
// Load google-gax module synchronously if needed | ||
if (!gaxInstance) { | ||
gaxInstance = require('google-gax'); | ||
} | ||
// Choose either gRPC or proto-over-HTTP implementation of google-gax. | ||
this._gaxModule = opts.fallback ? gax.fallback : gax; | ||
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; | ||
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client. | ||
@@ -149,3 +157,3 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts); | ||
this.descriptors.stream = { | ||
appendRows: new this._gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING, opts.fallback === 'rest'), | ||
appendRows: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, opts.fallback === 'rest'), | ||
}; | ||
@@ -159,3 +167,3 @@ // Put together the default options sent with requests. | ||
// Add a warn function to the client constructor so it can be easily tested. | ||
this.warn = gax.warn; | ||
this.warn = this._gaxModule.warn; | ||
} | ||
@@ -200,3 +208,3 @@ /** | ||
setImmediate(() => { | ||
stream.emit('error', new google_gax_1.GoogleError('The client has already been closed.')); | ||
stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); | ||
}); | ||
@@ -277,3 +285,3 @@ return stream; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
@@ -298,3 +306,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
name: request.name || '', | ||
@@ -319,3 +327,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
name: request.name || '', | ||
@@ -340,3 +348,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
parent: request.parent || '', | ||
@@ -361,3 +369,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
write_stream: request.writeStream || '', | ||
@@ -364,0 +372,0 @@ }); |
@@ -1,3 +0,3 @@ | ||
import * as gax from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax'; | ||
import type * as gax from 'google-gax'; | ||
import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax'; | ||
import * as protos from '../../protos/protos'; | ||
@@ -63,4 +63,11 @@ /** | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new BigQueryStorageClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts?: ClientOptions); | ||
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); | ||
/** | ||
@@ -67,0 +74,0 @@ * Initialize the client. |
@@ -21,5 +21,2 @@ "use strict"; | ||
exports.BigQueryStorageClient = void 0; | ||
/* global window */ | ||
const gax = require("google-gax"); | ||
const google_gax_1 = require("google-gax"); | ||
const stream_1 = require("stream"); | ||
@@ -74,4 +71,11 @@ const jsonProtos = require("../../protos/protos.json"); | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you | ||
* need to avoid loading the default gRPC version and want to use the fallback | ||
* HTTP implementation. Load only fallback version and pass it to the constructor: | ||
* ``` | ||
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC | ||
* const client = new BigQueryStorageClient({fallback: 'rest'}, gax); | ||
* ``` | ||
*/ | ||
constructor(opts) { | ||
constructor(opts, gaxInstance) { | ||
var _a, _b; | ||
@@ -97,4 +101,8 @@ this._terminated = false; | ||
} | ||
// Load google-gax module synchronously if needed | ||
if (!gaxInstance) { | ||
gaxInstance = require('google-gax'); | ||
} | ||
// Choose either gRPC or proto-over-HTTP implementation of google-gax. | ||
this._gaxModule = opts.fallback ? gax.fallback : gax; | ||
this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; | ||
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client. | ||
@@ -144,3 +152,3 @@ this._gaxGrpc = new this._gaxModule.GrpcClient(opts); | ||
this.descriptors.stream = { | ||
readRows: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING, opts.fallback === 'rest'), | ||
readRows: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest'), | ||
}; | ||
@@ -154,3 +162,3 @@ // Put together the default options sent with requests. | ||
// Add a warn function to the client constructor so it can be easily tested. | ||
this.warn = gax.warn; | ||
this.warn = this._gaxModule.warn; | ||
} | ||
@@ -195,3 +203,3 @@ /** | ||
setImmediate(() => { | ||
stream.emit('error', new google_gax_1.GoogleError('The client has already been closed.')); | ||
stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); | ||
}); | ||
@@ -271,3 +279,3 @@ return stream; | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
'table_reference.project_id': request.tableReference.projectId || '', | ||
@@ -293,3 +301,3 @@ 'table_reference.dataset_id': request.tableReference.datasetId || '', | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
'session.name': request.session.name || '', | ||
@@ -314,3 +322,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
'stream.name': request.stream.name || '', | ||
@@ -335,3 +343,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
'original_stream.name': request.originalStream.name || '', | ||
@@ -375,3 +383,3 @@ }); | ||
options.otherArgs.headers['x-goog-request-params'] = | ||
gax.routingHeader.fromParams({ | ||
this._gaxModule.routingHeader.fromParams({ | ||
'read_position.stream.name': request.readPosition.stream.name || '', | ||
@@ -378,0 +386,0 @@ }); |
# Changelog | ||
## [3.1.1](https://github.com/googleapis/nodejs-bigquery-storage/compare/v3.1.0...v3.1.1) (2022-09-01) | ||
### Bug Fixes | ||
* Allow passing gax instance to client constructor ([#292](https://github.com/googleapis/nodejs-bigquery-storage/issues/292)) ([89f953d](https://github.com/googleapis/nodejs-bigquery-storage/commit/89f953de24d774de076ce9aeef649122ab3d65a6)) | ||
* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-bigquery-storage/issues/1553)) ([#291](https://github.com/googleapis/nodejs-bigquery-storage/issues/291)) ([507e378](https://github.com/googleapis/nodejs-bigquery-storage/commit/507e3780553fa339ffccbba9a8f9ac930d1e9c6d)) | ||
## [3.1.0](https://github.com/googleapis/nodejs-bigquery-storage/compare/v3.0.0...v3.1.0) (2022-08-23) | ||
@@ -4,0 +12,0 @@ |
{ | ||
"name": "@google-cloud/bigquery-storage", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Client for the BigQuery Storage API", | ||
@@ -30,3 +30,3 @@ "repository": "googleapis/nodejs-bigquery-storage", | ||
"dependencies": { | ||
"google-gax": "^3.0.1" | ||
"google-gax": "^3.3.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2860393
44003
+ Added@babel/parser@7.26.8(transitive)
+ Added@babel/types@7.26.8(transitive)
- Removed@babel/parser@7.26.7(transitive)
- Removed@babel/types@7.26.7(transitive)
Updatedgoogle-gax@^3.3.0