@google-cloud/spanner 7.2.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +40 -0
- package/build/protos/google/spanner/v1/spanner.proto +42 -8
- package/build/protos/google/spanner/v1/transaction.proto +17 -1
- package/build/protos/google/spanner/v1/type.proto +18 -0
- package/build/protos/protos.d.ts +304 -29
- package/build/protos/protos.js +1203 -119
- package/build/protos/protos.json +134 -36
- package/build/src/codec.d.ts +10 -0
- package/build/src/codec.js +34 -4
- package/build/src/index.js +2 -1
- package/build/src/partial-result-stream.d.ts +1 -1
- package/build/src/partial-result-stream.js +4 -3
- package/build/src/transaction.d.ts +5 -1
- package/build/src/transaction.js +9 -2
- package/build/src/v1/database_admin_client.d.ts +42 -2
- package/build/src/v1/database_admin_client.js +37 -10
- package/build/src/v1/instance_admin_client.d.ts +11 -2
- package/build/src/v1/instance_admin_client.js +37 -10
- package/build/src/v1/spanner_client.d.ts +34 -5
- package/build/src/v1/spanner_client.js +56 -13
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2024 Google LLC
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -78,7 +78,7 @@ class DatabaseAdminClient {
|
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
80
|
constructor(opts, gaxInstance) {
|
|
81
|
-
var _a, _b;
|
|
81
|
+
var _a, _b, _c, _d;
|
|
82
82
|
this._terminated = false;
|
|
83
83
|
this.descriptors = {
|
|
84
84
|
page: {},
|
|
@@ -88,16 +88,24 @@ class DatabaseAdminClient {
|
|
|
88
88
|
};
|
|
89
89
|
// Ensure that options include all the required fields.
|
|
90
90
|
const staticMembers = this.constructor;
|
|
91
|
-
|
|
91
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
|
|
92
|
+
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
|
|
93
|
+
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
|
|
94
|
+
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
95
|
+
}
|
|
96
|
+
this._universeDomain =
|
|
97
|
+
(_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
|
|
98
|
+
this._servicePath = 'spanner.' + this._universeDomain;
|
|
99
|
+
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
|
|
92
100
|
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
|
|
93
101
|
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
|
|
94
|
-
const clientConfig = (
|
|
95
|
-
const fallback = (
|
|
102
|
+
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
|
|
103
|
+
const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
|
|
96
104
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
97
105
|
// Request numeric enum values if REST transport is used.
|
|
98
106
|
opts.numericEnums = true;
|
|
99
107
|
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
|
|
100
|
-
if (servicePath !==
|
|
108
|
+
if (servicePath !== this._servicePath && !('scopes' in opts)) {
|
|
101
109
|
opts['scopes'] = staticMembers.scopes;
|
|
102
110
|
}
|
|
103
111
|
// Load google-gax module synchronously if needed
|
|
@@ -115,9 +123,9 @@ class DatabaseAdminClient {
|
|
|
115
123
|
// Set useJWTAccessWithScope on the auth object.
|
|
116
124
|
this.auth.useJWTAccessWithScope = true;
|
|
117
125
|
// Set defaultServicePath on the auth object.
|
|
118
|
-
this.auth.defaultServicePath =
|
|
126
|
+
this.auth.defaultServicePath = this._servicePath;
|
|
119
127
|
// Set the default scopes in auth client if needed.
|
|
120
|
-
if (servicePath ===
|
|
128
|
+
if (servicePath === this._servicePath) {
|
|
121
129
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
122
130
|
}
|
|
123
131
|
// Determine the client header string.
|
|
@@ -312,19 +320,38 @@ class DatabaseAdminClient {
|
|
|
312
320
|
}
|
|
313
321
|
/**
|
|
314
322
|
* The DNS address for this API service.
|
|
323
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
315
324
|
* @returns {string} The DNS address for this service.
|
|
316
325
|
*/
|
|
317
326
|
static get servicePath() {
|
|
327
|
+
if (typeof process !== undefined &&
|
|
328
|
+
typeof process.emitWarning === 'function') {
|
|
329
|
+
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
330
|
+
}
|
|
318
331
|
return 'spanner.googleapis.com';
|
|
319
332
|
}
|
|
320
333
|
/**
|
|
321
|
-
* The DNS address for this API service - same as servicePath
|
|
322
|
-
*
|
|
334
|
+
* The DNS address for this API service - same as servicePath.
|
|
335
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
323
336
|
* @returns {string} The DNS address for this service.
|
|
324
337
|
*/
|
|
325
338
|
static get apiEndpoint() {
|
|
339
|
+
if (typeof process !== undefined &&
|
|
340
|
+
typeof process.emitWarning === 'function') {
|
|
341
|
+
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
342
|
+
}
|
|
326
343
|
return 'spanner.googleapis.com';
|
|
327
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* The DNS address for this API service.
|
|
347
|
+
* @returns {string} The DNS address for this service.
|
|
348
|
+
*/
|
|
349
|
+
get apiEndpoint() {
|
|
350
|
+
return this._servicePath;
|
|
351
|
+
}
|
|
352
|
+
get universeDomain() {
|
|
353
|
+
return this._universeDomain;
|
|
354
|
+
}
|
|
328
355
|
/**
|
|
329
356
|
* The port for this API service.
|
|
330
357
|
* @returns {number} The default port for this service.
|
|
@@ -36,6 +36,8 @@ export declare class InstanceAdminClient {
|
|
|
36
36
|
private _gaxGrpc;
|
|
37
37
|
private _protos;
|
|
38
38
|
private _defaults;
|
|
39
|
+
private _universeDomain;
|
|
40
|
+
private _servicePath;
|
|
39
41
|
auth: gax.GoogleAuth;
|
|
40
42
|
descriptors: Descriptors;
|
|
41
43
|
warn: (code: string, message: string, warnType?: string) => void;
|
|
@@ -105,15 +107,22 @@ export declare class InstanceAdminClient {
|
|
|
105
107
|
}>;
|
|
106
108
|
/**
|
|
107
109
|
* The DNS address for this API service.
|
|
110
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
108
111
|
* @returns {string} The DNS address for this service.
|
|
109
112
|
*/
|
|
110
113
|
static get servicePath(): string;
|
|
111
114
|
/**
|
|
112
|
-
* The DNS address for this API service - same as servicePath
|
|
113
|
-
*
|
|
115
|
+
* The DNS address for this API service - same as servicePath.
|
|
116
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
114
117
|
* @returns {string} The DNS address for this service.
|
|
115
118
|
*/
|
|
116
119
|
static get apiEndpoint(): string;
|
|
120
|
+
/**
|
|
121
|
+
* The DNS address for this API service.
|
|
122
|
+
* @returns {string} The DNS address for this service.
|
|
123
|
+
*/
|
|
124
|
+
get apiEndpoint(): string;
|
|
125
|
+
get universeDomain(): string;
|
|
117
126
|
/**
|
|
118
127
|
* The port for this API service.
|
|
119
128
|
* @returns {number} The default port for this service.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2024 Google LLC
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -92,7 +92,7 @@ class InstanceAdminClient {
|
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
94
|
constructor(opts, gaxInstance) {
|
|
95
|
-
var _a, _b;
|
|
95
|
+
var _a, _b, _c, _d;
|
|
96
96
|
this._terminated = false;
|
|
97
97
|
this.descriptors = {
|
|
98
98
|
page: {},
|
|
@@ -102,16 +102,24 @@ class InstanceAdminClient {
|
|
|
102
102
|
};
|
|
103
103
|
// Ensure that options include all the required fields.
|
|
104
104
|
const staticMembers = this.constructor;
|
|
105
|
-
|
|
105
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
|
|
106
|
+
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
|
|
107
|
+
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
|
|
108
|
+
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
109
|
+
}
|
|
110
|
+
this._universeDomain =
|
|
111
|
+
(_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
|
|
112
|
+
this._servicePath = 'spanner.' + this._universeDomain;
|
|
113
|
+
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
|
|
106
114
|
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
|
|
107
115
|
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
|
|
108
|
-
const clientConfig = (
|
|
109
|
-
const fallback = (
|
|
116
|
+
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
|
|
117
|
+
const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
|
|
110
118
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
111
119
|
// Request numeric enum values if REST transport is used.
|
|
112
120
|
opts.numericEnums = true;
|
|
113
121
|
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
|
|
114
|
-
if (servicePath !==
|
|
122
|
+
if (servicePath !== this._servicePath && !('scopes' in opts)) {
|
|
115
123
|
opts['scopes'] = staticMembers.scopes;
|
|
116
124
|
}
|
|
117
125
|
// Load google-gax module synchronously if needed
|
|
@@ -129,9 +137,9 @@ class InstanceAdminClient {
|
|
|
129
137
|
// Set useJWTAccessWithScope on the auth object.
|
|
130
138
|
this.auth.useJWTAccessWithScope = true;
|
|
131
139
|
// Set defaultServicePath on the auth object.
|
|
132
|
-
this.auth.defaultServicePath =
|
|
140
|
+
this.auth.defaultServicePath = this._servicePath;
|
|
133
141
|
// Set the default scopes in auth client if needed.
|
|
134
|
-
if (servicePath ===
|
|
142
|
+
if (servicePath === this._servicePath) {
|
|
135
143
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
136
144
|
}
|
|
137
145
|
// Determine the client header string.
|
|
@@ -296,19 +304,38 @@ class InstanceAdminClient {
|
|
|
296
304
|
}
|
|
297
305
|
/**
|
|
298
306
|
* The DNS address for this API service.
|
|
307
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
299
308
|
* @returns {string} The DNS address for this service.
|
|
300
309
|
*/
|
|
301
310
|
static get servicePath() {
|
|
311
|
+
if (typeof process !== undefined &&
|
|
312
|
+
typeof process.emitWarning === 'function') {
|
|
313
|
+
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
314
|
+
}
|
|
302
315
|
return 'spanner.googleapis.com';
|
|
303
316
|
}
|
|
304
317
|
/**
|
|
305
|
-
* The DNS address for this API service - same as servicePath
|
|
306
|
-
*
|
|
318
|
+
* The DNS address for this API service - same as servicePath.
|
|
319
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
307
320
|
* @returns {string} The DNS address for this service.
|
|
308
321
|
*/
|
|
309
322
|
static get apiEndpoint() {
|
|
323
|
+
if (typeof process !== undefined &&
|
|
324
|
+
typeof process.emitWarning === 'function') {
|
|
325
|
+
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
326
|
+
}
|
|
310
327
|
return 'spanner.googleapis.com';
|
|
311
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* The DNS address for this API service.
|
|
331
|
+
* @returns {string} The DNS address for this service.
|
|
332
|
+
*/
|
|
333
|
+
get apiEndpoint() {
|
|
334
|
+
return this._servicePath;
|
|
335
|
+
}
|
|
336
|
+
get universeDomain() {
|
|
337
|
+
return this._universeDomain;
|
|
338
|
+
}
|
|
312
339
|
/**
|
|
313
340
|
* The port for this API service.
|
|
314
341
|
* @returns {number} The default port for this service.
|
|
@@ -19,6 +19,8 @@ export declare class SpannerClient {
|
|
|
19
19
|
private _gaxGrpc;
|
|
20
20
|
private _protos;
|
|
21
21
|
private _defaults;
|
|
22
|
+
private _universeDomain;
|
|
23
|
+
private _servicePath;
|
|
22
24
|
auth: gax.GoogleAuth;
|
|
23
25
|
descriptors: Descriptors;
|
|
24
26
|
warn: (code: string, message: string, warnType?: string) => void;
|
|
@@ -87,15 +89,22 @@ export declare class SpannerClient {
|
|
|
87
89
|
}>;
|
|
88
90
|
/**
|
|
89
91
|
* The DNS address for this API service.
|
|
92
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
90
93
|
* @returns {string} The DNS address for this service.
|
|
91
94
|
*/
|
|
92
95
|
static get servicePath(): string;
|
|
93
96
|
/**
|
|
94
|
-
* The DNS address for this API service - same as servicePath
|
|
95
|
-
*
|
|
97
|
+
* The DNS address for this API service - same as servicePath.
|
|
98
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
96
99
|
* @returns {string} The DNS address for this service.
|
|
97
100
|
*/
|
|
98
101
|
static get apiEndpoint(): string;
|
|
102
|
+
/**
|
|
103
|
+
* The DNS address for this API service.
|
|
104
|
+
* @returns {string} The DNS address for this service.
|
|
105
|
+
*/
|
|
106
|
+
get apiEndpoint(): string;
|
|
107
|
+
get universeDomain(): string;
|
|
99
108
|
/**
|
|
100
109
|
* The port for this API service.
|
|
101
110
|
* @returns {number} The default port for this service.
|
|
@@ -562,6 +571,12 @@ export declare class SpannerClient {
|
|
|
562
571
|
* If `true`, then statistics related to the transaction will be included in
|
|
563
572
|
* the {@link protos.google.spanner.v1.CommitResponse.commit_stats|CommitResponse}.
|
|
564
573
|
* Default value is `false`.
|
|
574
|
+
* @param {google.protobuf.Duration} [request.maxCommitDelay]
|
|
575
|
+
* Optional. The amount of latency this request is willing to incur in order
|
|
576
|
+
* to improve throughput. If this field is not set, Spanner assumes requests
|
|
577
|
+
* are relatively latency sensitive and automatically determines an
|
|
578
|
+
* appropriate delay time. You can specify a batching delay value between 0
|
|
579
|
+
* and 500 ms.
|
|
565
580
|
* @param {google.spanner.v1.RequestOptions} request.requestOptions
|
|
566
581
|
* Common options for this request.
|
|
567
582
|
* @param {object} [options]
|
|
@@ -633,9 +648,10 @@ export declare class SpannerClient {
|
|
|
633
648
|
* @param {string} request.sql
|
|
634
649
|
* Required. The query request to generate partitions for. The request will
|
|
635
650
|
* fail if the query is not root partitionable. For a query to be root
|
|
636
|
-
* partitionable, it needs to satisfy a few conditions. For example, the
|
|
637
|
-
*
|
|
638
|
-
* For more information about other
|
|
651
|
+
* partitionable, it needs to satisfy a few conditions. For example, if the
|
|
652
|
+
* query execution plan contains a distributed union operator, then it must be
|
|
653
|
+
* the first operator in the plan. For more information about other
|
|
654
|
+
* conditions, see [Read data in
|
|
639
655
|
* parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel).
|
|
640
656
|
*
|
|
641
657
|
* The query request must not contain DML commands, such as INSERT, UPDATE, or
|
|
@@ -943,6 +959,19 @@ export declare class SpannerClient {
|
|
|
943
959
|
* Common options for this request.
|
|
944
960
|
* @param {number[]} request.mutationGroups
|
|
945
961
|
* Required. The groups of mutations to be applied.
|
|
962
|
+
* @param {boolean} [request.excludeTxnFromChangeStreams]
|
|
963
|
+
* Optional. When `exclude_txn_from_change_streams` is set to `true`:
|
|
964
|
+
* * Mutations from all transactions in this batch write operation will not
|
|
965
|
+
* be recorded in change streams with DDL option `allow_txn_exclusion=true`
|
|
966
|
+
* that are tracking columns modified by these transactions.
|
|
967
|
+
* * Mutations from all transactions in this batch write operation will be
|
|
968
|
+
* recorded in change streams with DDL option `allow_txn_exclusion=false or
|
|
969
|
+
* not set` that are tracking columns modified by these transactions.
|
|
970
|
+
*
|
|
971
|
+
* When `exclude_txn_from_change_streams` is set to `false` or not set,
|
|
972
|
+
* mutations from all transactions in this batch write operation will be
|
|
973
|
+
* recorded in all change streams that are tracking columns modified by these
|
|
974
|
+
* transactions.
|
|
946
975
|
* @param {object} [options]
|
|
947
976
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
948
977
|
* @returns {Stream}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2024 Google LLC
|
|
3
3
|
//
|
|
4
4
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
// you may not use this file except in compliance with the License.
|
|
@@ -76,7 +76,7 @@ class SpannerClient {
|
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
78
|
constructor(opts, gaxInstance) {
|
|
79
|
-
var _a, _b;
|
|
79
|
+
var _a, _b, _c, _d;
|
|
80
80
|
this._terminated = false;
|
|
81
81
|
this.descriptors = {
|
|
82
82
|
page: {},
|
|
@@ -86,16 +86,24 @@ class SpannerClient {
|
|
|
86
86
|
};
|
|
87
87
|
// Ensure that options include all the required fields.
|
|
88
88
|
const staticMembers = this.constructor;
|
|
89
|
-
|
|
89
|
+
if ((opts === null || opts === void 0 ? void 0 : opts.universe_domain) &&
|
|
90
|
+
(opts === null || opts === void 0 ? void 0 : opts.universeDomain) &&
|
|
91
|
+
(opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
|
|
92
|
+
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
|
93
|
+
}
|
|
94
|
+
this._universeDomain =
|
|
95
|
+
(_b = (_a = opts === null || opts === void 0 ? void 0 : opts.universeDomain) !== null && _a !== void 0 ? _a : opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== null && _b !== void 0 ? _b : 'googleapis.com';
|
|
96
|
+
this._servicePath = 'spanner.' + this._universeDomain;
|
|
97
|
+
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
|
|
90
98
|
this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
|
|
91
99
|
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
|
|
92
|
-
const clientConfig = (
|
|
93
|
-
const fallback = (
|
|
100
|
+
const clientConfig = (_c = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _c !== void 0 ? _c : {};
|
|
101
|
+
const fallback = (_d = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _d !== void 0 ? _d : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
|
|
94
102
|
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
|
|
95
103
|
// Request numeric enum values if REST transport is used.
|
|
96
104
|
opts.numericEnums = true;
|
|
97
105
|
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case.
|
|
98
|
-
if (servicePath !==
|
|
106
|
+
if (servicePath !== this._servicePath && !('scopes' in opts)) {
|
|
99
107
|
opts['scopes'] = staticMembers.scopes;
|
|
100
108
|
}
|
|
101
109
|
// Load google-gax module synchronously if needed
|
|
@@ -113,9 +121,9 @@ class SpannerClient {
|
|
|
113
121
|
// Set useJWTAccessWithScope on the auth object.
|
|
114
122
|
this.auth.useJWTAccessWithScope = true;
|
|
115
123
|
// Set defaultServicePath on the auth object.
|
|
116
|
-
this.auth.defaultServicePath =
|
|
124
|
+
this.auth.defaultServicePath = this._servicePath;
|
|
117
125
|
// Set the default scopes in auth client if needed.
|
|
118
|
-
if (servicePath ===
|
|
126
|
+
if (servicePath === this._servicePath) {
|
|
119
127
|
this.auth.defaultScopes = staticMembers.scopes;
|
|
120
128
|
}
|
|
121
129
|
// Determine the client header string.
|
|
@@ -153,9 +161,12 @@ class SpannerClient {
|
|
|
153
161
|
// Some of the methods on this service provide streaming responses.
|
|
154
162
|
// Provide descriptors for these.
|
|
155
163
|
this.descriptors.stream = {
|
|
156
|
-
executeStreamingSql: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback
|
|
157
|
-
|
|
158
|
-
|
|
164
|
+
executeStreamingSql: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback,
|
|
165
|
+
/* gaxStreamingRetries: */ false),
|
|
166
|
+
streamingRead: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback,
|
|
167
|
+
/* gaxStreamingRetries: */ false),
|
|
168
|
+
batchWrite: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback,
|
|
169
|
+
/* gaxStreamingRetries: */ false),
|
|
159
170
|
};
|
|
160
171
|
// Put together the default options sent with requests.
|
|
161
172
|
this._defaults = this._gaxGrpc.constructSettings('google.spanner.v1.Spanner', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
|
@@ -235,19 +246,38 @@ class SpannerClient {
|
|
|
235
246
|
}
|
|
236
247
|
/**
|
|
237
248
|
* The DNS address for this API service.
|
|
249
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
238
250
|
* @returns {string} The DNS address for this service.
|
|
239
251
|
*/
|
|
240
252
|
static get servicePath() {
|
|
253
|
+
if (typeof process !== undefined &&
|
|
254
|
+
typeof process.emitWarning === 'function') {
|
|
255
|
+
process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
256
|
+
}
|
|
241
257
|
return 'spanner.googleapis.com';
|
|
242
258
|
}
|
|
243
259
|
/**
|
|
244
|
-
* The DNS address for this API service - same as servicePath
|
|
245
|
-
*
|
|
260
|
+
* The DNS address for this API service - same as servicePath.
|
|
261
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
246
262
|
* @returns {string} The DNS address for this service.
|
|
247
263
|
*/
|
|
248
264
|
static get apiEndpoint() {
|
|
265
|
+
if (typeof process !== undefined &&
|
|
266
|
+
typeof process.emitWarning === 'function') {
|
|
267
|
+
process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
|
|
268
|
+
}
|
|
249
269
|
return 'spanner.googleapis.com';
|
|
250
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* The DNS address for this API service.
|
|
273
|
+
* @returns {string} The DNS address for this service.
|
|
274
|
+
*/
|
|
275
|
+
get apiEndpoint() {
|
|
276
|
+
return this._servicePath;
|
|
277
|
+
}
|
|
278
|
+
get universeDomain() {
|
|
279
|
+
return this._universeDomain;
|
|
280
|
+
}
|
|
251
281
|
/**
|
|
252
282
|
* The port for this API service.
|
|
253
283
|
* @returns {number} The default port for this service.
|
|
@@ -753,6 +783,19 @@ class SpannerClient {
|
|
|
753
783
|
* Common options for this request.
|
|
754
784
|
* @param {number[]} request.mutationGroups
|
|
755
785
|
* Required. The groups of mutations to be applied.
|
|
786
|
+
* @param {boolean} [request.excludeTxnFromChangeStreams]
|
|
787
|
+
* Optional. When `exclude_txn_from_change_streams` is set to `true`:
|
|
788
|
+
* * Mutations from all transactions in this batch write operation will not
|
|
789
|
+
* be recorded in change streams with DDL option `allow_txn_exclusion=true`
|
|
790
|
+
* that are tracking columns modified by these transactions.
|
|
791
|
+
* * Mutations from all transactions in this batch write operation will be
|
|
792
|
+
* recorded in change streams with DDL option `allow_txn_exclusion=false or
|
|
793
|
+
* not set` that are tracking columns modified by these transactions.
|
|
794
|
+
*
|
|
795
|
+
* When `exclude_txn_from_change_streams` is set to `false` or not set,
|
|
796
|
+
* mutations from all transactions in this batch write operation will be
|
|
797
|
+
* recorded in all change streams that are tracking columns modified by these
|
|
798
|
+
* transactions.
|
|
756
799
|
* @param {object} [options]
|
|
757
800
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
758
801
|
* @returns {Stream}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/spanner",
|
|
3
3
|
"description": "Cloud Spanner Client Library for Node.js",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.4.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Google Inc.",
|
|
7
7
|
"engines": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"events-intercept": "^2.0.0",
|
|
66
66
|
"extend": "^3.0.2",
|
|
67
67
|
"google-auth-library": "^9.0.0",
|
|
68
|
-
"google-gax": "4.
|
|
68
|
+
"google-gax": "4.3.1",
|
|
69
69
|
"grpc-gcp": "^1.0.0",
|
|
70
70
|
"is": "^3.2.1",
|
|
71
71
|
"lodash.snakecase": "^4.1.1",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@types/ncp": "^2.0.1",
|
|
91
91
|
"@types/proxyquire": "^1.3.28",
|
|
92
92
|
"@types/request": "^2.48.3",
|
|
93
|
-
"@types/sinon": "^
|
|
93
|
+
"@types/sinon": "^17.0.0",
|
|
94
94
|
"@types/through2": "^2.0.34",
|
|
95
95
|
"@types/uuid": "^9.0.0",
|
|
96
96
|
"binary-search-bounds": "^2.0.4",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"concat-stream": "^2.0.0",
|
|
100
100
|
"dedent": "^1.0.0",
|
|
101
101
|
"execa": "^5.0.0",
|
|
102
|
-
"gapic-tools": "^0.
|
|
102
|
+
"gapic-tools": "^0.3.0",
|
|
103
103
|
"gts": "^5.0.0",
|
|
104
104
|
"jsdoc": "^4.0.0",
|
|
105
105
|
"jsdoc-fresh": "^3.0.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"ncp": "^2.0.0",
|
|
112
112
|
"p-limit": "^3.0.1",
|
|
113
113
|
"proxyquire": "^2.0.1",
|
|
114
|
-
"sinon": "^
|
|
114
|
+
"sinon": "^17.0.0",
|
|
115
115
|
"stats-lite": "^2.1.1",
|
|
116
116
|
"time-span": "^4.0.0",
|
|
117
117
|
"tmp": "^0.2.0",
|