@google-cloud/spanner 7.5.0 → 7.7.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.
@@ -60,6 +60,10 @@
60
60
  "retry_codes_name": "idempotent",
61
61
  "retry_params_name": "e9fafda332ce8a1702dc1575de3ca81c4feb4799"
62
62
  },
63
+ "ListInstancePartitions": {
64
+ "retry_codes_name": "non_idempotent",
65
+ "retry_params_name": "default"
66
+ },
63
67
  "GetInstance": {
64
68
  "timeout_millis": 3600000,
65
69
  "retry_codes_name": "idempotent",
@@ -94,6 +98,26 @@
94
98
  "timeout_millis": 30000,
95
99
  "retry_codes_name": "non_idempotent",
96
100
  "retry_params_name": "default"
101
+ },
102
+ "GetInstancePartition": {
103
+ "retry_codes_name": "non_idempotent",
104
+ "retry_params_name": "default"
105
+ },
106
+ "CreateInstancePartition": {
107
+ "retry_codes_name": "non_idempotent",
108
+ "retry_params_name": "default"
109
+ },
110
+ "DeleteInstancePartition": {
111
+ "retry_codes_name": "non_idempotent",
112
+ "retry_params_name": "default"
113
+ },
114
+ "UpdateInstancePartition": {
115
+ "retry_codes_name": "non_idempotent",
116
+ "retry_params_name": "default"
117
+ },
118
+ "ListInstancePartitionOperations": {
119
+ "retry_codes_name": "non_idempotent",
120
+ "retry_params_name": "default"
97
121
  }
98
122
  }
99
123
  }
@@ -76,7 +76,7 @@ class SpannerClient {
76
76
  * ```
77
77
  */
78
78
  constructor(opts, gaxInstance) {
79
- var _a, _b, _c, _d;
79
+ var _a, _b, _c, _d, _e;
80
80
  this._terminated = false;
81
81
  this.descriptors = {
82
82
  page: {},
@@ -91,14 +91,17 @@ class SpannerClient {
91
91
  (opts === null || opts === void 0 ? void 0 : opts.universe_domain) !== (opts === null || opts === void 0 ? void 0 : opts.universeDomain)) {
92
92
  throw new Error('Please set either universe_domain or universeDomain, but not both.');
93
93
  }
94
+ const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
95
+ ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
96
+ : undefined;
94
97
  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';
98
+ (_c = (_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 : universeDomainEnvVar) !== null && _c !== void 0 ? _c : 'googleapis.com';
96
99
  this._servicePath = 'spanner.' + this._universeDomain;
97
100
  const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || this._servicePath;
98
101
  this._providedCustomServicePath = !!((opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint));
99
102
  const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port;
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');
103
+ const clientConfig = (_d = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _d !== void 0 ? _d : {};
104
+ const fallback = (_e = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _e !== void 0 ? _e : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function');
102
105
  opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts);
103
106
  // Request numeric enum values if REST transport is used.
104
107
  opts.numericEnums = true;
@@ -128,7 +131,7 @@ class SpannerClient {
128
131
  }
129
132
  // Determine the client header string.
130
133
  const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`];
131
- if (typeof process !== 'undefined' && 'versions' in process) {
134
+ if (typeof process === 'object' && 'versions' in process) {
132
135
  clientHeader.push(`gl-node/${process.versions.node}`);
133
136
  }
134
137
  else {
@@ -250,7 +253,7 @@ class SpannerClient {
250
253
  * @returns {string} The DNS address for this service.
251
254
  */
252
255
  static get servicePath() {
253
- if (typeof process !== undefined &&
256
+ if (typeof process === 'object' &&
254
257
  typeof process.emitWarning === 'function') {
255
258
  process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning');
256
259
  }
@@ -262,7 +265,7 @@ class SpannerClient {
262
265
  * @returns {string} The DNS address for this service.
263
266
  */
264
267
  static get apiEndpoint() {
265
- if (typeof process !== undefined &&
268
+ if (typeof process === 'object' &&
266
269
  typeof process.emitWarning === 'function') {
267
270
  process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning');
268
271
  }
@@ -0,0 +1,376 @@
1
+ import type * as gax from 'google-gax';
2
+ import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax';
3
+ /**
4
+ * Service that executes SpannerActions asynchronously.
5
+ * @class
6
+ * @memberof v1
7
+ */
8
+ export declare class SpannerExecutorProxyClient {
9
+ private _terminated;
10
+ private _opts;
11
+ private _providedCustomServicePath;
12
+ private _gaxModule;
13
+ private _gaxGrpc;
14
+ private _protos;
15
+ private _defaults;
16
+ private _universeDomain;
17
+ private _servicePath;
18
+ auth: gax.GoogleAuth;
19
+ descriptors: Descriptors;
20
+ warn: (code: string, message: string, warnType?: string) => void;
21
+ innerApiCalls: {
22
+ [name: string]: Function;
23
+ };
24
+ pathTemplates: {
25
+ [name: string]: gax.PathTemplate;
26
+ };
27
+ spannerExecutorProxyStub?: Promise<{
28
+ [name: string]: Function;
29
+ }>;
30
+ /**
31
+ * Construct an instance of SpannerExecutorProxyClient.
32
+ *
33
+ * @param {object} [options] - The configuration object.
34
+ * The options accepted by the constructor are described in detail
35
+ * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
36
+ * The common options are:
37
+ * @param {object} [options.credentials] - Credentials object.
38
+ * @param {string} [options.credentials.client_email]
39
+ * @param {string} [options.credentials.private_key]
40
+ * @param {string} [options.email] - Account email address. Required when
41
+ * using a .pem or .p12 keyFilename.
42
+ * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
43
+ * .p12 key downloaded from the Google Developers Console. If you provide
44
+ * a path to a JSON file, the projectId option below is not necessary.
45
+ * NOTE: .pem and .p12 require you to specify options.email as well.
46
+ * @param {number} [options.port] - The port on which to connect to
47
+ * the remote host.
48
+ * @param {string} [options.projectId] - The project ID from the Google
49
+ * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
50
+ * the environment variable GCLOUD_PROJECT for your project ID. If your
51
+ * app is running in an environment which supports
52
+ * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
53
+ * your project ID will be detected automatically.
54
+ * @param {string} [options.apiEndpoint] - The domain name of the
55
+ * API remote host.
56
+ * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
57
+ * Follows the structure of {@link gapicConfig}.
58
+ * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
59
+ * For more information, please check the
60
+ * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
61
+ * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
62
+ * need to avoid loading the default gRPC version and want to use the fallback
63
+ * HTTP implementation. Load only fallback version and pass it to the constructor:
64
+ * ```
65
+ * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
66
+ * const client = new SpannerExecutorProxyClient({fallback: true}, gax);
67
+ * ```
68
+ */
69
+ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
70
+ /**
71
+ * Initialize the client.
72
+ * Performs asynchronous operations (such as authentication) and prepares the client.
73
+ * This function will be called automatically when any class method is called for the
74
+ * first time, but if you need to initialize it before calling an actual method,
75
+ * feel free to call initialize() directly.
76
+ *
77
+ * You can await on this method if you want to make sure the client is initialized.
78
+ *
79
+ * @returns {Promise} A promise that resolves to an authenticated service stub.
80
+ */
81
+ initialize(): Promise<{
82
+ [name: string]: Function;
83
+ }>;
84
+ /**
85
+ * The DNS address for this API service.
86
+ * @deprecated Use the apiEndpoint method of the client instance.
87
+ * @returns {string} The DNS address for this service.
88
+ */
89
+ static get servicePath(): string;
90
+ /**
91
+ * The DNS address for this API service - same as servicePath.
92
+ * @deprecated Use the apiEndpoint method of the client instance.
93
+ * @returns {string} The DNS address for this service.
94
+ */
95
+ static get apiEndpoint(): string;
96
+ /**
97
+ * The DNS address for this API service.
98
+ * @returns {string} The DNS address for this service.
99
+ */
100
+ get apiEndpoint(): string;
101
+ get universeDomain(): string;
102
+ /**
103
+ * The port for this API service.
104
+ * @returns {number} The default port for this service.
105
+ */
106
+ static get port(): number;
107
+ /**
108
+ * The scopes needed to make gRPC calls for every method defined
109
+ * in this service.
110
+ * @returns {string[]} List of default scopes.
111
+ */
112
+ static get scopes(): never[];
113
+ getProjectId(): Promise<string>;
114
+ getProjectId(callback: Callback<string, undefined, undefined>): void;
115
+ /**
116
+ * ExecuteActionAsync is a streaming call that starts executing a new Spanner
117
+ * action.
118
+ *
119
+ * For each request, the server will reply with one or more responses, but
120
+ * only the last response will contain status in the outcome.
121
+ *
122
+ * Responses can be matched to requests by action_id. It is allowed to have
123
+ * multiple actions in flight--in that case, actions are be executed in
124
+ * parallel.
125
+ *
126
+ * @param {object} [options]
127
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
128
+ * @returns {Stream}
129
+ * An object stream which is both readable and writable. It accepts objects
130
+ * representing {@link protos.google.spanner.executor.v1.SpannerAsyncActionRequest|SpannerAsyncActionRequest} for write() method, and
131
+ * will emit objects representing {@link protos.google.spanner.executor.v1.SpannerAsyncActionResponse|SpannerAsyncActionResponse} on 'data' event asynchronously.
132
+ * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation }
133
+ * for more details and examples.
134
+ * @example <caption>include:samples/generated/v1/spanner_executor_proxy.execute_action_async.js</caption>
135
+ * region_tag:spanner-cloud-executor_v1_generated_SpannerExecutorProxy_ExecuteActionAsync_async
136
+ */
137
+ executeActionAsync(options?: CallOptions): gax.CancellableStream;
138
+ /**
139
+ * Return a fully-qualified backup resource name string.
140
+ *
141
+ * @param {string} project
142
+ * @param {string} instance
143
+ * @param {string} backup
144
+ * @returns {string} Resource name string.
145
+ */
146
+ backupPath(project: string, instance: string, backup: string): string;
147
+ /**
148
+ * Parse the project from Backup resource.
149
+ *
150
+ * @param {string} backupName
151
+ * A fully-qualified path representing Backup resource.
152
+ * @returns {string} A string representing the project.
153
+ */
154
+ matchProjectFromBackupName(backupName: string): string | number;
155
+ /**
156
+ * Parse the instance from Backup resource.
157
+ *
158
+ * @param {string} backupName
159
+ * A fully-qualified path representing Backup resource.
160
+ * @returns {string} A string representing the instance.
161
+ */
162
+ matchInstanceFromBackupName(backupName: string): string | number;
163
+ /**
164
+ * Parse the backup from Backup resource.
165
+ *
166
+ * @param {string} backupName
167
+ * A fully-qualified path representing Backup resource.
168
+ * @returns {string} A string representing the backup.
169
+ */
170
+ matchBackupFromBackupName(backupName: string): string | number;
171
+ /**
172
+ * Return a fully-qualified database resource name string.
173
+ *
174
+ * @param {string} project
175
+ * @param {string} instance
176
+ * @param {string} database
177
+ * @returns {string} Resource name string.
178
+ */
179
+ databasePath(project: string, instance: string, database: string): string;
180
+ /**
181
+ * Parse the project from Database resource.
182
+ *
183
+ * @param {string} databaseName
184
+ * A fully-qualified path representing Database resource.
185
+ * @returns {string} A string representing the project.
186
+ */
187
+ matchProjectFromDatabaseName(databaseName: string): string | number;
188
+ /**
189
+ * Parse the instance from Database resource.
190
+ *
191
+ * @param {string} databaseName
192
+ * A fully-qualified path representing Database resource.
193
+ * @returns {string} A string representing the instance.
194
+ */
195
+ matchInstanceFromDatabaseName(databaseName: string): string | number;
196
+ /**
197
+ * Parse the database from Database resource.
198
+ *
199
+ * @param {string} databaseName
200
+ * A fully-qualified path representing Database resource.
201
+ * @returns {string} A string representing the database.
202
+ */
203
+ matchDatabaseFromDatabaseName(databaseName: string): string | number;
204
+ /**
205
+ * Return a fully-qualified databaseRole resource name string.
206
+ *
207
+ * @param {string} project
208
+ * @param {string} instance
209
+ * @param {string} database
210
+ * @param {string} role
211
+ * @returns {string} Resource name string.
212
+ */
213
+ databaseRolePath(project: string, instance: string, database: string, role: string): string;
214
+ /**
215
+ * Parse the project from DatabaseRole resource.
216
+ *
217
+ * @param {string} databaseRoleName
218
+ * A fully-qualified path representing DatabaseRole resource.
219
+ * @returns {string} A string representing the project.
220
+ */
221
+ matchProjectFromDatabaseRoleName(databaseRoleName: string): string | number;
222
+ /**
223
+ * Parse the instance from DatabaseRole resource.
224
+ *
225
+ * @param {string} databaseRoleName
226
+ * A fully-qualified path representing DatabaseRole resource.
227
+ * @returns {string} A string representing the instance.
228
+ */
229
+ matchInstanceFromDatabaseRoleName(databaseRoleName: string): string | number;
230
+ /**
231
+ * Parse the database from DatabaseRole resource.
232
+ *
233
+ * @param {string} databaseRoleName
234
+ * A fully-qualified path representing DatabaseRole resource.
235
+ * @returns {string} A string representing the database.
236
+ */
237
+ matchDatabaseFromDatabaseRoleName(databaseRoleName: string): string | number;
238
+ /**
239
+ * Parse the role from DatabaseRole resource.
240
+ *
241
+ * @param {string} databaseRoleName
242
+ * A fully-qualified path representing DatabaseRole resource.
243
+ * @returns {string} A string representing the role.
244
+ */
245
+ matchRoleFromDatabaseRoleName(databaseRoleName: string): string | number;
246
+ /**
247
+ * Return a fully-qualified instance resource name string.
248
+ *
249
+ * @param {string} project
250
+ * @param {string} instance
251
+ * @returns {string} Resource name string.
252
+ */
253
+ instancePath(project: string, instance: string): string;
254
+ /**
255
+ * Parse the project from Instance resource.
256
+ *
257
+ * @param {string} instanceName
258
+ * A fully-qualified path representing Instance resource.
259
+ * @returns {string} A string representing the project.
260
+ */
261
+ matchProjectFromInstanceName(instanceName: string): string | number;
262
+ /**
263
+ * Parse the instance from Instance resource.
264
+ *
265
+ * @param {string} instanceName
266
+ * A fully-qualified path representing Instance resource.
267
+ * @returns {string} A string representing the instance.
268
+ */
269
+ matchInstanceFromInstanceName(instanceName: string): string | number;
270
+ /**
271
+ * Return a fully-qualified instanceConfig resource name string.
272
+ *
273
+ * @param {string} project
274
+ * @param {string} instance_config
275
+ * @returns {string} Resource name string.
276
+ */
277
+ instanceConfigPath(project: string, instanceConfig: string): string;
278
+ /**
279
+ * Parse the project from InstanceConfig resource.
280
+ *
281
+ * @param {string} instanceConfigName
282
+ * A fully-qualified path representing InstanceConfig resource.
283
+ * @returns {string} A string representing the project.
284
+ */
285
+ matchProjectFromInstanceConfigName(instanceConfigName: string): string | number;
286
+ /**
287
+ * Parse the instance_config from InstanceConfig resource.
288
+ *
289
+ * @param {string} instanceConfigName
290
+ * A fully-qualified path representing InstanceConfig resource.
291
+ * @returns {string} A string representing the instance_config.
292
+ */
293
+ matchInstanceConfigFromInstanceConfigName(instanceConfigName: string): string | number;
294
+ /**
295
+ * Return a fully-qualified instancePartition resource name string.
296
+ *
297
+ * @param {string} project
298
+ * @param {string} instance
299
+ * @param {string} instance_partition
300
+ * @returns {string} Resource name string.
301
+ */
302
+ instancePartitionPath(project: string, instance: string, instancePartition: string): string;
303
+ /**
304
+ * Parse the project from InstancePartition resource.
305
+ *
306
+ * @param {string} instancePartitionName
307
+ * A fully-qualified path representing InstancePartition resource.
308
+ * @returns {string} A string representing the project.
309
+ */
310
+ matchProjectFromInstancePartitionName(instancePartitionName: string): string | number;
311
+ /**
312
+ * Parse the instance from InstancePartition resource.
313
+ *
314
+ * @param {string} instancePartitionName
315
+ * A fully-qualified path representing InstancePartition resource.
316
+ * @returns {string} A string representing the instance.
317
+ */
318
+ matchInstanceFromInstancePartitionName(instancePartitionName: string): string | number;
319
+ /**
320
+ * Parse the instance_partition from InstancePartition resource.
321
+ *
322
+ * @param {string} instancePartitionName
323
+ * A fully-qualified path representing InstancePartition resource.
324
+ * @returns {string} A string representing the instance_partition.
325
+ */
326
+ matchInstancePartitionFromInstancePartitionName(instancePartitionName: string): string | number;
327
+ /**
328
+ * Return a fully-qualified session resource name string.
329
+ *
330
+ * @param {string} project
331
+ * @param {string} instance
332
+ * @param {string} database
333
+ * @param {string} session
334
+ * @returns {string} Resource name string.
335
+ */
336
+ sessionPath(project: string, instance: string, database: string, session: string): string;
337
+ /**
338
+ * Parse the project from Session resource.
339
+ *
340
+ * @param {string} sessionName
341
+ * A fully-qualified path representing Session resource.
342
+ * @returns {string} A string representing the project.
343
+ */
344
+ matchProjectFromSessionName(sessionName: string): string | number;
345
+ /**
346
+ * Parse the instance from Session resource.
347
+ *
348
+ * @param {string} sessionName
349
+ * A fully-qualified path representing Session resource.
350
+ * @returns {string} A string representing the instance.
351
+ */
352
+ matchInstanceFromSessionName(sessionName: string): string | number;
353
+ /**
354
+ * Parse the database from Session resource.
355
+ *
356
+ * @param {string} sessionName
357
+ * A fully-qualified path representing Session resource.
358
+ * @returns {string} A string representing the database.
359
+ */
360
+ matchDatabaseFromSessionName(sessionName: string): string | number;
361
+ /**
362
+ * Parse the session from Session resource.
363
+ *
364
+ * @param {string} sessionName
365
+ * A fully-qualified path representing Session resource.
366
+ * @returns {string} A string representing the session.
367
+ */
368
+ matchSessionFromSessionName(sessionName: string): string | number;
369
+ /**
370
+ * Terminate the gRPC channel and close the client.
371
+ *
372
+ * The client will no longer be usable and all future behavior is undefined.
373
+ * @returns {Promise} A promise that resolves when the client is closed.
374
+ */
375
+ close(): Promise<void>;
376
+ }