@google-cloud/spanner 8.9.0 → 8.11.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.
Files changed (64) hide show
  1. package/build/protos/status.json +243 -0
  2. package/build/src/backup.d.ts +2 -1
  3. package/build/src/batch-transaction.d.ts +2 -1
  4. package/build/src/codec.d.ts +2 -1
  5. package/build/src/codec.js +21 -20
  6. package/build/src/common.d.ts +3 -2
  7. package/build/src/database.d.ts +5 -2
  8. package/build/src/index.d.ts +3 -2
  9. package/build/src/index.js +7 -16
  10. package/build/src/instance-config.d.ts +2 -1
  11. package/build/src/instance.d.ts +4 -3
  12. package/build/src/instance.js +3 -2
  13. package/build/src/partial-result-stream.d.ts +2 -1
  14. package/build/src/partial-result-stream.js +5 -4
  15. package/build/src/protos.d.ts +21 -0
  16. package/build/src/protos.js +52 -0
  17. package/build/src/session.d.ts +2 -1
  18. package/build/src/spanner_grpc_config.json +1 -1
  19. package/build/src/table.d.ts +3 -2
  20. package/build/src/table.js +4 -3
  21. package/build/src/transaction-runner.d.ts +2 -1
  22. package/build/src/transaction-runner.js +6 -8
  23. package/build/src/transaction.d.ts +3 -2
  24. package/build/src/transaction.js +6 -5
  25. package/build/src/v1/index.d.ts +1 -4
  26. package/build/src/v1/index.js +5 -8
  27. package/package.json +8 -6
  28. package/build/protos/google/spanner/admin/database/v1/backup.proto +0 -773
  29. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +0 -230
  30. package/build/protos/google/spanner/admin/database/v1/common.proto +0 -132
  31. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +0 -1314
  32. package/build/protos/google/spanner/admin/instance/v1/common.proto +0 -64
  33. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +0 -2184
  34. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +0 -1604
  35. package/build/protos/google/spanner/v1/change_stream.proto +0 -451
  36. package/build/protos/google/spanner/v1/commit_response.proto +0 -80
  37. package/build/protos/google/spanner/v1/keys.proto +0 -163
  38. package/build/protos/google/spanner/v1/location.proto +0 -388
  39. package/build/protos/google/spanner/v1/mutation.proto +0 -156
  40. package/build/protos/google/spanner/v1/query_plan.proto +0 -156
  41. package/build/protos/google/spanner/v1/result_set.proto +0 -260
  42. package/build/protos/google/spanner/v1/spanner.proto +0 -1472
  43. package/build/protos/google/spanner/v1/transaction.proto +0 -329
  44. package/build/protos/google/spanner/v1/type.proto +0 -214
  45. package/build/protos/protos.d.ts +0 -44031
  46. package/build/protos/protos.js +0 -122630
  47. package/build/protos/protos.json +0 -11631
  48. package/build/src/v1/database_admin_client.d.ts +0 -2367
  49. package/build/src/v1/database_admin_client.js +0 -2914
  50. package/build/src/v1/database_admin_client_config.json +0 -169
  51. package/build/src/v1/database_admin_proto_list.json +0 -6
  52. package/build/src/v1/gapic_metadata.json +0 -27
  53. package/build/src/v1/instance_admin_client.d.ts +0 -2106
  54. package/build/src/v1/instance_admin_client.js +0 -2387
  55. package/build/src/v1/instance_admin_client_config.json +0 -129
  56. package/build/src/v1/instance_admin_proto_list.json +0 -4
  57. package/build/src/v1/spanner_client.d.ts +0 -1319
  58. package/build/src/v1/spanner_client.js +0 -1446
  59. package/build/src/v1/spanner_client_config.json +0 -123
  60. package/build/src/v1/spanner_executor_proxy_client.d.ts +0 -419
  61. package/build/src/v1/spanner_executor_proxy_client.js +0 -728
  62. package/build/src/v1/spanner_executor_proxy_client_config.json +0 -30
  63. package/build/src/v1/spanner_executor_proxy_proto_list.json +0 -15
  64. package/build/src/v1/spanner_proto_list.json +0 -12
@@ -19,7 +19,8 @@
19
19
  declare const common: any;
20
20
  import * as r from 'teeny-request';
21
21
  import { Snapshot, Transaction, PartitionedDml, TimestampBounds } from './transaction';
22
- import { google } from '../protos/protos';
22
+ import { protos } from '@google-cloud/spanner-api';
23
+ import google = protos.google;
23
24
  import { Database } from './database';
24
25
  import { NormalCallback } from './common';
25
26
  import { ObservabilityOptions } from './instrument';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "channelPool": {
3
3
  "maxSize": 10,
4
- "maxConcurrentStreamsLowWatermark": 100
4
+ "maxConcurrentStreamsLowWatermark": 25
5
5
  },
6
6
  "method": [
7
7
  {
@@ -17,11 +17,12 @@ import { Operation as GaxOperation, CallOptions } from 'google-gax';
17
17
  import { Database, UpdateSchemaCallback, UpdateSchemaResponse } from './database';
18
18
  import { PartialResultStream } from './partial-result-stream';
19
19
  import { ReadRequest, TimestampBounds, CommitOptions, CommitResponse, ReadResponse, ReadCallback, CommitCallback } from './transaction';
20
- import { google as databaseAdmin } from '../protos/protos';
20
+ import { protos } from '@google-cloud/spanner-api';
21
+ import databaseAdmin = protos.google;
21
22
  import { Schema, LongRunningCallback } from './common';
22
23
  import IRequestOptions = databaseAdmin.spanner.v1.IRequestOptions;
23
24
  import { ObservabilityOptions } from './instrument';
24
- import { google } from '../protos/protos';
25
+ import google = protos.google;
25
26
  import IsolationLevel = google.spanner.v1.TransactionOptions.IsolationLevel;
26
27
  import ReadLockMode = google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
27
28
  import { Int, SpannerDate, Numeric, Float32, Float } from './codec';
@@ -18,10 +18,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.Table = void 0;
19
19
  const promisify_1 = require("@google-cloud/promisify");
20
20
  const through = require("through2");
21
+ const spanner_api_1 = require("@google-cloud/spanner-api");
21
22
  const instrument_1 = require("./instrument");
22
- const protos_1 = require("../protos/protos");
23
- var IsolationLevel = protos_1.google.spanner.v1.TransactionOptions.IsolationLevel;
24
- var ReadLockMode = protos_1.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
23
+ var google = spanner_api_1.protos.google;
24
+ var IsolationLevel = google.spanner.v1.TransactionOptions.IsolationLevel;
25
+ var ReadLockMode = google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
25
26
  const GOOGLE_STANDARD_SQL = 'GOOGLE_STANDARD_SQL';
26
27
  const POSTGRESQL = 'POSTGRESQL';
27
28
  /**
@@ -17,7 +17,8 @@ import { grpc } from 'google-gax';
17
17
  import { Session } from './session';
18
18
  import { Transaction } from './transaction';
19
19
  import { NormalCallback } from './common';
20
- import { google } from '../protos/protos';
20
+ import { protos } from '@google-cloud/spanner-api';
21
+ import google = protos.google;
21
22
  import IRequestOptions = google.spanner.v1.IRequestOptions;
22
23
  import IsolationLevel = google.spanner.v1.TransactionOptions.IsolationLevel;
23
24
  import ReadLockMode = google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
@@ -19,18 +19,16 @@ exports.AsyncTransactionRunner = exports.TransactionRunner = exports.Runner = ex
19
19
  exports.isRetryableInternalError = isRetryableInternalError;
20
20
  const promisify_1 = require("@google-cloud/promisify");
21
21
  const google_gax_1 = require("google-gax");
22
- const protobufjs_1 = require("protobufjs");
23
22
  const through = require("through2");
24
23
  const session_pool_1 = require("./session-pool");
25
- const protos_1 = require("../protos/protos");
26
- var IsolationLevel = protos_1.google.spanner.v1.TransactionOptions.IsolationLevel;
27
- var ReadLockMode = protos_1.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
28
- // eslint-disable-next-line @typescript-eslint/no-var-requires
29
- const jsonProtos = require('../protos/protos.json');
24
+ const spanner_api_1 = require("@google-cloud/spanner-api");
25
+ var google = spanner_api_1.protos.google;
26
+ var IsolationLevel = google.spanner.v1.TransactionOptions.IsolationLevel;
27
+ var ReadLockMode = google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
28
+ const protos_1 = require("./protos");
30
29
  const RETRY_INFO = 'google.rpc.retryinfo-bin';
31
30
  const RETRYABLE = [google_gax_1.grpc.status.ABORTED];
32
- // tslint:disable-next-line variable-name
33
- const RetryInfo = protobufjs_1.Root.fromJSON(jsonProtos).lookup('google.rpc.RetryInfo');
31
+ const RetryInfo = (0, protos_1.getRetryInfo)();
34
32
  /**
35
33
  * Error class used to signal a Transaction timeout.
36
34
  *
@@ -24,9 +24,10 @@ import { PartialResultStream, ResumeToken, Row } from './partial-result-stream';
24
24
  import { Session } from './session';
25
25
  import { Key } from './table';
26
26
  import { Span } from './instrument';
27
- import { google as spannerClient } from '../protos/protos';
28
27
  import { NormalCallback } from './common';
29
- import { google } from '../protos/protos';
28
+ import { protos } from '@google-cloud/spanner-api';
29
+ import spannerClient = protos.google;
30
+ import google = protos.google;
30
31
  import IQueryOptions = google.spanner.v1.ExecuteSqlRequest.IQueryOptions;
31
32
  import IRequestOptions = google.spanner.v1.IRequestOptions;
32
33
  import { Spanner } from '.';
@@ -24,11 +24,12 @@ const google_gax_1 = require("google-gax");
24
24
  const stream_1 = require("stream");
25
25
  const codec_1 = require("./codec");
26
26
  const partial_result_stream_1 = require("./partial-result-stream");
27
- const protos_1 = require("../protos/protos");
28
27
  const common_1 = require("./common");
29
- const protos_2 = require("../protos/protos");
30
- var IsolationLevel = protos_2.google.spanner.v1.TransactionOptions.IsolationLevel;
31
- var ReadLockMode = protos_2.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
28
+ const spanner_api_1 = require("@google-cloud/spanner-api");
29
+ var spannerClient = spanner_api_1.protos.google;
30
+ var google = spanner_api_1.protos.google;
31
+ var IsolationLevel = google.spanner.v1.TransactionOptions.IsolationLevel;
32
+ var ReadLockMode = google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
32
33
  const instrument_1 = require("./instrument");
33
34
  const request_id_header_1 = require("./request_id_header");
34
35
  const RETRY_INFO_TYPE = 'type.googleapis.com/google.rpc.retryinfo';
@@ -2229,7 +2230,7 @@ class MutationGroup {
2229
2230
  _proto;
2230
2231
  constructor() {
2231
2232
  this._proto =
2232
- new protos_1.google.spanner.v1.BatchWriteRequest.MutationGroup();
2233
+ new spannerClient.spanner.v1.BatchWriteRequest.MutationGroup();
2233
2234
  }
2234
2235
  insert(table, rows) {
2235
2236
  this._proto.mutations.push(buildMutation('insert', table, rows));
@@ -1,4 +1 @@
1
- export { SpannerClient } from './spanner_client';
2
- export { DatabaseAdminClient } from './database_admin_client';
3
- export { InstanceAdminClient } from './instance_admin_client';
4
- export { SpannerExecutorProxyClient } from './spanner_executor_proxy_client';
1
+ export { SpannerClient, DatabaseAdminClient, InstanceAdminClient, SpannerExecutorProxyClient, } from '@google-cloud/spanner-api';
@@ -18,12 +18,9 @@
18
18
  // ** All changes to this file may be overwritten. **
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.SpannerExecutorProxyClient = exports.InstanceAdminClient = exports.DatabaseAdminClient = exports.SpannerClient = void 0;
21
- var spanner_client_1 = require("./spanner_client");
22
- Object.defineProperty(exports, "SpannerClient", { enumerable: true, get: function () { return spanner_client_1.SpannerClient; } });
23
- var database_admin_client_1 = require("./database_admin_client");
24
- Object.defineProperty(exports, "DatabaseAdminClient", { enumerable: true, get: function () { return database_admin_client_1.DatabaseAdminClient; } });
25
- var instance_admin_client_1 = require("./instance_admin_client");
26
- Object.defineProperty(exports, "InstanceAdminClient", { enumerable: true, get: function () { return instance_admin_client_1.InstanceAdminClient; } });
27
- var spanner_executor_proxy_client_1 = require("./spanner_executor_proxy_client");
28
- Object.defineProperty(exports, "SpannerExecutorProxyClient", { enumerable: true, get: function () { return spanner_executor_proxy_client_1.SpannerExecutorProxyClient; } });
21
+ var spanner_api_1 = require("@google-cloud/spanner-api");
22
+ Object.defineProperty(exports, "SpannerClient", { enumerable: true, get: function () { return spanner_api_1.SpannerClient; } });
23
+ Object.defineProperty(exports, "DatabaseAdminClient", { enumerable: true, get: function () { return spanner_api_1.DatabaseAdminClient; } });
24
+ Object.defineProperty(exports, "InstanceAdminClient", { enumerable: true, get: function () { return spanner_api_1.InstanceAdminClient; } });
25
+ Object.defineProperty(exports, "SpannerExecutorProxyClient", { enumerable: true, get: function () { return spanner_api_1.SpannerExecutorProxyClient; } });
29
26
  //# sourceMappingURL=index.js.map
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": "8.9.0",
4
+ "version": "8.11.0",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Google Inc.",
7
7
  "engines": {
@@ -42,14 +42,12 @@
42
42
  "fix": "gts fix",
43
43
  "clean": "gts clean",
44
44
  "compile": "tsc -p . && cp -r protos build && cp -r test/data build/test",
45
- "prepare": "npm run compile-protos && npm run compile",
45
+ "prepare": "cp -r protos build && npm run compile",
46
46
  "pretest": "npm run compile",
47
47
  "presystem-test": "npm run compile",
48
48
  "preobservability-test": "npm run compile",
49
- "proto": "compileProtos src",
50
49
  "benchwrapper": "node bin/benchwrapper.js",
51
50
  "precompile": "gts clean",
52
- "compile-protos": "compileProtos src",
53
51
  "coverage": "c8 mocha build/test build/test/common && c8 report --check-coverage"
54
52
  },
55
53
  "dependencies": {
@@ -61,6 +59,7 @@
61
59
  "@google-cloud/opentelemetry-resource-util": "^2.4.0",
62
60
  "@google-cloud/precise-date": "^5.0.0",
63
61
  "@google-cloud/promisify": "^5.0.0",
62
+ "@google-cloud/spanner-api": "^0.2.0",
64
63
  "@grpc/grpc-js": "^1.13.2",
65
64
  "@grpc/proto-loader": "^0.8.0",
66
65
  "@opentelemetry/api": "^1.9.0",
@@ -139,12 +138,15 @@
139
138
  },
140
139
  "overrides": {
141
140
  "gcp-metadata": "^7.0.1",
142
- "@sinonjs/fake-timers": "15.2.1"
141
+ "@sinonjs/fake-timers": "15.2.1",
142
+ "brace-expansion": "5.0.7",
143
+ "@eslint-community/eslint-utils": "<4.10.0"
143
144
  },
144
145
  "pnpm": {
145
146
  "overrides": {
146
147
  "gcp-metadata": "^7.0.1",
147
- "@sinonjs/fake-timers": "15.2.1"
148
+ "@sinonjs/fake-timers": "15.2.1",
149
+ "@eslint-community/eslint-utils": "<4.10.0"
148
150
  }
149
151
  },
150
152
  "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/handwritten/spanner"