@google-cloud/spanner 5.18.0 → 6.1.1
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 +46 -0
- package/README.md +3 -0
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +22 -10
- package/build/protos/google/spanner/v1/commit_response.proto +1 -1
- package/build/protos/google/spanner/v1/keys.proto +1 -1
- package/build/protos/google/spanner/v1/mutation.proto +1 -1
- package/build/protos/google/spanner/v1/query_plan.proto +1 -1
- package/build/protos/google/spanner/v1/result_set.proto +1 -2
- package/build/protos/google/spanner/v1/spanner.proto +4 -1
- package/build/protos/google/spanner/v1/transaction.proto +73 -21
- package/build/protos/google/spanner/v1/type.proto +1 -1
- package/build/protos/protos.d.ts +239 -0
- package/build/protos/protos.js +668 -1
- package/build/protos/protos.json +70 -0
- package/build/src/backup.d.ts +5 -1
- package/build/src/backup.js +2 -2
- package/build/src/batch-transaction.js +1 -1
- package/build/src/codec.d.ts +1 -1
- package/build/src/codec.js +5 -11
- package/build/src/common-grpc/service-object.js +1 -1
- package/build/src/common-grpc/service.js +2 -2
- package/build/src/database.d.ts +26 -6
- package/build/src/database.js +8 -8
- package/build/src/index.d.ts +1 -1
- package/build/src/index.js +7 -7
- package/build/src/instance.d.ts +2 -1
- package/build/src/instance.js +2 -2
- package/build/src/session-pool.d.ts +1 -0
- package/build/src/session-pool.js +51 -47
- package/build/src/session.js +1 -1
- package/build/src/table.d.ts +5 -1
- package/build/src/table.js +1 -1
- package/build/src/transaction-runner.js +3 -3
- package/build/src/transaction.d.ts +10 -2
- package/build/src/transaction.js +12 -12
- package/build/src/v1/database_admin_client.d.ts +102 -25
- package/build/src/v1/database_admin_client.js +42 -9
- package/build/src/v1/index.js +1 -0
- package/build/src/v1/instance_admin_client.d.ts +63 -18
- package/build/src/v1/instance_admin_client.js +42 -9
- package/build/src/v1/spanner_client.d.ts +70 -19
- package/build/src/v1/spanner_client.js +7 -8
- package/package.json +13 -13
package/build/protos/protos.json
CHANGED
|
@@ -624,6 +624,13 @@
|
|
|
624
624
|
"default": false
|
|
625
625
|
}
|
|
626
626
|
},
|
|
627
|
+
"unverifiedLazy": {
|
|
628
|
+
"type": "bool",
|
|
629
|
+
"id": 15,
|
|
630
|
+
"options": {
|
|
631
|
+
"default": false
|
|
632
|
+
}
|
|
633
|
+
},
|
|
627
634
|
"deprecated": {
|
|
628
635
|
"type": "bool",
|
|
629
636
|
"id": 3,
|
|
@@ -2942,6 +2949,20 @@
|
|
|
2942
2949
|
"rule": "repeated",
|
|
2943
2950
|
"type": "string",
|
|
2944
2951
|
"id": 8
|
|
2952
|
+
},
|
|
2953
|
+
"createTime": {
|
|
2954
|
+
"type": "google.protobuf.Timestamp",
|
|
2955
|
+
"id": 11,
|
|
2956
|
+
"options": {
|
|
2957
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
2958
|
+
}
|
|
2959
|
+
},
|
|
2960
|
+
"updateTime": {
|
|
2961
|
+
"type": "google.protobuf.Timestamp",
|
|
2962
|
+
"id": 12,
|
|
2963
|
+
"options": {
|
|
2964
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
2965
|
+
}
|
|
2945
2966
|
}
|
|
2946
2967
|
},
|
|
2947
2968
|
"nested": {
|
|
@@ -4018,6 +4039,10 @@
|
|
|
4018
4039
|
"options": {
|
|
4019
4040
|
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
4020
4041
|
}
|
|
4042
|
+
},
|
|
4043
|
+
"creatorRole": {
|
|
4044
|
+
"type": "string",
|
|
4045
|
+
"id": 5
|
|
4021
4046
|
}
|
|
4022
4047
|
}
|
|
4023
4048
|
},
|
|
@@ -5025,6 +5050,10 @@
|
|
|
5025
5050
|
"options": {
|
|
5026
5051
|
"(google.api.field_behavior)": "REQUIRED"
|
|
5027
5052
|
}
|
|
5053
|
+
},
|
|
5054
|
+
"updateMask": {
|
|
5055
|
+
"type": "google.protobuf.FieldMask",
|
|
5056
|
+
"id": 3
|
|
5028
5057
|
}
|
|
5029
5058
|
}
|
|
5030
5059
|
},
|
|
@@ -5092,6 +5121,11 @@
|
|
|
5092
5121
|
"type": "Binding",
|
|
5093
5122
|
"id": 4
|
|
5094
5123
|
},
|
|
5124
|
+
"auditConfigs": {
|
|
5125
|
+
"rule": "repeated",
|
|
5126
|
+
"type": "AuditConfig",
|
|
5127
|
+
"id": 6
|
|
5128
|
+
},
|
|
5095
5129
|
"etag": {
|
|
5096
5130
|
"type": "bytes",
|
|
5097
5131
|
"id": 3
|
|
@@ -5115,6 +5149,42 @@
|
|
|
5115
5149
|
}
|
|
5116
5150
|
}
|
|
5117
5151
|
},
|
|
5152
|
+
"AuditConfig": {
|
|
5153
|
+
"fields": {
|
|
5154
|
+
"service": {
|
|
5155
|
+
"type": "string",
|
|
5156
|
+
"id": 1
|
|
5157
|
+
},
|
|
5158
|
+
"auditLogConfigs": {
|
|
5159
|
+
"rule": "repeated",
|
|
5160
|
+
"type": "AuditLogConfig",
|
|
5161
|
+
"id": 3
|
|
5162
|
+
}
|
|
5163
|
+
}
|
|
5164
|
+
},
|
|
5165
|
+
"AuditLogConfig": {
|
|
5166
|
+
"fields": {
|
|
5167
|
+
"logType": {
|
|
5168
|
+
"type": "LogType",
|
|
5169
|
+
"id": 1
|
|
5170
|
+
},
|
|
5171
|
+
"exemptedMembers": {
|
|
5172
|
+
"rule": "repeated",
|
|
5173
|
+
"type": "string",
|
|
5174
|
+
"id": 2
|
|
5175
|
+
}
|
|
5176
|
+
},
|
|
5177
|
+
"nested": {
|
|
5178
|
+
"LogType": {
|
|
5179
|
+
"values": {
|
|
5180
|
+
"LOG_TYPE_UNSPECIFIED": 0,
|
|
5181
|
+
"ADMIN_READ": 1,
|
|
5182
|
+
"DATA_WRITE": 2,
|
|
5183
|
+
"DATA_READ": 3
|
|
5184
|
+
}
|
|
5185
|
+
}
|
|
5186
|
+
}
|
|
5187
|
+
},
|
|
5118
5188
|
"PolicyDelta": {
|
|
5119
5189
|
"fields": {
|
|
5120
5190
|
"bindingDeltas": {
|
package/build/src/backup.d.ts
CHANGED
|
@@ -24,7 +24,11 @@ export declare type CopyBackupCallback = LongRunningCallback<Backup>;
|
|
|
24
24
|
export interface CreateBackupGaxOperation extends GaxOperation {
|
|
25
25
|
metadata: Metadata & databaseAdmin.spanner.admin.database.v1.ICreateBackupMetadata;
|
|
26
26
|
}
|
|
27
|
-
export declare type CreateBackupResponse = [
|
|
27
|
+
export declare type CreateBackupResponse = [
|
|
28
|
+
Backup,
|
|
29
|
+
CreateBackupGaxOperation,
|
|
30
|
+
IOperation
|
|
31
|
+
];
|
|
28
32
|
export interface CreateBackupOptions {
|
|
29
33
|
databasePath: string;
|
|
30
34
|
expireTime: string | number | p.ITimestamp | PreciseDate;
|
package/build/src/backup.js
CHANGED
|
@@ -232,7 +232,7 @@ exports.Backup = Backup;
|
|
|
232
232
|
* All async methods (except for streams) will return a Promise in the event
|
|
233
233
|
* that a callback is omitted.
|
|
234
234
|
*/
|
|
235
|
-
promisify_1.promisifyAll(Backup, {
|
|
235
|
+
(0, promisify_1.promisifyAll)(Backup, {
|
|
236
236
|
exclude: ['getState', 'getExpireTime', 'exists'],
|
|
237
237
|
});
|
|
238
238
|
/*! Developer Documentation
|
|
@@ -240,7 +240,7 @@ promisify_1.promisifyAll(Backup, {
|
|
|
240
240
|
* All async methods (except for streams) will return a Promise in the event
|
|
241
241
|
* that a callback is omitted.
|
|
242
242
|
*/
|
|
243
|
-
promisify_1.callbackifyAll(Backup, {
|
|
243
|
+
(0, promisify_1.callbackifyAll)(Backup, {
|
|
244
244
|
exclude: ['create', 'getMetadata', 'updateExpireTime', 'delete'],
|
|
245
245
|
});
|
|
246
246
|
//# sourceMappingURL=backup.js.map
|
|
@@ -328,7 +328,7 @@ exports.BatchTransaction = BatchTransaction;
|
|
|
328
328
|
* All async methods (except for streams) will return a Promise in the event
|
|
329
329
|
* that a callback is omitted.
|
|
330
330
|
*/
|
|
331
|
-
promisify_1.promisifyAll(BatchTransaction, {
|
|
331
|
+
(0, promisify_1.promisifyAll)(BatchTransaction, {
|
|
332
332
|
exclude: ['identifier'],
|
|
333
333
|
});
|
|
334
334
|
//# sourceMappingURL=batch-transaction.js.map
|
package/build/src/codec.d.ts
CHANGED
package/build/src/codec.js
CHANGED
|
@@ -67,21 +67,15 @@ class SpannerDate extends Date {
|
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* Returns the date in ISO date format.
|
|
70
|
-
* `YYYY-
|
|
70
|
+
* `YYYY-MM-DD`
|
|
71
71
|
*
|
|
72
72
|
* @returns {string}
|
|
73
73
|
*/
|
|
74
74
|
toJSON() {
|
|
75
|
-
const year = this.getFullYear();
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
month = `0${month}`;
|
|
80
|
-
}
|
|
81
|
-
if (date.length === 1) {
|
|
82
|
-
date = `0${date}`;
|
|
83
|
-
}
|
|
84
|
-
return `${year}-${month}-${date}`;
|
|
75
|
+
const year = this.getFullYear().toString();
|
|
76
|
+
const month = (this.getMonth() + 1).toString();
|
|
77
|
+
const date = this.getDate().toString();
|
|
78
|
+
return `${year.padStart(4, '0')}-${month.padStart(2, '0')}-${date.padStart(2, '0')}`;
|
|
85
79
|
}
|
|
86
80
|
}
|
|
87
81
|
exports.SpannerDate = SpannerDate;
|
|
@@ -97,5 +97,5 @@ exports.GrpcServiceObject = GrpcServiceObject;
|
|
|
97
97
|
* All async methods (except for streams) will return a Promise in the event
|
|
98
98
|
* that a callback is omitted.
|
|
99
99
|
*/
|
|
100
|
-
promisify_1.promisifyAll(GrpcServiceObject);
|
|
100
|
+
(0, promisify_1.promisifyAll)(GrpcServiceObject);
|
|
101
101
|
//# sourceMappingURL=service-object.js.map
|
|
@@ -747,7 +747,7 @@ class GrpcService extends common_1.Service {
|
|
|
747
747
|
delete reqOpts.autoPaginate;
|
|
748
748
|
delete reqOpts.autoPaginateVal;
|
|
749
749
|
delete reqOpts.objectMode;
|
|
750
|
-
return projectify_1.replaceProjectIdToken(reqOpts, this.projectId);
|
|
750
|
+
return (0, projectify_1.replaceProjectIdToken)(reqOpts, this.projectId);
|
|
751
751
|
}
|
|
752
752
|
/**
|
|
753
753
|
* To authorize requests through gRPC, we must get the raw google-auth-library
|
|
@@ -780,7 +780,7 @@ class GrpcService extends common_1.Service {
|
|
|
780
780
|
loadProtoFile(protoPath, config) {
|
|
781
781
|
const protoObjectCacheKey = [config.protosDir, protoPath].join('$');
|
|
782
782
|
if (!GrpcService.protoObjectCache[protoObjectCacheKey]) {
|
|
783
|
-
const services = proto_loader_1.loadSync(protoPath, {
|
|
783
|
+
const services = (0, proto_loader_1.loadSync)(protoPath, {
|
|
784
784
|
keepCase: false,
|
|
785
785
|
defaults: true,
|
|
786
786
|
bytes: String,
|
package/build/src/database.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
/// <reference types="node" />
|
|
17
|
+
/// <reference types="node" />
|
|
17
18
|
import { ExistsCallback, GetConfig } from '@google-cloud/common';
|
|
18
19
|
declare const common: any;
|
|
19
20
|
import * as r from 'teeny-request';
|
|
@@ -31,7 +32,10 @@ import { IOperation, LongRunningCallback, NormalCallback, PagedOptionsWithFilter
|
|
|
31
32
|
import { Duplex, Readable } from 'stream';
|
|
32
33
|
import { EnumKey, RequestConfig, TranslateEnumKeys } from '.';
|
|
33
34
|
declare type CreateBatchTransactionCallback = ResourceCallback<BatchTransaction, google.spanner.v1.ITransaction | google.spanner.v1.ISession>;
|
|
34
|
-
declare type CreateBatchTransactionResponse = [
|
|
35
|
+
declare type CreateBatchTransactionResponse = [
|
|
36
|
+
BatchTransaction,
|
|
37
|
+
google.spanner.v1.ITransaction | google.spanner.v1.ISession
|
|
38
|
+
];
|
|
35
39
|
declare type DatabaseResponse = [Database, r.Response];
|
|
36
40
|
declare type DatabaseCallback = ResourceCallback<Database, r.Response>;
|
|
37
41
|
declare type GetSnapshotCallback = NormalCallback<Snapshot>;
|
|
@@ -40,7 +44,10 @@ export interface SessionPoolConstructor {
|
|
|
40
44
|
new (database: Database, options?: SessionPoolOptions | null): SessionPoolInterface;
|
|
41
45
|
}
|
|
42
46
|
export declare type UpdateSchemaCallback = ResourceCallback<GaxOperation, databaseAdmin.longrunning.IOperation>;
|
|
43
|
-
export declare type UpdateSchemaResponse = [
|
|
47
|
+
export declare type UpdateSchemaResponse = [
|
|
48
|
+
GaxOperation,
|
|
49
|
+
databaseAdmin.longrunning.IOperation
|
|
50
|
+
];
|
|
44
51
|
declare type PoolRequestCallback = RequestCallback<Session>;
|
|
45
52
|
export declare type GetSessionsOptions = PagedOptionsWithFilter;
|
|
46
53
|
/**
|
|
@@ -56,14 +63,20 @@ declare type IRestoreInfoTranslatedEnum = TranslateEnumKeys<databaseAdmin.spanne
|
|
|
56
63
|
declare type GetDatabaseMetadataResponse = [IDatabaseTranslatedEnum];
|
|
57
64
|
declare type GetDatabaseMetadataCallback = RequestCallback<IDatabaseTranslatedEnum>;
|
|
58
65
|
declare type GetSchemaCallback = RequestCallback<string, databaseAdmin.spanner.admin.database.v1.IGetDatabaseDdlResponse>;
|
|
59
|
-
declare type GetSchemaResponse = [
|
|
66
|
+
declare type GetSchemaResponse = [
|
|
67
|
+
string[],
|
|
68
|
+
databaseAdmin.spanner.admin.database.v1.IGetDatabaseDdlResponse
|
|
69
|
+
];
|
|
60
70
|
declare type GetSessionsCallback = RequestCallback<Session, google.spanner.v1.IListSessionsResponse>;
|
|
61
71
|
declare type GetSessionsResponse = PagedResponse<Session, google.spanner.v1.IListSessionsResponse>;
|
|
62
72
|
export declare type GetDatabaseConfig = GetConfig & databaseAdmin.spanner.admin.database.v1.IGetDatabaseRequest & {
|
|
63
73
|
gaxOptions?: CallOptions;
|
|
64
74
|
};
|
|
65
75
|
declare type DatabaseCloseResponse = [google.protobuf.IEmpty];
|
|
66
|
-
export declare type CreateSessionResponse = [
|
|
76
|
+
export declare type CreateSessionResponse = [
|
|
77
|
+
Session,
|
|
78
|
+
spannerClient.spanner.v1.ISession
|
|
79
|
+
];
|
|
67
80
|
export interface CreateSessionOptions {
|
|
68
81
|
labels?: {
|
|
69
82
|
[k: string]: string;
|
|
@@ -74,7 +87,10 @@ export declare type CreateSessionCallback = ResourceCallback<Session, spannerCli
|
|
|
74
87
|
export interface BatchCreateSessionsOptions extends CreateSessionOptions {
|
|
75
88
|
count: number;
|
|
76
89
|
}
|
|
77
|
-
export declare type BatchCreateSessionsResponse = [
|
|
90
|
+
export declare type BatchCreateSessionsResponse = [
|
|
91
|
+
Session[],
|
|
92
|
+
spannerClient.spanner.v1.IBatchCreateSessionsResponse
|
|
93
|
+
];
|
|
78
94
|
export declare type BatchCreateSessionsCallback = ResourceCallback<Session[], spannerClient.spanner.v1.IBatchCreateSessionsResponse>;
|
|
79
95
|
export declare type DatabaseDeleteResponse = [databaseAdmin.protobuf.IEmpty];
|
|
80
96
|
export declare type DatabaseDeleteCallback = NormalCallback<databaseAdmin.protobuf.IEmpty>;
|
|
@@ -82,7 +98,11 @@ export interface CancelableDuplex extends Duplex {
|
|
|
82
98
|
cancel(): void;
|
|
83
99
|
}
|
|
84
100
|
export declare type RestoreDatabaseCallback = LongRunningCallback<Database>;
|
|
85
|
-
export declare type RestoreDatabaseResponse = [
|
|
101
|
+
export declare type RestoreDatabaseResponse = [
|
|
102
|
+
Database,
|
|
103
|
+
GaxOperation,
|
|
104
|
+
databaseAdmin.longrunning.IOperation
|
|
105
|
+
];
|
|
86
106
|
export declare type GetRestoreInfoCallback = NormalCallback<IRestoreInfoTranslatedEnum>;
|
|
87
107
|
export declare type GetStateCallback = NormalCallback<EnumKey<typeof databaseAdmin.spanner.admin.database.v1.Database.State>>;
|
|
88
108
|
interface DatabaseRequest {
|
package/build/src/database.js
CHANGED
|
@@ -547,7 +547,7 @@ class Database extends common.GrpcServiceObject {
|
|
|
547
547
|
const snapshot = session.snapshot(options, this.queryOptions_);
|
|
548
548
|
snapshot.begin(err => {
|
|
549
549
|
if (err) {
|
|
550
|
-
if (session_pool_1.isSessionNotFoundError(err)) {
|
|
550
|
+
if ((0, session_pool_1.isSessionNotFoundError)(err)) {
|
|
551
551
|
session.lastError = err;
|
|
552
552
|
this.pool_.release(session);
|
|
553
553
|
this.getSnapshot(options, callback);
|
|
@@ -880,7 +880,7 @@ class Database extends common.GrpcServiceObject {
|
|
|
880
880
|
.once('data', () => (dataReceived = true))
|
|
881
881
|
.once('error', err => {
|
|
882
882
|
if (!dataReceived &&
|
|
883
|
-
session_pool_1.isSessionNotFoundError(err)) {
|
|
883
|
+
(0, session_pool_1.isSessionNotFoundError)(err)) {
|
|
884
884
|
// If it is a 'Session not found' error and we have not yet received
|
|
885
885
|
// any data, we can safely retry the query on a new session.
|
|
886
886
|
// Register the error on the session so the pool can discard it.
|
|
@@ -916,7 +916,7 @@ class Database extends common.GrpcServiceObject {
|
|
|
916
916
|
? optionsOrRunFn
|
|
917
917
|
: {};
|
|
918
918
|
this.pool_.getWriteSession((err, session, transaction) => {
|
|
919
|
-
if (err && session_pool_1.isSessionNotFoundError(err)) {
|
|
919
|
+
if (err && (0, session_pool_1.isSessionNotFoundError)(err)) {
|
|
920
920
|
this.runTransaction(options, runFn);
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
@@ -927,7 +927,7 @@ class Database extends common.GrpcServiceObject {
|
|
|
927
927
|
const release = this.pool_.release.bind(this.pool_, session);
|
|
928
928
|
const runner = new transaction_runner_1.TransactionRunner(session, transaction, runFn, options);
|
|
929
929
|
runner.run().then(release, err => {
|
|
930
|
-
if (session_pool_1.isSessionNotFoundError(err)) {
|
|
930
|
+
if ((0, session_pool_1.isSessionNotFoundError)(err)) {
|
|
931
931
|
release();
|
|
932
932
|
this.runTransaction(options, runFn);
|
|
933
933
|
}
|
|
@@ -1010,7 +1010,7 @@ class Database extends common.GrpcServiceObject {
|
|
|
1010
1010
|
// eslint-disable-next-line no-constant-condition
|
|
1011
1011
|
while (true) {
|
|
1012
1012
|
try {
|
|
1013
|
-
const [session, transaction] = await promisify_1.promisify(getWriteSession)();
|
|
1013
|
+
const [session, transaction] = await (0, promisify_1.promisify)(getWriteSession)();
|
|
1014
1014
|
transaction.requestOptions = Object.assign(transaction.requestOptions || {}, options.requestOptions);
|
|
1015
1015
|
const runner = new transaction_runner_1.AsyncTransactionRunner(session, transaction, runFn, options);
|
|
1016
1016
|
try {
|
|
@@ -1021,7 +1021,7 @@ class Database extends common.GrpcServiceObject {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
1023
|
catch (e) {
|
|
1024
|
-
if (!session_pool_1.isSessionNotFoundError(e)) {
|
|
1024
|
+
if (!(0, session_pool_1.isSessionNotFoundError)(e)) {
|
|
1025
1025
|
throw e;
|
|
1026
1026
|
}
|
|
1027
1027
|
}
|
|
@@ -1121,7 +1121,7 @@ exports.Database = Database;
|
|
|
1121
1121
|
* All async methods (except for streams) will return a Promise in the event
|
|
1122
1122
|
* that a callback is omitted.
|
|
1123
1123
|
*/
|
|
1124
|
-
promisify_1.promisifyAll(Database, {
|
|
1124
|
+
(0, promisify_1.promisifyAll)(Database, {
|
|
1125
1125
|
exclude: [
|
|
1126
1126
|
'batchTransaction',
|
|
1127
1127
|
'getRestoreInfo',
|
|
@@ -1138,7 +1138,7 @@ promisify_1.promisifyAll(Database, {
|
|
|
1138
1138
|
* All async methods (except for streams) will return a Promise in the event
|
|
1139
1139
|
* that a callback is omitted.
|
|
1140
1140
|
*/
|
|
1141
|
-
promisify_1.callbackifyAll(Database, {
|
|
1141
|
+
(0, promisify_1.callbackifyAll)(Database, {
|
|
1142
1142
|
exclude: [
|
|
1143
1143
|
'create',
|
|
1144
1144
|
'batchCreateSessions',
|
package/build/src/index.d.ts
CHANGED
|
@@ -199,7 +199,7 @@ declare class Spanner extends GrpcService {
|
|
|
199
199
|
* Wrapper around {@link v1.InstanceAdminClient#createInstance}.
|
|
200
200
|
*
|
|
201
201
|
* @see {@link v1.InstanceAdminClient#createInstance}
|
|
202
|
-
* @see [
|
|
202
|
+
* @see [CreateInstance API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance)
|
|
203
203
|
*
|
|
204
204
|
* @throws {GoogleError} If a name is not provided.
|
|
205
205
|
* @throws {GoogleError} If a configuration object is not provided.
|
package/build/src/index.js
CHANGED
|
@@ -494,23 +494,23 @@ class Spanner extends service_1.GrpcService {
|
|
|
494
494
|
}
|
|
495
495
|
const gaxClient = this.clients_.get(clientName);
|
|
496
496
|
let reqOpts = extend(true, {}, config.reqOpts);
|
|
497
|
-
reqOpts = projectify_1.replaceProjectIdToken(reqOpts, projectId);
|
|
497
|
+
reqOpts = (0, projectify_1.replaceProjectIdToken)(reqOpts, projectId);
|
|
498
498
|
// It would have been preferable to replace the projectId already in the
|
|
499
499
|
// constructor of Spanner, but that is not possible as auth.getProjectId
|
|
500
500
|
// is an async method. This is therefore the first place where we have
|
|
501
501
|
// access to the value that should be used instead of the placeholder.
|
|
502
502
|
if (!this.projectIdReplaced_) {
|
|
503
|
-
this.projectId = projectify_1.replaceProjectIdToken(this.projectId, projectId);
|
|
504
|
-
this.projectFormattedName_ = projectify_1.replaceProjectIdToken(this.projectFormattedName_, projectId);
|
|
503
|
+
this.projectId = (0, projectify_1.replaceProjectIdToken)(this.projectId, projectId);
|
|
504
|
+
this.projectFormattedName_ = (0, projectify_1.replaceProjectIdToken)(this.projectFormattedName_, projectId);
|
|
505
505
|
this.instances_.forEach(instance => {
|
|
506
|
-
instance.formattedName_ = projectify_1.replaceProjectIdToken(instance.formattedName_, projectId);
|
|
506
|
+
instance.formattedName_ = (0, projectify_1.replaceProjectIdToken)(instance.formattedName_, projectId);
|
|
507
507
|
instance.databases_.forEach(database => {
|
|
508
|
-
database.formattedName_ = projectify_1.replaceProjectIdToken(database.formattedName_, projectId);
|
|
508
|
+
database.formattedName_ = (0, projectify_1.replaceProjectIdToken)(database.formattedName_, projectId);
|
|
509
509
|
});
|
|
510
510
|
});
|
|
511
511
|
this.projectIdReplaced_ = true;
|
|
512
512
|
}
|
|
513
|
-
config.headers[common_1.CLOUD_RESOURCE_HEADER] = projectify_1.replaceProjectIdToken(config.headers[common_1.CLOUD_RESOURCE_HEADER], projectId);
|
|
513
|
+
config.headers[common_1.CLOUD_RESOURCE_HEADER] = (0, projectify_1.replaceProjectIdToken)(config.headers[common_1.CLOUD_RESOURCE_HEADER], projectId);
|
|
514
514
|
const requestFn = gaxClient[config.method].bind(gaxClient, reqOpts,
|
|
515
515
|
// Add headers to `gaxOpts`
|
|
516
516
|
extend(true, {}, config.gaxOpts, {
|
|
@@ -759,7 +759,7 @@ Spanner.GOOGLE_STANDARD_SQL = protos_1.google.spanner.admin.database.v1.Database
|
|
|
759
759
|
* All async methods (except for streams) will return a Promise in the event
|
|
760
760
|
* that a callback is omitted.
|
|
761
761
|
*/
|
|
762
|
-
promisify_1.promisifyAll(Spanner, {
|
|
762
|
+
(0, promisify_1.promisifyAll)(Spanner, {
|
|
763
763
|
exclude: [
|
|
764
764
|
'date',
|
|
765
765
|
'float',
|
package/build/src/instance.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
/// <reference types="node" />
|
|
17
|
+
/// <reference types="node" />
|
|
17
18
|
import { GetConfig } from '@google-cloud/common';
|
|
18
19
|
declare const common: any;
|
|
19
20
|
import { Database, SessionPoolConstructor } from './database';
|
|
@@ -149,7 +150,7 @@ declare class Instance extends common.GrpcServiceObject {
|
|
|
149
150
|
* const {Spanner} = require('@google-cloud/spanner');
|
|
150
151
|
* const spanner = new Spanner();
|
|
151
152
|
* const instance = spanner.instance('my-instance');
|
|
152
|
-
* const backup = instance.
|
|
153
|
+
* const backup = instance.copyBackup('my-source-backup','my-backup',{
|
|
153
154
|
* expireTime: expireTime,
|
|
154
155
|
* encryptionConfig: {
|
|
155
156
|
* encryptionType: 'CUSTOMER_MANAGED_ENCRYPTION',
|
package/build/src/instance.js
CHANGED
|
@@ -170,7 +170,7 @@ class Instance extends common.GrpcServiceObject {
|
|
|
170
170
|
* const {Spanner} = require('@google-cloud/spanner');
|
|
171
171
|
* const spanner = new Spanner();
|
|
172
172
|
* const instance = spanner.instance('my-instance');
|
|
173
|
-
* const backup = instance.
|
|
173
|
+
* const backup = instance.copyBackup('my-source-backup','my-backup',{
|
|
174
174
|
* expireTime: expireTime,
|
|
175
175
|
* encryptionConfig: {
|
|
176
176
|
* encryptionType: 'CUSTOMER_MANAGED_ENCRYPTION',
|
|
@@ -771,7 +771,7 @@ exports.Instance = Instance;
|
|
|
771
771
|
* All async methods (except for streams) will return a Promise in the event
|
|
772
772
|
* that a callback is omitted.
|
|
773
773
|
*/
|
|
774
|
-
promisify_1.promisifyAll(Instance, {
|
|
774
|
+
(0, promisify_1.promisifyAll)(Instance, {
|
|
775
775
|
exclude: ['database', 'backup'],
|
|
776
776
|
});
|
|
777
777
|
//# sourceMappingURL=instance.js.map
|