@google-cloud/spanner 7.17.0 → 7.18.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 (81) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +1 -1
  3. package/build/protos/google/spanner/admin/database/v1/backup.proto +0 -757
  4. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +0 -230
  5. package/build/protos/google/spanner/admin/database/v1/common.proto +0 -132
  6. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +0 -1209
  7. package/build/protos/google/spanner/admin/instance/v1/common.proto +0 -63
  8. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +0 -1983
  9. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +0 -1520
  10. package/build/protos/google/spanner/v1/commit_response.proto +0 -59
  11. package/build/protos/google/spanner/v1/keys.proto +0 -163
  12. package/build/protos/google/spanner/v1/mutation.proto +0 -107
  13. package/build/protos/google/spanner/v1/query_plan.proto +0 -128
  14. package/build/protos/google/spanner/v1/result_set.proto +0 -237
  15. package/build/protos/google/spanner/v1/spanner.proto +0 -1389
  16. package/build/protos/google/spanner/v1/transaction.proto +0 -575
  17. package/build/protos/google/spanner/v1/type.proto +0 -210
  18. package/build/protos/protos.d.ts +0 -38999
  19. package/build/protos/protos.js +0 -99538
  20. package/build/protos/protos.json +0 -10182
  21. package/build/src/backup.d.ts +0 -349
  22. package/build/src/backup.js +0 -246
  23. package/build/src/batch-transaction.d.ts +0 -247
  24. package/build/src/batch-transaction.js +0 -384
  25. package/build/src/codec.d.ts +0 -362
  26. package/build/src/codec.js +0 -791
  27. package/build/src/common-grpc/service-object.d.ts +0 -80
  28. package/build/src/common-grpc/service-object.js +0 -101
  29. package/build/src/common-grpc/service.d.ts +0 -445
  30. package/build/src/common-grpc/service.js +0 -826
  31. package/build/src/common.d.ts +0 -66
  32. package/build/src/common.js +0 -54
  33. package/build/src/database.d.ts +0 -2104
  34. package/build/src/database.js +0 -1655
  35. package/build/src/extra_proto_list.json +0 -1
  36. package/build/src/helper.d.ts +0 -45
  37. package/build/src/helper.js +0 -71
  38. package/build/src/index.d.ts +0 -1195
  39. package/build/src/index.js +0 -1060
  40. package/build/src/instance-config.d.ts +0 -295
  41. package/build/src/instance-config.js +0 -216
  42. package/build/src/instance.d.ts +0 -833
  43. package/build/src/instance.js +0 -781
  44. package/build/src/instrument.d.ts +0 -87
  45. package/build/src/instrument.js +0 -217
  46. package/build/src/multiplexed-session.d.ts +0 -136
  47. package/build/src/multiplexed-session.js +0 -197
  48. package/build/src/partial-result-stream.d.ts +0 -253
  49. package/build/src/partial-result-stream.js +0 -400
  50. package/build/src/session-factory.d.ts +0 -101
  51. package/build/src/session-factory.js +0 -93
  52. package/build/src/session-pool.d.ts +0 -471
  53. package/build/src/session-pool.js +0 -754
  54. package/build/src/session.d.ts +0 -259
  55. package/build/src/session.js +0 -348
  56. package/build/src/spanner_grpc_config.json +0 -92
  57. package/build/src/table.d.ts +0 -831
  58. package/build/src/table.js +0 -277
  59. package/build/src/transaction-runner.d.ts +0 -185
  60. package/build/src/transaction-runner.js +0 -282
  61. package/build/src/transaction.d.ts +0 -1691
  62. package/build/src/transaction.js +0 -2004
  63. package/build/src/v1/database_admin_client.d.ts +0 -2301
  64. package/build/src/v1/database_admin_client.js +0 -2286
  65. package/build/src/v1/database_admin_client_config.json +0 -160
  66. package/build/src/v1/database_admin_proto_list.json +0 -6
  67. package/build/src/v1/gapic_metadata.json +0 -27
  68. package/build/src/v1/index.d.ts +0 -4
  69. package/build/src/v1/index.js +0 -29
  70. package/build/src/v1/instance_admin_client.d.ts +0 -1982
  71. package/build/src/v1/instance_admin_client.js +0 -1766
  72. package/build/src/v1/instance_admin_client_config.json +0 -129
  73. package/build/src/v1/instance_admin_proto_list.json +0 -4
  74. package/build/src/v1/spanner_client.d.ts +0 -1250
  75. package/build/src/v1/spanner_client.js +0 -1086
  76. package/build/src/v1/spanner_client_config.json +0 -119
  77. package/build/src/v1/spanner_executor_proxy_client.d.ts +0 -418
  78. package/build/src/v1/spanner_executor_proxy_client.js +0 -706
  79. package/build/src/v1/spanner_executor_proxy_client_config.json +0 -30
  80. package/build/src/v1/spanner_executor_proxy_proto_list.json +0 -14
  81. package/build/src/v1/spanner_proto_list.json +0 -10
@@ -1,362 +0,0 @@
1
- import { Big } from 'big.js';
2
- import { common as p } from 'protobufjs';
3
- import { google as spannerClient } from '../protos/protos';
4
- export type Value = any;
5
- export interface Field {
6
- name: string;
7
- value: Value;
8
- }
9
- export interface IProtoMessageParams {
10
- value: object;
11
- fullName: string;
12
- /**
13
- * Provide a First Class function that includes nested functions named
14
- * "encode" for serialization and "decode" for deserialization of the proto
15
- * message. The function should be sourced from the JS file generated by
16
- * protobufjs-cli for the proto message.
17
- */
18
- messageFunction?: Function;
19
- }
20
- export interface IProtoEnumParams {
21
- value: string | number;
22
- fullName: string;
23
- /**
24
- * An object containing enum string to id mapping.
25
- * @example: { POP: 0, JAZZ: 1, FOLK: 2, ROCK: 3 }
26
- *
27
- * The object should be sourced from the JS file generated by
28
- * protobufjs-cli for the proto message. Additionally, please review the
29
- * sample at {@link www.samples.com} for guidance.
30
- *
31
- * ToDo: Update the link
32
- */
33
- enumObject?: object;
34
- }
35
- export interface Json {
36
- [field: string]: Value;
37
- }
38
- export interface JSONOptions {
39
- wrapNumbers?: boolean;
40
- wrapStructs?: boolean;
41
- includeNameless?: boolean;
42
- }
43
- /**
44
- * Date-like object used to represent Cloud Spanner Dates. DATE types represent
45
- * a logical calendar date, independent of time zone. DATE values do not
46
- * represent a specific 24-hour period. Rather, a given DATE value represents a
47
- * different 24-hour period when interpreted in a different time zone. Because
48
- * of this, all values passed to {@link Spanner.date} will be interpreted as
49
- * local time.
50
- *
51
- * To represent an absolute point in time, use {@link Spanner.timestamp}.
52
- *
53
- * @see Spanner.date
54
- * @see https://cloud.google.com/spanner/docs/data-types#date-type
55
- *
56
- * @class
57
- * @extends Date
58
- *
59
- * @param {string|number} [date] String representing the date or number
60
- * representing the year. If year is a number between 0 and 99, then year is
61
- * assumed to be 1900 + year.
62
- * @param {number} [month] Number representing the month (0 = January).
63
- * @param {number} [date] Number representing the date.
64
- *
65
- * @example
66
- * ```
67
- * Spanner.date('3-3-1933');
68
- * ```
69
- */
70
- export declare class SpannerDate extends Date {
71
- constructor(dateString?: string);
72
- constructor(year: number, month: number, date: number);
73
- /**
74
- * Returns the date in ISO date format.
75
- * `YYYY-MM-DD`
76
- *
77
- * @returns {string}
78
- */
79
- toJSON(): string;
80
- }
81
- /**
82
- * Using an abstract class to simplify checking for wrapped numbers.
83
- *
84
- * @private
85
- */
86
- declare abstract class WrappedNumber {
87
- value: string | number;
88
- abstract valueOf(): number;
89
- }
90
- /**
91
- * @typedef Float32
92
- * @see Spanner.float32
93
- */
94
- export declare class Float32 extends WrappedNumber {
95
- value: number;
96
- constructor(value: number);
97
- valueOf(): number;
98
- }
99
- /**
100
- * @typedef Float
101
- * @see Spanner.float
102
- */
103
- export declare class Float extends WrappedNumber {
104
- value: number;
105
- constructor(value: number);
106
- valueOf(): number;
107
- }
108
- /**
109
- * @typedef Int
110
- * @see Spanner.int
111
- */
112
- export declare class Int extends WrappedNumber {
113
- value: string;
114
- constructor(value: string);
115
- valueOf(): number;
116
- }
117
- /**
118
- * @typedef Struct
119
- * @see Spanner.struct
120
- */
121
- export declare class Struct extends Array<Field> {
122
- /**
123
- * Converts struct into a pojo (plain old JavaScript object).
124
- *
125
- * @param {JSONOptions} [options] JSON options.
126
- * @returns {object}
127
- */
128
- toJSON(options?: JSONOptions): Json;
129
- /**
130
- * Converts an array of fields to a struct.
131
- *
132
- * @private
133
- *
134
- * @param {object[]} fields List of struct fields.
135
- * @return {Struct}
136
- */
137
- static fromArray(fields: Field[]): Struct;
138
- /**
139
- * Converts a JSON object to a struct.
140
- *
141
- * @private
142
- *
143
- * @param {object} json Struct JSON.
144
- * @return {Struct}
145
- */
146
- static fromJSON(json: Json): Struct;
147
- }
148
- /**
149
- * @typedef Numeric
150
- * @see Spanner.numeric
151
- */
152
- export declare class Numeric {
153
- value: string;
154
- constructor(value: string);
155
- valueOf(): Big;
156
- toJSON(): string;
157
- }
158
- /**
159
- * @typedef PGNumeric
160
- * @see Spanner.pgNumeric
161
- */
162
- export declare class PGNumeric {
163
- value: string;
164
- constructor(pgValue: string | number);
165
- valueOf(): Big;
166
- toJSON(): string;
167
- }
168
- /**
169
- * @typedef ProtoMessage
170
- * @see Spanner.protoMessage
171
- */
172
- export declare class ProtoMessage {
173
- value: Buffer;
174
- fullName: string;
175
- messageFunction?: Function;
176
- constructor(protoMessageParams: IProtoMessageParams);
177
- toJSON(): string;
178
- }
179
- /**
180
- * @typedef ProtoEnum
181
- * @see Spanner.protoEnum
182
- */
183
- export declare class ProtoEnum {
184
- value: string;
185
- fullName: string;
186
- enumObject?: object;
187
- constructor(protoEnumParams: IProtoEnumParams);
188
- toJSON(): string;
189
- }
190
- /**
191
- * @typedef PGJsonb
192
- * @see Spanner.pgJsonb
193
- */
194
- export declare class PGJsonb {
195
- value: object;
196
- constructor(pgValue: object | string);
197
- toString(): string;
198
- }
199
- /**
200
- * @typedef PGOid
201
- * @see Spanner.pgOid
202
- */
203
- export declare class PGOid extends WrappedNumber {
204
- value: string;
205
- constructor(value: string);
206
- valueOf(): number;
207
- }
208
- /**
209
- * @typedef JSONOptions
210
- * @property {boolean} [wrapNumbers=false] Indicates if the numbers should be
211
- * wrapped in Int/Float wrappers.
212
- * @property {boolean} [wrapStructs=false] Indicates if the structs should be
213
- * wrapped in Struct wrapper.
214
- * @property {boolean} [includeNameless=false] Indicates if nameless columns
215
- * should be included in the result. If true, nameless columns will be
216
- * assigned the name '_{column_index}'.
217
- */
218
- /**
219
- * Wherever a row or struct object is returned, it is assigned a "toJSON"
220
- * function. This function will generate the JSON for that row.
221
- *
222
- * @private
223
- *
224
- * @param {array} row The row to generate JSON for.
225
- * @param {JSONOptions} [options] JSON options.
226
- * @returns {object}
227
- */
228
- declare function convertFieldsToJson(fields: Field[], options?: JSONOptions): Json;
229
- /**
230
- * Re-decode after the generic gRPC decoding step.
231
- *
232
- * @private
233
- *
234
- * @param {*} value Value to decode
235
- * @param {object[]} type Value type object.
236
- * @param columnMetadata Optional parameter to deserialize data
237
- * @returns {*}
238
- */
239
- declare function decode(value: Value, type: spannerClient.spanner.v1.Type, columnMetadata?: object): Value;
240
- /**
241
- * Encode a value in the format the API expects.
242
- *
243
- * @private
244
- *
245
- * @param {*} value The value to be encoded.
246
- * @returns {object} google.protobuf.Value
247
- */
248
- declare function encode(value: Value): p.IValue;
249
- /**
250
- * Conveniece Type object that simplifies specifying the data type, the array
251
- * child type and/or struct fields.
252
- *
253
- * @private
254
- */
255
- export interface Type {
256
- type: string;
257
- fields?: FieldType[];
258
- child?: Type;
259
- fullName?: string;
260
- }
261
- interface FieldType extends Type {
262
- name: string;
263
- }
264
- /**
265
- * @typedef {ParamType} StructField
266
- * @property {string} name The name of the field.
267
- */
268
- /**
269
- * @typedef {object} ParamType
270
- * @property {string} type The param type. Must be one of the following:
271
- * - float32
272
- * - float64
273
- * - int64
274
- * - numeric
275
- * - bool
276
- * - string
277
- * - bytes
278
- * - json
279
- * - proto
280
- * - enum
281
- * - timestamp
282
- * - date
283
- * - struct
284
- * - array
285
- * @property {StructField[]} [fields] **For struct types only**. Type
286
- * definitions for the individual fields.
287
- * @property {string|ParamType} [child] **For array types only**. The array
288
- * element type.
289
- */
290
- /**
291
- * Get the corresponding Spanner data type for the provided value.
292
- *
293
- * @private
294
- *
295
- * @param {*} value - The value.
296
- * @returns {object}
297
- *
298
- * @example
299
- * ```
300
- * codec.getType(NaN);
301
- * // {type: 'float64'}
302
- * ```
303
- */
304
- declare function getType(value: Value): Type;
305
- /**
306
- * Converts a value to google.protobuf.ListValue
307
- *
308
- * @private
309
- *
310
- * @param {*} value The value to convert.
311
- * @returns {object}
312
- */
313
- declare function convertToListValue<T>(value: T): p.IListValue;
314
- /**
315
- * Converts milliseconds to google.protobuf.Timestamp
316
- *
317
- * @private
318
- *
319
- * @param {number} ms The milliseconds to convert.
320
- * @returns {object}
321
- */
322
- declare function convertMsToProtoTimestamp(ms: number): spannerClient.protobuf.ITimestamp;
323
- /**
324
- * Converts google.protobuf.Timestamp to Date object.
325
- *
326
- * @private
327
- *
328
- * @param {object} timestamp The protobuf timestamp.
329
- * @returns {Date}
330
- */
331
- declare function convertProtoTimestampToDate({ nanos, seconds, }: p.ITimestamp): Date;
332
- /**
333
- * Encodes paramTypes into correct structure.
334
- *
335
- * @private
336
- *
337
- * @param {object|string} [config='unspecified'] Type config.
338
- * @return {object}
339
- */
340
- declare function createTypeObject(friendlyType?: string | Type): spannerClient.spanner.v1.Type;
341
- export declare const codec: {
342
- convertToListValue: typeof convertToListValue;
343
- convertMsToProtoTimestamp: typeof convertMsToProtoTimestamp;
344
- convertProtoTimestampToDate: typeof convertProtoTimestampToDate;
345
- createTypeObject: typeof createTypeObject;
346
- SpannerDate: typeof SpannerDate;
347
- Float32: typeof Float32;
348
- Float: typeof Float;
349
- Int: typeof Int;
350
- Numeric: typeof Numeric;
351
- PGNumeric: typeof PGNumeric;
352
- PGJsonb: typeof PGJsonb;
353
- ProtoMessage: typeof ProtoMessage;
354
- ProtoEnum: typeof ProtoEnum;
355
- PGOid: typeof PGOid;
356
- convertFieldsToJson: typeof convertFieldsToJson;
357
- decode: typeof decode;
358
- encode: typeof encode;
359
- getType: typeof getType;
360
- Struct: typeof Struct;
361
- };
362
- export {};