@google-cloud/spanner 5.17.0 → 5.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.
@@ -1316,6 +1316,22 @@
1316
1316
  "options": {
1317
1317
  "(google.api.field_behavior)": "OUTPUT_ONLY"
1318
1318
  }
1319
+ },
1320
+ "referencingBackups": {
1321
+ "rule": "repeated",
1322
+ "type": "string",
1323
+ "id": 11,
1324
+ "options": {
1325
+ "(google.api.field_behavior)": "OUTPUT_ONLY",
1326
+ "(google.api.resource_reference).type": "spanner.googleapis.com/Backup"
1327
+ }
1328
+ },
1329
+ "maxExpireTime": {
1330
+ "type": "google.protobuf.Timestamp",
1331
+ "id": 12,
1332
+ "options": {
1333
+ "(google.api.field_behavior)": "OUTPUT_ONLY"
1334
+ }
1319
1335
  }
1320
1336
  },
1321
1337
  "nested": {
@@ -1387,6 +1403,73 @@
1387
1403
  }
1388
1404
  }
1389
1405
  },
1406
+ "CopyBackupRequest": {
1407
+ "fields": {
1408
+ "parent": {
1409
+ "type": "string",
1410
+ "id": 1,
1411
+ "options": {
1412
+ "(google.api.field_behavior)": "REQUIRED",
1413
+ "(google.api.resource_reference).type": "spanner.googleapis.com/Instance"
1414
+ }
1415
+ },
1416
+ "backupId": {
1417
+ "type": "string",
1418
+ "id": 2,
1419
+ "options": {
1420
+ "(google.api.field_behavior)": "REQUIRED"
1421
+ }
1422
+ },
1423
+ "sourceBackup": {
1424
+ "type": "string",
1425
+ "id": 3,
1426
+ "options": {
1427
+ "(google.api.field_behavior)": "REQUIRED",
1428
+ "(google.api.resource_reference).type": "spanner.googleapis.com/Backup"
1429
+ }
1430
+ },
1431
+ "expireTime": {
1432
+ "type": "google.protobuf.Timestamp",
1433
+ "id": 4,
1434
+ "options": {
1435
+ "(google.api.field_behavior)": "REQUIRED"
1436
+ }
1437
+ },
1438
+ "encryptionConfig": {
1439
+ "type": "CopyBackupEncryptionConfig",
1440
+ "id": 5,
1441
+ "options": {
1442
+ "(google.api.field_behavior)": "OPTIONAL"
1443
+ }
1444
+ }
1445
+ }
1446
+ },
1447
+ "CopyBackupMetadata": {
1448
+ "fields": {
1449
+ "name": {
1450
+ "type": "string",
1451
+ "id": 1,
1452
+ "options": {
1453
+ "(google.api.resource_reference).type": "spanner.googleapis.com/Backup"
1454
+ }
1455
+ },
1456
+ "sourceBackup": {
1457
+ "type": "string",
1458
+ "id": 2,
1459
+ "options": {
1460
+ "(google.api.resource_reference).type": "spanner.googleapis.com/Backup"
1461
+ }
1462
+ },
1463
+ "progress": {
1464
+ "type": "OperationProgress",
1465
+ "id": 3
1466
+ },
1467
+ "cancelTime": {
1468
+ "type": "google.protobuf.Timestamp",
1469
+ "id": 4
1470
+ }
1471
+ }
1472
+ },
1390
1473
  "UpdateBackupRequest": {
1391
1474
  "fields": {
1392
1475
  "backup": {
@@ -1558,6 +1641,35 @@
1558
1641
  }
1559
1642
  }
1560
1643
  },
1644
+ "CopyBackupEncryptionConfig": {
1645
+ "fields": {
1646
+ "encryptionType": {
1647
+ "type": "EncryptionType",
1648
+ "id": 1,
1649
+ "options": {
1650
+ "(google.api.field_behavior)": "REQUIRED"
1651
+ }
1652
+ },
1653
+ "kmsKeyName": {
1654
+ "type": "string",
1655
+ "id": 2,
1656
+ "options": {
1657
+ "(google.api.field_behavior)": "OPTIONAL",
1658
+ "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey"
1659
+ }
1660
+ }
1661
+ },
1662
+ "nested": {
1663
+ "EncryptionType": {
1664
+ "values": {
1665
+ "ENCRYPTION_TYPE_UNSPECIFIED": 0,
1666
+ "USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION": 1,
1667
+ "GOOGLE_DEFAULT_ENCRYPTION": 2,
1668
+ "CUSTOMER_MANAGED_ENCRYPTION": 3
1669
+ }
1670
+ }
1671
+ }
1672
+ },
1561
1673
  "OperationProgress": {
1562
1674
  "fields": {
1563
1675
  "progressPercent": {
@@ -1867,6 +1979,34 @@
1867
1979
  }
1868
1980
  ]
1869
1981
  },
1982
+ "CopyBackup": {
1983
+ "requestType": "CopyBackupRequest",
1984
+ "responseType": "google.longrunning.Operation",
1985
+ "options": {
1986
+ "(google.api.http).post": "/v1/{parent=projects/*/instances/*}/backups:copy",
1987
+ "(google.api.http).body": "*",
1988
+ "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time",
1989
+ "(google.longrunning.operation_info).response_type": "google.spanner.admin.database.v1.Backup",
1990
+ "(google.longrunning.operation_info).metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata"
1991
+ },
1992
+ "parsedOptions": [
1993
+ {
1994
+ "(google.api.http)": {
1995
+ "post": "/v1/{parent=projects/*/instances/*}/backups:copy",
1996
+ "body": "*"
1997
+ }
1998
+ },
1999
+ {
2000
+ "(google.api.method_signature)": "parent,backup_id,source_backup,expire_time"
2001
+ },
2002
+ {
2003
+ "(google.longrunning.operation_info)": {
2004
+ "response_type": "google.spanner.admin.database.v1.Backup",
2005
+ "metadata_type": "google.spanner.admin.database.v1.CopyBackupMetadata"
2006
+ }
2007
+ }
2008
+ ]
2009
+ },
1870
2010
  "GetBackup": {
1871
2011
  "requestType": "GetBackupRequest",
1872
2012
  "responseType": "Backup",
@@ -4385,93 +4525,6 @@
4385
4525
  "cc_enable_arenas": true
4386
4526
  },
4387
4527
  "nested": {
4388
- "http": {
4389
- "type": "HttpRule",
4390
- "id": 72295728,
4391
- "extend": "google.protobuf.MethodOptions"
4392
- },
4393
- "Http": {
4394
- "fields": {
4395
- "rules": {
4396
- "rule": "repeated",
4397
- "type": "HttpRule",
4398
- "id": 1
4399
- },
4400
- "fullyDecodeReservedExpansion": {
4401
- "type": "bool",
4402
- "id": 2
4403
- }
4404
- }
4405
- },
4406
- "HttpRule": {
4407
- "oneofs": {
4408
- "pattern": {
4409
- "oneof": [
4410
- "get",
4411
- "put",
4412
- "post",
4413
- "delete",
4414
- "patch",
4415
- "custom"
4416
- ]
4417
- }
4418
- },
4419
- "fields": {
4420
- "selector": {
4421
- "type": "string",
4422
- "id": 1
4423
- },
4424
- "get": {
4425
- "type": "string",
4426
- "id": 2
4427
- },
4428
- "put": {
4429
- "type": "string",
4430
- "id": 3
4431
- },
4432
- "post": {
4433
- "type": "string",
4434
- "id": 4
4435
- },
4436
- "delete": {
4437
- "type": "string",
4438
- "id": 5
4439
- },
4440
- "patch": {
4441
- "type": "string",
4442
- "id": 6
4443
- },
4444
- "custom": {
4445
- "type": "CustomHttpPattern",
4446
- "id": 8
4447
- },
4448
- "body": {
4449
- "type": "string",
4450
- "id": 7
4451
- },
4452
- "responseBody": {
4453
- "type": "string",
4454
- "id": 12
4455
- },
4456
- "additionalBindings": {
4457
- "rule": "repeated",
4458
- "type": "HttpRule",
4459
- "id": 11
4460
- }
4461
- }
4462
- },
4463
- "CustomHttpPattern": {
4464
- "fields": {
4465
- "kind": {
4466
- "type": "string",
4467
- "id": 1
4468
- },
4469
- "path": {
4470
- "type": "string",
4471
- "id": 2
4472
- }
4473
- }
4474
- },
4475
4528
  "fieldBehavior": {
4476
4529
  "rule": "repeated",
4477
4530
  "type": "google.api.FieldBehavior",
@@ -4567,6 +4620,93 @@
4567
4620
  }
4568
4621
  }
4569
4622
  },
4623
+ "http": {
4624
+ "type": "HttpRule",
4625
+ "id": 72295728,
4626
+ "extend": "google.protobuf.MethodOptions"
4627
+ },
4628
+ "Http": {
4629
+ "fields": {
4630
+ "rules": {
4631
+ "rule": "repeated",
4632
+ "type": "HttpRule",
4633
+ "id": 1
4634
+ },
4635
+ "fullyDecodeReservedExpansion": {
4636
+ "type": "bool",
4637
+ "id": 2
4638
+ }
4639
+ }
4640
+ },
4641
+ "HttpRule": {
4642
+ "oneofs": {
4643
+ "pattern": {
4644
+ "oneof": [
4645
+ "get",
4646
+ "put",
4647
+ "post",
4648
+ "delete",
4649
+ "patch",
4650
+ "custom"
4651
+ ]
4652
+ }
4653
+ },
4654
+ "fields": {
4655
+ "selector": {
4656
+ "type": "string",
4657
+ "id": 1
4658
+ },
4659
+ "get": {
4660
+ "type": "string",
4661
+ "id": 2
4662
+ },
4663
+ "put": {
4664
+ "type": "string",
4665
+ "id": 3
4666
+ },
4667
+ "post": {
4668
+ "type": "string",
4669
+ "id": 4
4670
+ },
4671
+ "delete": {
4672
+ "type": "string",
4673
+ "id": 5
4674
+ },
4675
+ "patch": {
4676
+ "type": "string",
4677
+ "id": 6
4678
+ },
4679
+ "custom": {
4680
+ "type": "CustomHttpPattern",
4681
+ "id": 8
4682
+ },
4683
+ "body": {
4684
+ "type": "string",
4685
+ "id": 7
4686
+ },
4687
+ "responseBody": {
4688
+ "type": "string",
4689
+ "id": 12
4690
+ },
4691
+ "additionalBindings": {
4692
+ "rule": "repeated",
4693
+ "type": "HttpRule",
4694
+ "id": 11
4695
+ }
4696
+ }
4697
+ },
4698
+ "CustomHttpPattern": {
4699
+ "fields": {
4700
+ "kind": {
4701
+ "type": "string",
4702
+ "id": 1
4703
+ },
4704
+ "path": {
4705
+ "type": "string",
4706
+ "id": 2
4707
+ }
4708
+ }
4709
+ },
4570
4710
  "methodSignature": {
4571
4711
  "rule": "repeated",
4572
4712
  "type": "string",
@@ -20,6 +20,7 @@ import { PreciseDate } from '@google-cloud/precise-date';
20
20
  import { google as databaseAdmin } from '../protos/protos';
21
21
  import { common as p } from 'protobufjs';
22
22
  export declare type CreateBackupCallback = LongRunningCallback<Backup>;
23
+ export declare type CopyBackupCallback = LongRunningCallback<Backup>;
23
24
  export interface CreateBackupGaxOperation extends GaxOperation {
24
25
  metadata: Metadata & databaseAdmin.spanner.admin.database.v1.ICreateBackupMetadata;
25
26
  }
@@ -31,6 +32,13 @@ export interface CreateBackupOptions {
31
32
  encryptionConfig?: databaseAdmin.spanner.admin.database.v1.ICreateBackupEncryptionConfig;
32
33
  gaxOptions?: CallOptions;
33
34
  }
35
+ export interface CopyBackupGaxOperation extends GaxOperation {
36
+ metadata: Metadata & databaseAdmin.spanner.admin.database.v1.ICopyBackupMetadata;
37
+ }
38
+ export declare type CopyBackupResponse = [Backup, CopyBackupGaxOperation, IOperation];
39
+ export interface CopyBackupOptions extends databaseAdmin.spanner.admin.database.v1.ICopyBackupRequest {
40
+ gaxOptions?: CallOptions;
41
+ }
34
42
  /**
35
43
  * IBackup structure with backup state enum translated to string form.
36
44
  */
@@ -49,7 +57,7 @@ export declare type ExistsCallback = NormalCallback<boolean>;
49
57
  /**
50
58
  * The {@link Backup} class represents a Cloud Spanner backup.
51
59
  *
52
- * Create a `Backup` object to interact with or create a Cloud Spanner backup.
60
+ * Create a `Backup` object to interact with or create a Cloud Spanner backup or copy a backup.
53
61
  *
54
62
  * @class
55
63
  *
@@ -60,6 +68,15 @@ export declare type ExistsCallback = NormalCallback<boolean>;
60
68
  * const instance = spanner.instance('my-instance');
61
69
  * const backup = instance.backup('my-backup');
62
70
  * ```
71
+ *
72
+ * ```
73
+ * * @example
74
+ * const {Spanner} = require('@google-cloud/spanner');
75
+ * const spanner = new Spanner();
76
+ * const instance = spanner.instance('my-instance');
77
+ * const sourceBackup = instance.backup('my-source-backup');
78
+ * const copyBackup = instance.copyBackup('my-copy-backup', 'my-source-backup');
79
+ * ```
63
80
  */
64
81
  declare class Backup {
65
82
  id: string;
@@ -70,7 +87,8 @@ declare class Backup {
70
87
  };
71
88
  request: BackupRequest;
72
89
  metadata?: databaseAdmin.spanner.admin.database.v1.IBackup;
73
- constructor(instance: Instance, name: string);
90
+ sourceName: string | undefined;
91
+ constructor(instance: Instance, name: string, sourceName?: string);
74
92
  /**
75
93
  * @typedef {object} CreateBackupOptions
76
94
  * @property {string} databasePath The database path.
@@ -135,8 +153,8 @@ declare class Backup {
135
153
  * await backupOperation.promise();
136
154
  * ```
137
155
  */
138
- create(options: CreateBackupOptions): Promise<CreateBackupResponse>;
139
- create(options: CreateBackupOptions, callback: CreateBackupCallback): void;
156
+ create(options: CreateBackupOptions | CopyBackupOptions): Promise<CreateBackupResponse> | Promise<CopyBackupResponse>;
157
+ create(options: CreateBackupOptions | CopyBackupOptions, callback: CreateBackupCallback | CopyBackupCallback): void;
140
158
  /**
141
159
  * @typedef {array} GetMetadataResponse
142
160
  * @property {object} 0 The {@link Backup} metadata.
@@ -23,7 +23,7 @@ const precise_date_1 = require("@google-cloud/precise-date");
23
23
  /**
24
24
  * The {@link Backup} class represents a Cloud Spanner backup.
25
25
  *
26
- * Create a `Backup` object to interact with or create a Cloud Spanner backup.
26
+ * Create a `Backup` object to interact with or create a Cloud Spanner backup or copy a backup.
27
27
  *
28
28
  * @class
29
29
  *
@@ -34,48 +34,79 @@ const precise_date_1 = require("@google-cloud/precise-date");
34
34
  * const instance = spanner.instance('my-instance');
35
35
  * const backup = instance.backup('my-backup');
36
36
  * ```
37
+ *
38
+ * ```
39
+ * * @example
40
+ * const {Spanner} = require('@google-cloud/spanner');
41
+ * const spanner = new Spanner();
42
+ * const instance = spanner.instance('my-instance');
43
+ * const sourceBackup = instance.backup('my-source-backup');
44
+ * const copyBackup = instance.copyBackup('my-copy-backup', 'my-source-backup');
45
+ * ```
37
46
  */
38
47
  class Backup {
39
- constructor(instance, name) {
48
+ constructor(instance, name, sourceName) {
40
49
  this.request = instance.request;
41
50
  this.instanceFormattedName_ = instance.formattedName_;
42
51
  this.formattedName_ = Backup.formatName_(instance.formattedName_, name);
43
52
  this.id = this.formattedName_.split('/').pop() || '';
53
+ this.sourceName = sourceName;
44
54
  this.resourceHeader_ = {
45
55
  [common_1.CLOUD_RESOURCE_HEADER]: this.instanceFormattedName_,
46
56
  };
47
57
  }
48
58
  create(options, callback) {
49
59
  const gaxOpts = options.gaxOptions;
50
- const reqOpts = {
51
- parent: this.instanceFormattedName_,
52
- backupId: this.id,
53
- backup: {
54
- database: options.databasePath,
55
- expireTime: _1.Spanner.timestamp(options.expireTime).toStruct(),
56
- name: this.formattedName_,
57
- },
58
- };
59
- if ('versionTime' in options) {
60
- reqOpts.backup.versionTime = _1.Spanner.timestamp(options.versionTime).toStruct();
60
+ if ('databasePath' in options) {
61
+ const reqOpts = {
62
+ parent: this.instanceFormattedName_,
63
+ backupId: this.id,
64
+ backup: {
65
+ database: options.databasePath,
66
+ expireTime: _1.Spanner.timestamp(options.expireTime).toStruct(),
67
+ name: this.formattedName_,
68
+ },
69
+ };
70
+ if ('versionTime' in options) {
71
+ reqOpts.backup.versionTime = _1.Spanner.timestamp(options.versionTime).toStruct();
72
+ }
73
+ if ('encryptionConfig' in options &&
74
+ options.encryptionConfig) {
75
+ reqOpts.encryptionConfig = options.encryptionConfig;
76
+ }
77
+ this.request({
78
+ client: 'DatabaseAdminClient',
79
+ method: 'createBackup',
80
+ reqOpts,
81
+ gaxOpts,
82
+ headers: this.resourceHeader_,
83
+ }, (err, operation, resp) => {
84
+ if (err) {
85
+ callback(err, null, null, resp);
86
+ return;
87
+ }
88
+ callback(null, this, operation, resp);
89
+ });
61
90
  }
62
- if ('encryptionConfig' in options &&
63
- options.encryptionConfig) {
64
- reqOpts.encryptionConfig = options.encryptionConfig;
91
+ else if (this.sourceName) {
92
+ delete options.gaxOptions;
93
+ options.backupId = this.id;
94
+ options.parent = this.instanceFormattedName_;
95
+ options.sourceBackup = this.sourceName;
96
+ this.request({
97
+ client: 'DatabaseAdminClient',
98
+ method: 'copyBackup',
99
+ reqOpts: options,
100
+ gaxOpts,
101
+ headers: this.resourceHeader_,
102
+ }, (err, operation, resp) => {
103
+ if (err) {
104
+ callback(err, null, null, resp);
105
+ return;
106
+ }
107
+ callback(null, this, operation, resp);
108
+ });
65
109
  }
66
- this.request({
67
- client: 'DatabaseAdminClient',
68
- method: 'createBackup',
69
- reqOpts,
70
- gaxOpts,
71
- headers: this.resourceHeader_,
72
- }, (err, operation, resp) => {
73
- if (err) {
74
- callback(err, null, null, resp);
75
- return;
76
- }
77
- callback(null, this, operation, resp);
78
- });
79
110
  }
80
111
  getMetadata(gaxOptionsOrCallback, cb) {
81
112
  const callback = typeof gaxOptionsOrCallback === 'function'
@@ -120,6 +120,16 @@ export declare class Numeric {
120
120
  valueOf(): Big;
121
121
  toJSON(): string;
122
122
  }
123
+ /**
124
+ * @typedef PGNumeric
125
+ * @see Spanner.pgNumeric
126
+ */
127
+ export declare class PGNumeric {
128
+ value: string;
129
+ constructor(pgValue: string | number);
130
+ valueOf(): Big;
131
+ toJSON(): string;
132
+ }
123
133
  /**
124
134
  * @typedef JSONOptions
125
135
  * @property {boolean} [wrapNumbers=false] Indicates if the numbers should be
@@ -257,6 +267,7 @@ export declare const codec: {
257
267
  Float: typeof Float;
258
268
  Int: typeof Int;
259
269
  Numeric: typeof Numeric;
270
+ PGNumeric: typeof PGNumeric;
260
271
  convertFieldsToJson: typeof convertFieldsToJson;
261
272
  decode: typeof decode;
262
273
  encode: typeof encode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.codec = exports.Numeric = exports.Struct = exports.Int = exports.Float = exports.SpannerDate = void 0;
3
+ exports.codec = exports.PGNumeric = exports.Numeric = exports.Struct = exports.Int = exports.Float = exports.SpannerDate = void 0;
4
4
  /*!
5
5
  * Copyright 2017 Google Inc. All Rights Reserved.
6
6
  *
@@ -182,6 +182,25 @@ class Numeric {
182
182
  }
183
183
  }
184
184
  exports.Numeric = Numeric;
185
+ /**
186
+ * @typedef PGNumeric
187
+ * @see Spanner.pgNumeric
188
+ */
189
+ class PGNumeric {
190
+ constructor(pgValue) {
191
+ this.value = pgValue.toString();
192
+ }
193
+ valueOf() {
194
+ if (this.value.toLowerCase() === 'nan') {
195
+ throw new Error(`${this.value} cannot be converted to a numeric value`);
196
+ }
197
+ return new big_js_1.Big(this.value);
198
+ }
199
+ toJSON() {
200
+ return this.valueOf().toJSON();
201
+ }
202
+ }
203
+ exports.PGNumeric = PGNumeric;
185
204
  /**
186
205
  * @typedef JSONOptions
187
206
  * @property {boolean} [wrapNumbers=false] Indicates if the numbers should be
@@ -287,6 +306,12 @@ function decode(value, type) {
287
306
  break;
288
307
  case protos_1.google.spanner.v1.TypeCode.NUMERIC:
289
308
  case 'NUMERIC':
309
+ if (type.typeAnnotation ===
310
+ protos_1.google.spanner.v1.TypeAnnotationCode.PG_NUMERIC ||
311
+ type.typeAnnotation === 'PG_NUMERIC') {
312
+ decoded = new PGNumeric(decoded);
313
+ break;
314
+ }
290
315
  decoded = new Numeric(decoded);
291
316
  break;
292
317
  case protos_1.google.spanner.v1.TypeCode.TIMESTAMP:
@@ -354,6 +379,9 @@ function encodeValue(value) {
354
379
  if (value instanceof Numeric) {
355
380
  return value.value;
356
381
  }
382
+ if (value instanceof PGNumeric) {
383
+ return value.value;
384
+ }
357
385
  if (Buffer.isBuffer(value)) {
358
386
  return value.toString('base64');
359
387
  }
@@ -380,6 +408,7 @@ const TypeCode = {
380
408
  int64: 'INT64',
381
409
  float64: 'FLOAT64',
382
410
  numeric: 'NUMERIC',
411
+ pgNumeric: 'NUMERIC',
383
412
  timestamp: 'TIMESTAMP',
384
413
  date: 'DATE',
385
414
  string: 'STRING',
@@ -436,6 +465,9 @@ function getType(value) {
436
465
  if (value instanceof Numeric) {
437
466
  return { type: 'numeric' };
438
467
  }
468
+ if (value instanceof PGNumeric) {
469
+ return { type: 'pgNumeric' };
470
+ }
439
471
  if (is.boolean(value)) {
440
472
  return { type: 'bool' };
441
473
  }
@@ -528,7 +560,7 @@ function createTypeObject(friendlyType) {
528
560
  if (!friendlyType) {
529
561
  friendlyType = 'unspecified';
530
562
  }
531
- if (is.string(friendlyType)) {
563
+ if (typeof friendlyType === 'string') {
532
564
  friendlyType = { type: friendlyType };
533
565
  }
534
566
  const config = friendlyType;
@@ -546,6 +578,10 @@ function createTypeObject(friendlyType) {
546
578
  }),
547
579
  };
548
580
  }
581
+ if (friendlyType.type === 'pgNumeric') {
582
+ type.typeAnnotation =
583
+ protos_1.google.spanner.v1.TypeAnnotationCode.PG_NUMERIC;
584
+ }
549
585
  return type;
550
586
  }
551
587
  exports.codec = {
@@ -557,6 +593,7 @@ exports.codec = {
557
593
  Float,
558
594
  Int,
559
595
  Numeric,
596
+ PGNumeric,
560
597
  convertFieldsToJson,
561
598
  decode,
562
599
  encode,