@databricks/sdk-postgres 0.1.0-dev.2 → 0.1.0-dev.4

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/dist/v1/client.js CHANGED
@@ -1,10 +1,9 @@
1
1
  // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
2
  import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
3
- import { retryOn } from '@databricks/sdk-core/api';
4
3
  import { createDefault } from '@databricks/sdk-core/clientinfo';
5
4
  import { NoOpLogger } from '@databricks/sdk-core/logger';
6
5
  import { newHttpClient } from './transport';
7
- import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
6
+ import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, executeWait, StillRunningError, } from './utils';
8
7
  import pkgJson from '../../package.json' with { type: 'json' };
9
8
  import { z } from 'zod';
10
9
  import { marshalBranchSchema, marshalCatalogSchema, marshalDatabaseSchema, marshalEndpointSchema, marshalGenerateDatabaseCredentialRequestSchema, marshalProjectSchema, marshalRoleSchema, marshalSyncedTableSchema, marshalUndeleteBranchRequestSchema, marshalUndeleteProjectRequestSchema, unmarshalBranchOperationMetadataSchema, unmarshalBranchSchema, unmarshalCatalogOperationMetadataSchema, unmarshalCatalogSchema, unmarshalDatabaseCredentialSchema, unmarshalDatabaseOperationMetadataSchema, unmarshalDatabaseSchema, unmarshalEndpointOperationMetadataSchema, unmarshalEndpointSchema, unmarshalListBranchesResponseSchema, unmarshalListDatabasesResponseSchema, unmarshalListEndpointsResponseSchema, unmarshalListProjectsResponseSchema, unmarshalListRolesResponseSchema, unmarshalOperationSchema, unmarshalProjectOperationMetadataSchema, unmarshalProjectSchema, unmarshalRoleOperationMetadataSchema, unmarshalRoleSchema, unmarshalSyncedTableOperationMetadataSchema, unmarshalSyncedTableSchema, } from './model';
@@ -69,7 +68,7 @@ export class PostgresClient {
69
68
  };
70
69
  await executeCall(call, options);
71
70
  if (resp === undefined) {
72
- throw new Error('API call completed without a result.');
71
+ throw new Error('operation completed without a result.');
73
72
  }
74
73
  return resp;
75
74
  }
@@ -104,7 +103,7 @@ export class PostgresClient {
104
103
  };
105
104
  await executeCall(call, options);
106
105
  if (resp === undefined) {
107
- throw new Error('API call completed without a result.');
106
+ throw new Error('operation completed without a result.');
108
107
  }
109
108
  return resp;
110
109
  }
@@ -143,7 +142,7 @@ export class PostgresClient {
143
142
  };
144
143
  await executeCall(call, options);
145
144
  if (resp === undefined) {
146
- throw new Error('API call completed without a result.');
145
+ throw new Error('operation completed without a result.');
147
146
  }
148
147
  return resp;
149
148
  }
@@ -181,7 +180,7 @@ export class PostgresClient {
181
180
  };
182
181
  await executeCall(call, options);
183
182
  if (resp === undefined) {
184
- throw new Error('API call completed without a result.');
183
+ throw new Error('operation completed without a result.');
185
184
  }
186
185
  return resp;
187
186
  }
@@ -216,7 +215,7 @@ export class PostgresClient {
216
215
  };
217
216
  await executeCall(call, options);
218
217
  if (resp === undefined) {
219
- throw new Error('API call completed without a result.');
218
+ throw new Error('operation completed without a result.');
220
219
  }
221
220
  return resp;
222
221
  }
@@ -251,7 +250,7 @@ export class PostgresClient {
251
250
  };
252
251
  await executeCall(call, options);
253
252
  if (resp === undefined) {
254
- throw new Error('API call completed without a result.');
253
+ throw new Error('operation completed without a result.');
255
254
  }
256
255
  return resp;
257
256
  }
@@ -286,7 +285,7 @@ export class PostgresClient {
286
285
  };
287
286
  await executeCall(call, options);
288
287
  if (resp === undefined) {
289
- throw new Error('API call completed without a result.');
288
+ throw new Error('operation completed without a result.');
290
289
  }
291
290
  return resp;
292
291
  }
@@ -320,7 +319,7 @@ export class PostgresClient {
320
319
  };
321
320
  await executeCall(call, options);
322
321
  if (resp === undefined) {
323
- throw new Error('API call completed without a result.');
322
+ throw new Error('operation completed without a result.');
324
323
  }
325
324
  return resp;
326
325
  }
@@ -348,7 +347,7 @@ export class PostgresClient {
348
347
  };
349
348
  await executeCall(call, options);
350
349
  if (resp === undefined) {
351
- throw new Error('API call completed without a result.');
350
+ throw new Error('operation completed without a result.');
352
351
  }
353
352
  return resp;
354
353
  }
@@ -376,7 +375,7 @@ export class PostgresClient {
376
375
  };
377
376
  await executeCall(call, options);
378
377
  if (resp === undefined) {
379
- throw new Error('API call completed without a result.');
378
+ throw new Error('operation completed without a result.');
380
379
  }
381
380
  return resp;
382
381
  }
@@ -404,7 +403,7 @@ export class PostgresClient {
404
403
  };
405
404
  await executeCall(call, options);
406
405
  if (resp === undefined) {
407
- throw new Error('API call completed without a result.');
406
+ throw new Error('operation completed without a result.');
408
407
  }
409
408
  return resp;
410
409
  }
@@ -438,7 +437,7 @@ export class PostgresClient {
438
437
  };
439
438
  await executeCall(call, options);
440
439
  if (resp === undefined) {
441
- throw new Error('API call completed without a result.');
440
+ throw new Error('operation completed without a result.');
442
441
  }
443
442
  return resp;
444
443
  }
@@ -472,7 +471,7 @@ export class PostgresClient {
472
471
  };
473
472
  await executeCall(call, options);
474
473
  if (resp === undefined) {
475
- throw new Error('API call completed without a result.');
474
+ throw new Error('operation completed without a result.');
476
475
  }
477
476
  return resp;
478
477
  }
@@ -500,7 +499,7 @@ export class PostgresClient {
500
499
  };
501
500
  await executeCall(call, options);
502
501
  if (resp === undefined) {
503
- throw new Error('API call completed without a result.');
502
+ throw new Error('operation completed without a result.');
504
503
  }
505
504
  return resp;
506
505
  }
@@ -529,7 +528,7 @@ export class PostgresClient {
529
528
  };
530
529
  await executeCall(call, options);
531
530
  if (resp === undefined) {
532
- throw new Error('API call completed without a result.');
531
+ throw new Error('operation completed without a result.');
533
532
  }
534
533
  return resp;
535
534
  }
@@ -553,7 +552,7 @@ export class PostgresClient {
553
552
  };
554
553
  await executeCall(call, options);
555
554
  if (resp === undefined) {
556
- throw new Error('API call completed without a result.');
555
+ throw new Error('operation completed without a result.');
557
556
  }
558
557
  return resp;
559
558
  }
@@ -577,7 +576,7 @@ export class PostgresClient {
577
576
  };
578
577
  await executeCall(call, options);
579
578
  if (resp === undefined) {
580
- throw new Error('API call completed without a result.');
579
+ throw new Error('operation completed without a result.');
581
580
  }
582
581
  return resp;
583
582
  }
@@ -601,7 +600,7 @@ export class PostgresClient {
601
600
  };
602
601
  await executeCall(call, options);
603
602
  if (resp === undefined) {
604
- throw new Error('API call completed without a result.');
603
+ throw new Error('operation completed without a result.');
605
604
  }
606
605
  return resp;
607
606
  }
@@ -625,7 +624,7 @@ export class PostgresClient {
625
624
  };
626
625
  await executeCall(call, options);
627
626
  if (resp === undefined) {
628
- throw new Error('API call completed without a result.');
627
+ throw new Error('operation completed without a result.');
629
628
  }
630
629
  return resp;
631
630
  }
@@ -649,7 +648,7 @@ export class PostgresClient {
649
648
  };
650
649
  await executeCall(call, options);
651
650
  if (resp === undefined) {
652
- throw new Error('API call completed without a result.');
651
+ throw new Error('operation completed without a result.');
653
652
  }
654
653
  return resp;
655
654
  }
@@ -673,7 +672,7 @@ export class PostgresClient {
673
672
  };
674
673
  await executeCall(call, options);
675
674
  if (resp === undefined) {
676
- throw new Error('API call completed without a result.');
675
+ throw new Error('operation completed without a result.');
677
676
  }
678
677
  return resp;
679
678
  }
@@ -697,7 +696,7 @@ export class PostgresClient {
697
696
  };
698
697
  await executeCall(call, options);
699
698
  if (resp === undefined) {
700
- throw new Error('API call completed without a result.');
699
+ throw new Error('operation completed without a result.');
701
700
  }
702
701
  return resp;
703
702
  }
@@ -721,7 +720,7 @@ export class PostgresClient {
721
720
  };
722
721
  await executeCall(call, options);
723
722
  if (resp === undefined) {
724
- throw new Error('API call completed without a result.');
723
+ throw new Error('operation completed without a result.');
725
724
  }
726
725
  return resp;
727
726
  }
@@ -757,7 +756,7 @@ export class PostgresClient {
757
756
  };
758
757
  await executeCall(call, options);
759
758
  if (resp === undefined) {
760
- throw new Error('API call completed without a result.');
759
+ throw new Error('operation completed without a result.');
761
760
  }
762
761
  return resp;
763
762
  }
@@ -803,7 +802,7 @@ export class PostgresClient {
803
802
  };
804
803
  await executeCall(call, options);
805
804
  if (resp === undefined) {
806
- throw new Error('API call completed without a result.');
805
+ throw new Error('operation completed without a result.');
807
806
  }
808
807
  return resp;
809
808
  }
@@ -849,7 +848,7 @@ export class PostgresClient {
849
848
  };
850
849
  await executeCall(call, options);
851
850
  if (resp === undefined) {
852
- throw new Error('API call completed without a result.');
851
+ throw new Error('operation completed without a result.');
853
852
  }
854
853
  return resp;
855
854
  }
@@ -898,7 +897,7 @@ export class PostgresClient {
898
897
  };
899
898
  await executeCall(call, options);
900
899
  if (resp === undefined) {
901
- throw new Error('API call completed without a result.');
900
+ throw new Error('operation completed without a result.');
902
901
  }
903
902
  return resp;
904
903
  }
@@ -944,7 +943,7 @@ export class PostgresClient {
944
943
  };
945
944
  await executeCall(call, options);
946
945
  if (resp === undefined) {
947
- throw new Error('API call completed without a result.');
946
+ throw new Error('operation completed without a result.');
948
947
  }
949
948
  return resp;
950
949
  }
@@ -982,7 +981,7 @@ export class PostgresClient {
982
981
  };
983
982
  await executeCall(call, options);
984
983
  if (resp === undefined) {
985
- throw new Error('API call completed without a result.');
984
+ throw new Error('operation completed without a result.');
986
985
  }
987
986
  return resp;
988
987
  }
@@ -1011,7 +1010,7 @@ export class PostgresClient {
1011
1010
  };
1012
1011
  await executeCall(call, options);
1013
1012
  if (resp === undefined) {
1014
- throw new Error('API call completed without a result.');
1013
+ throw new Error('operation completed without a result.');
1015
1014
  }
1016
1015
  return resp;
1017
1016
  }
@@ -1046,7 +1045,7 @@ export class PostgresClient {
1046
1045
  };
1047
1046
  await executeCall(call, options);
1048
1047
  if (resp === undefined) {
1049
- throw new Error('API call completed without a result.');
1048
+ throw new Error('operation completed without a result.');
1050
1049
  }
1051
1050
  return resp;
1052
1051
  }
@@ -1081,7 +1080,7 @@ export class PostgresClient {
1081
1080
  };
1082
1081
  await executeCall(call, options);
1083
1082
  if (resp === undefined) {
1084
- throw new Error('API call completed without a result.');
1083
+ throw new Error('operation completed without a result.');
1085
1084
  }
1086
1085
  return resp;
1087
1086
  }
@@ -1116,7 +1115,7 @@ export class PostgresClient {
1116
1115
  };
1117
1116
  await executeCall(call, options);
1118
1117
  if (resp === undefined) {
1119
- throw new Error('API call completed without a result.');
1118
+ throw new Error('operation completed without a result.');
1120
1119
  }
1121
1120
  return resp;
1122
1121
  }
@@ -1151,7 +1150,7 @@ export class PostgresClient {
1151
1150
  };
1152
1151
  await executeCall(call, options);
1153
1152
  if (resp === undefined) {
1154
- throw new Error('API call completed without a result.');
1153
+ throw new Error('operation completed without a result.');
1155
1154
  }
1156
1155
  return resp;
1157
1156
  }
@@ -1186,7 +1185,7 @@ export class PostgresClient {
1186
1185
  };
1187
1186
  await executeCall(call, options);
1188
1187
  if (resp === undefined) {
1189
- throw new Error('API call completed without a result.');
1188
+ throw new Error('operation completed without a result.');
1190
1189
  }
1191
1190
  return resp;
1192
1191
  }
@@ -1221,18 +1220,17 @@ export class CreateBranchOperation {
1221
1220
  * Throws if the operation failed.
1222
1221
  */
1223
1222
  async wait(options) {
1224
- const errStillRunning = new Error('operation still in progress');
1225
1223
  let result;
1226
1224
  const call = async (callSignal) => {
1227
1225
  const op = await this.client.getOperation({
1228
1226
  name: this.operation.name,
1229
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1227
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1230
1228
  this.operation = op;
1231
1229
  if (op.done === undefined) {
1232
1230
  throw new Error('operation is missing the done field');
1233
1231
  }
1234
1232
  if (!op.done) {
1235
- throw errStillRunning;
1233
+ throw new StillRunningError();
1236
1234
  }
1237
1235
  if (op.result?.$case === 'error') {
1238
1236
  const err = op.result.error;
@@ -1249,15 +1247,9 @@ export class CreateBranchOperation {
1249
1247
  }
1250
1248
  result = z.lazy(() => unmarshalBranchSchema).parse(op.result.response);
1251
1249
  };
1252
- const retryOptions = {
1253
- ...(options?.signal !== undefined && { signal: options.signal }),
1254
- retrier: () => retryOn({}, (err) => {
1255
- return err.message.includes('operation still in progress');
1256
- }),
1257
- };
1258
- await executeCall(call, retryOptions);
1250
+ await executeWait(call, options);
1259
1251
  if (result === undefined) {
1260
- throw new Error('API call completed without a result.');
1252
+ throw new Error('operation completed without a result.');
1261
1253
  }
1262
1254
  return result;
1263
1255
  }
@@ -1294,18 +1286,17 @@ export class CreateCatalogOperation {
1294
1286
  * Throws if the operation failed.
1295
1287
  */
1296
1288
  async wait(options) {
1297
- const errStillRunning = new Error('operation still in progress');
1298
1289
  let result;
1299
1290
  const call = async (callSignal) => {
1300
1291
  const op = await this.client.getOperation({
1301
1292
  name: this.operation.name,
1302
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1293
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1303
1294
  this.operation = op;
1304
1295
  if (op.done === undefined) {
1305
1296
  throw new Error('operation is missing the done field');
1306
1297
  }
1307
1298
  if (!op.done) {
1308
- throw errStillRunning;
1299
+ throw new StillRunningError();
1309
1300
  }
1310
1301
  if (op.result?.$case === 'error') {
1311
1302
  const err = op.result.error;
@@ -1322,15 +1313,9 @@ export class CreateCatalogOperation {
1322
1313
  }
1323
1314
  result = z.lazy(() => unmarshalCatalogSchema).parse(op.result.response);
1324
1315
  };
1325
- const retryOptions = {
1326
- ...(options?.signal !== undefined && { signal: options.signal }),
1327
- retrier: () => retryOn({}, (err) => {
1328
- return err.message.includes('operation still in progress');
1329
- }),
1330
- };
1331
- await executeCall(call, retryOptions);
1316
+ await executeWait(call, options);
1332
1317
  if (result === undefined) {
1333
- throw new Error('API call completed without a result.');
1318
+ throw new Error('operation completed without a result.');
1334
1319
  }
1335
1320
  return result;
1336
1321
  }
@@ -1367,18 +1352,17 @@ export class CreateDatabaseOperation {
1367
1352
  * Throws if the operation failed.
1368
1353
  */
1369
1354
  async wait(options) {
1370
- const errStillRunning = new Error('operation still in progress');
1371
1355
  let result;
1372
1356
  const call = async (callSignal) => {
1373
1357
  const op = await this.client.getOperation({
1374
1358
  name: this.operation.name,
1375
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1359
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1376
1360
  this.operation = op;
1377
1361
  if (op.done === undefined) {
1378
1362
  throw new Error('operation is missing the done field');
1379
1363
  }
1380
1364
  if (!op.done) {
1381
- throw errStillRunning;
1365
+ throw new StillRunningError();
1382
1366
  }
1383
1367
  if (op.result?.$case === 'error') {
1384
1368
  const err = op.result.error;
@@ -1395,15 +1379,9 @@ export class CreateDatabaseOperation {
1395
1379
  }
1396
1380
  result = z.lazy(() => unmarshalDatabaseSchema).parse(op.result.response);
1397
1381
  };
1398
- const retryOptions = {
1399
- ...(options?.signal !== undefined && { signal: options.signal }),
1400
- retrier: () => retryOn({}, (err) => {
1401
- return err.message.includes('operation still in progress');
1402
- }),
1403
- };
1404
- await executeCall(call, retryOptions);
1382
+ await executeWait(call, options);
1405
1383
  if (result === undefined) {
1406
- throw new Error('API call completed without a result.');
1384
+ throw new Error('operation completed without a result.');
1407
1385
  }
1408
1386
  return result;
1409
1387
  }
@@ -1440,18 +1418,17 @@ export class CreateEndpointOperation {
1440
1418
  * Throws if the operation failed.
1441
1419
  */
1442
1420
  async wait(options) {
1443
- const errStillRunning = new Error('operation still in progress');
1444
1421
  let result;
1445
1422
  const call = async (callSignal) => {
1446
1423
  const op = await this.client.getOperation({
1447
1424
  name: this.operation.name,
1448
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1425
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1449
1426
  this.operation = op;
1450
1427
  if (op.done === undefined) {
1451
1428
  throw new Error('operation is missing the done field');
1452
1429
  }
1453
1430
  if (!op.done) {
1454
- throw errStillRunning;
1431
+ throw new StillRunningError();
1455
1432
  }
1456
1433
  if (op.result?.$case === 'error') {
1457
1434
  const err = op.result.error;
@@ -1468,15 +1445,9 @@ export class CreateEndpointOperation {
1468
1445
  }
1469
1446
  result = z.lazy(() => unmarshalEndpointSchema).parse(op.result.response);
1470
1447
  };
1471
- const retryOptions = {
1472
- ...(options?.signal !== undefined && { signal: options.signal }),
1473
- retrier: () => retryOn({}, (err) => {
1474
- return err.message.includes('operation still in progress');
1475
- }),
1476
- };
1477
- await executeCall(call, retryOptions);
1448
+ await executeWait(call, options);
1478
1449
  if (result === undefined) {
1479
- throw new Error('API call completed without a result.');
1450
+ throw new Error('operation completed without a result.');
1480
1451
  }
1481
1452
  return result;
1482
1453
  }
@@ -1513,18 +1484,17 @@ export class CreateProjectOperation {
1513
1484
  * Throws if the operation failed.
1514
1485
  */
1515
1486
  async wait(options) {
1516
- const errStillRunning = new Error('operation still in progress');
1517
1487
  let result;
1518
1488
  const call = async (callSignal) => {
1519
1489
  const op = await this.client.getOperation({
1520
1490
  name: this.operation.name,
1521
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1491
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1522
1492
  this.operation = op;
1523
1493
  if (op.done === undefined) {
1524
1494
  throw new Error('operation is missing the done field');
1525
1495
  }
1526
1496
  if (!op.done) {
1527
- throw errStillRunning;
1497
+ throw new StillRunningError();
1528
1498
  }
1529
1499
  if (op.result?.$case === 'error') {
1530
1500
  const err = op.result.error;
@@ -1541,15 +1511,9 @@ export class CreateProjectOperation {
1541
1511
  }
1542
1512
  result = z.lazy(() => unmarshalProjectSchema).parse(op.result.response);
1543
1513
  };
1544
- const retryOptions = {
1545
- ...(options?.signal !== undefined && { signal: options.signal }),
1546
- retrier: () => retryOn({}, (err) => {
1547
- return err.message.includes('operation still in progress');
1548
- }),
1549
- };
1550
- await executeCall(call, retryOptions);
1514
+ await executeWait(call, options);
1551
1515
  if (result === undefined) {
1552
- throw new Error('API call completed without a result.');
1516
+ throw new Error('operation completed without a result.');
1553
1517
  }
1554
1518
  return result;
1555
1519
  }
@@ -1586,18 +1550,17 @@ export class CreateRoleOperation {
1586
1550
  * Throws if the operation failed.
1587
1551
  */
1588
1552
  async wait(options) {
1589
- const errStillRunning = new Error('operation still in progress');
1590
1553
  let result;
1591
1554
  const call = async (callSignal) => {
1592
1555
  const op = await this.client.getOperation({
1593
1556
  name: this.operation.name,
1594
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1557
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1595
1558
  this.operation = op;
1596
1559
  if (op.done === undefined) {
1597
1560
  throw new Error('operation is missing the done field');
1598
1561
  }
1599
1562
  if (!op.done) {
1600
- throw errStillRunning;
1563
+ throw new StillRunningError();
1601
1564
  }
1602
1565
  if (op.result?.$case === 'error') {
1603
1566
  const err = op.result.error;
@@ -1614,15 +1577,9 @@ export class CreateRoleOperation {
1614
1577
  }
1615
1578
  result = z.lazy(() => unmarshalRoleSchema).parse(op.result.response);
1616
1579
  };
1617
- const retryOptions = {
1618
- ...(options?.signal !== undefined && { signal: options.signal }),
1619
- retrier: () => retryOn({}, (err) => {
1620
- return err.message.includes('operation still in progress');
1621
- }),
1622
- };
1623
- await executeCall(call, retryOptions);
1580
+ await executeWait(call, options);
1624
1581
  if (result === undefined) {
1625
- throw new Error('API call completed without a result.');
1582
+ throw new Error('operation completed without a result.');
1626
1583
  }
1627
1584
  return result;
1628
1585
  }
@@ -1659,18 +1616,17 @@ export class CreateSyncedTableOperation {
1659
1616
  * Throws if the operation failed.
1660
1617
  */
1661
1618
  async wait(options) {
1662
- const errStillRunning = new Error('operation still in progress');
1663
1619
  let result;
1664
1620
  const call = async (callSignal) => {
1665
1621
  const op = await this.client.getOperation({
1666
1622
  name: this.operation.name,
1667
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1623
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1668
1624
  this.operation = op;
1669
1625
  if (op.done === undefined) {
1670
1626
  throw new Error('operation is missing the done field');
1671
1627
  }
1672
1628
  if (!op.done) {
1673
- throw errStillRunning;
1629
+ throw new StillRunningError();
1674
1630
  }
1675
1631
  if (op.result?.$case === 'error') {
1676
1632
  const err = op.result.error;
@@ -1689,15 +1645,9 @@ export class CreateSyncedTableOperation {
1689
1645
  .lazy(() => unmarshalSyncedTableSchema)
1690
1646
  .parse(op.result.response);
1691
1647
  };
1692
- const retryOptions = {
1693
- ...(options?.signal !== undefined && { signal: options.signal }),
1694
- retrier: () => retryOn({}, (err) => {
1695
- return err.message.includes('operation still in progress');
1696
- }),
1697
- };
1698
- await executeCall(call, retryOptions);
1648
+ await executeWait(call, options);
1699
1649
  if (result === undefined) {
1700
- throw new Error('API call completed without a result.');
1650
+ throw new Error('operation completed without a result.');
1701
1651
  }
1702
1652
  return result;
1703
1653
  }
@@ -1734,17 +1684,16 @@ export class DeleteBranchOperation {
1734
1684
  * Throws if the operation failed.
1735
1685
  */
1736
1686
  async wait(options) {
1737
- const errStillRunning = new Error('operation still in progress');
1738
1687
  const call = async (callSignal) => {
1739
1688
  const op = await this.client.getOperation({
1740
1689
  name: this.operation.name,
1741
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1690
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1742
1691
  this.operation = op;
1743
1692
  if (op.done === undefined) {
1744
1693
  throw new Error('operation is missing the done field');
1745
1694
  }
1746
1695
  if (!op.done) {
1747
- throw errStillRunning;
1696
+ throw new StillRunningError();
1748
1697
  }
1749
1698
  if (op.result?.$case === 'error') {
1750
1699
  const err = op.result.error;
@@ -1757,13 +1706,7 @@ export class DeleteBranchOperation {
1757
1706
  });
1758
1707
  }
1759
1708
  };
1760
- const retryOptions = {
1761
- ...(options?.signal !== undefined && { signal: options.signal }),
1762
- retrier: () => retryOn({}, (err) => {
1763
- return err.message.includes('operation still in progress');
1764
- }),
1765
- };
1766
- await executeCall(call, retryOptions);
1709
+ await executeWait(call, options);
1767
1710
  }
1768
1711
  /** Checks whether the operation has completed */
1769
1712
  async done(options) {
@@ -1798,17 +1741,16 @@ export class DeleteCatalogOperation {
1798
1741
  * Throws if the operation failed.
1799
1742
  */
1800
1743
  async wait(options) {
1801
- const errStillRunning = new Error('operation still in progress');
1802
1744
  const call = async (callSignal) => {
1803
1745
  const op = await this.client.getOperation({
1804
1746
  name: this.operation.name,
1805
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1747
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1806
1748
  this.operation = op;
1807
1749
  if (op.done === undefined) {
1808
1750
  throw new Error('operation is missing the done field');
1809
1751
  }
1810
1752
  if (!op.done) {
1811
- throw errStillRunning;
1753
+ throw new StillRunningError();
1812
1754
  }
1813
1755
  if (op.result?.$case === 'error') {
1814
1756
  const err = op.result.error;
@@ -1821,13 +1763,7 @@ export class DeleteCatalogOperation {
1821
1763
  });
1822
1764
  }
1823
1765
  };
1824
- const retryOptions = {
1825
- ...(options?.signal !== undefined && { signal: options.signal }),
1826
- retrier: () => retryOn({}, (err) => {
1827
- return err.message.includes('operation still in progress');
1828
- }),
1829
- };
1830
- await executeCall(call, retryOptions);
1766
+ await executeWait(call, options);
1831
1767
  }
1832
1768
  /** Checks whether the operation has completed */
1833
1769
  async done(options) {
@@ -1862,17 +1798,16 @@ export class DeleteDatabaseOperation {
1862
1798
  * Throws if the operation failed.
1863
1799
  */
1864
1800
  async wait(options) {
1865
- const errStillRunning = new Error('operation still in progress');
1866
1801
  const call = async (callSignal) => {
1867
1802
  const op = await this.client.getOperation({
1868
1803
  name: this.operation.name,
1869
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1804
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1870
1805
  this.operation = op;
1871
1806
  if (op.done === undefined) {
1872
1807
  throw new Error('operation is missing the done field');
1873
1808
  }
1874
1809
  if (!op.done) {
1875
- throw errStillRunning;
1810
+ throw new StillRunningError();
1876
1811
  }
1877
1812
  if (op.result?.$case === 'error') {
1878
1813
  const err = op.result.error;
@@ -1885,13 +1820,7 @@ export class DeleteDatabaseOperation {
1885
1820
  });
1886
1821
  }
1887
1822
  };
1888
- const retryOptions = {
1889
- ...(options?.signal !== undefined && { signal: options.signal }),
1890
- retrier: () => retryOn({}, (err) => {
1891
- return err.message.includes('operation still in progress');
1892
- }),
1893
- };
1894
- await executeCall(call, retryOptions);
1823
+ await executeWait(call, options);
1895
1824
  }
1896
1825
  /** Checks whether the operation has completed */
1897
1826
  async done(options) {
@@ -1926,17 +1855,16 @@ export class DeleteEndpointOperation {
1926
1855
  * Throws if the operation failed.
1927
1856
  */
1928
1857
  async wait(options) {
1929
- const errStillRunning = new Error('operation still in progress');
1930
1858
  const call = async (callSignal) => {
1931
1859
  const op = await this.client.getOperation({
1932
1860
  name: this.operation.name,
1933
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1861
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1934
1862
  this.operation = op;
1935
1863
  if (op.done === undefined) {
1936
1864
  throw new Error('operation is missing the done field');
1937
1865
  }
1938
1866
  if (!op.done) {
1939
- throw errStillRunning;
1867
+ throw new StillRunningError();
1940
1868
  }
1941
1869
  if (op.result?.$case === 'error') {
1942
1870
  const err = op.result.error;
@@ -1949,13 +1877,7 @@ export class DeleteEndpointOperation {
1949
1877
  });
1950
1878
  }
1951
1879
  };
1952
- const retryOptions = {
1953
- ...(options?.signal !== undefined && { signal: options.signal }),
1954
- retrier: () => retryOn({}, (err) => {
1955
- return err.message.includes('operation still in progress');
1956
- }),
1957
- };
1958
- await executeCall(call, retryOptions);
1880
+ await executeWait(call, options);
1959
1881
  }
1960
1882
  /** Checks whether the operation has completed */
1961
1883
  async done(options) {
@@ -1990,17 +1912,16 @@ export class DeleteProjectOperation {
1990
1912
  * Throws if the operation failed.
1991
1913
  */
1992
1914
  async wait(options) {
1993
- const errStillRunning = new Error('operation still in progress');
1994
1915
  const call = async (callSignal) => {
1995
1916
  const op = await this.client.getOperation({
1996
1917
  name: this.operation.name,
1997
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1918
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
1998
1919
  this.operation = op;
1999
1920
  if (op.done === undefined) {
2000
1921
  throw new Error('operation is missing the done field');
2001
1922
  }
2002
1923
  if (!op.done) {
2003
- throw errStillRunning;
1924
+ throw new StillRunningError();
2004
1925
  }
2005
1926
  if (op.result?.$case === 'error') {
2006
1927
  const err = op.result.error;
@@ -2013,13 +1934,7 @@ export class DeleteProjectOperation {
2013
1934
  });
2014
1935
  }
2015
1936
  };
2016
- const retryOptions = {
2017
- ...(options?.signal !== undefined && { signal: options.signal }),
2018
- retrier: () => retryOn({}, (err) => {
2019
- return err.message.includes('operation still in progress');
2020
- }),
2021
- };
2022
- await executeCall(call, retryOptions);
1937
+ await executeWait(call, options);
2023
1938
  }
2024
1939
  /** Checks whether the operation has completed */
2025
1940
  async done(options) {
@@ -2054,17 +1969,16 @@ export class DeleteRoleOperation {
2054
1969
  * Throws if the operation failed.
2055
1970
  */
2056
1971
  async wait(options) {
2057
- const errStillRunning = new Error('operation still in progress');
2058
1972
  const call = async (callSignal) => {
2059
1973
  const op = await this.client.getOperation({
2060
1974
  name: this.operation.name,
2061
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
1975
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
2062
1976
  this.operation = op;
2063
1977
  if (op.done === undefined) {
2064
1978
  throw new Error('operation is missing the done field');
2065
1979
  }
2066
1980
  if (!op.done) {
2067
- throw errStillRunning;
1981
+ throw new StillRunningError();
2068
1982
  }
2069
1983
  if (op.result?.$case === 'error') {
2070
1984
  const err = op.result.error;
@@ -2077,13 +1991,7 @@ export class DeleteRoleOperation {
2077
1991
  });
2078
1992
  }
2079
1993
  };
2080
- const retryOptions = {
2081
- ...(options?.signal !== undefined && { signal: options.signal }),
2082
- retrier: () => retryOn({}, (err) => {
2083
- return err.message.includes('operation still in progress');
2084
- }),
2085
- };
2086
- await executeCall(call, retryOptions);
1994
+ await executeWait(call, options);
2087
1995
  }
2088
1996
  /** Checks whether the operation has completed */
2089
1997
  async done(options) {
@@ -2118,17 +2026,16 @@ export class DeleteSyncedTableOperation {
2118
2026
  * Throws if the operation failed.
2119
2027
  */
2120
2028
  async wait(options) {
2121
- const errStillRunning = new Error('operation still in progress');
2122
2029
  const call = async (callSignal) => {
2123
2030
  const op = await this.client.getOperation({
2124
2031
  name: this.operation.name,
2125
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
2032
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
2126
2033
  this.operation = op;
2127
2034
  if (op.done === undefined) {
2128
2035
  throw new Error('operation is missing the done field');
2129
2036
  }
2130
2037
  if (!op.done) {
2131
- throw errStillRunning;
2038
+ throw new StillRunningError();
2132
2039
  }
2133
2040
  if (op.result?.$case === 'error') {
2134
2041
  const err = op.result.error;
@@ -2141,13 +2048,7 @@ export class DeleteSyncedTableOperation {
2141
2048
  });
2142
2049
  }
2143
2050
  };
2144
- const retryOptions = {
2145
- ...(options?.signal !== undefined && { signal: options.signal }),
2146
- retrier: () => retryOn({}, (err) => {
2147
- return err.message.includes('operation still in progress');
2148
- }),
2149
- };
2150
- await executeCall(call, retryOptions);
2051
+ await executeWait(call, options);
2151
2052
  }
2152
2053
  /** Checks whether the operation has completed */
2153
2054
  async done(options) {
@@ -2182,17 +2083,16 @@ export class UndeleteBranchOperation {
2182
2083
  * Throws if the operation failed.
2183
2084
  */
2184
2085
  async wait(options) {
2185
- const errStillRunning = new Error('operation still in progress');
2186
2086
  const call = async (callSignal) => {
2187
2087
  const op = await this.client.getOperation({
2188
2088
  name: this.operation.name,
2189
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
2089
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
2190
2090
  this.operation = op;
2191
2091
  if (op.done === undefined) {
2192
2092
  throw new Error('operation is missing the done field');
2193
2093
  }
2194
2094
  if (!op.done) {
2195
- throw errStillRunning;
2095
+ throw new StillRunningError();
2196
2096
  }
2197
2097
  if (op.result?.$case === 'error') {
2198
2098
  const err = op.result.error;
@@ -2205,13 +2105,7 @@ export class UndeleteBranchOperation {
2205
2105
  });
2206
2106
  }
2207
2107
  };
2208
- const retryOptions = {
2209
- ...(options?.signal !== undefined && { signal: options.signal }),
2210
- retrier: () => retryOn({}, (err) => {
2211
- return err.message.includes('operation still in progress');
2212
- }),
2213
- };
2214
- await executeCall(call, retryOptions);
2108
+ await executeWait(call, options);
2215
2109
  }
2216
2110
  /** Checks whether the operation has completed */
2217
2111
  async done(options) {
@@ -2246,17 +2140,16 @@ export class UndeleteProjectOperation {
2246
2140
  * Throws if the operation failed.
2247
2141
  */
2248
2142
  async wait(options) {
2249
- const errStillRunning = new Error('operation still in progress');
2250
2143
  const call = async (callSignal) => {
2251
2144
  const op = await this.client.getOperation({
2252
2145
  name: this.operation.name,
2253
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
2146
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
2254
2147
  this.operation = op;
2255
2148
  if (op.done === undefined) {
2256
2149
  throw new Error('operation is missing the done field');
2257
2150
  }
2258
2151
  if (!op.done) {
2259
- throw errStillRunning;
2152
+ throw new StillRunningError();
2260
2153
  }
2261
2154
  if (op.result?.$case === 'error') {
2262
2155
  const err = op.result.error;
@@ -2269,13 +2162,7 @@ export class UndeleteProjectOperation {
2269
2162
  });
2270
2163
  }
2271
2164
  };
2272
- const retryOptions = {
2273
- ...(options?.signal !== undefined && { signal: options.signal }),
2274
- retrier: () => retryOn({}, (err) => {
2275
- return err.message.includes('operation still in progress');
2276
- }),
2277
- };
2278
- await executeCall(call, retryOptions);
2165
+ await executeWait(call, options);
2279
2166
  }
2280
2167
  /** Checks whether the operation has completed */
2281
2168
  async done(options) {
@@ -2310,18 +2197,17 @@ export class UpdateBranchOperation {
2310
2197
  * Throws if the operation failed.
2311
2198
  */
2312
2199
  async wait(options) {
2313
- const errStillRunning = new Error('operation still in progress');
2314
2200
  let result;
2315
2201
  const call = async (callSignal) => {
2316
2202
  const op = await this.client.getOperation({
2317
2203
  name: this.operation.name,
2318
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
2204
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
2319
2205
  this.operation = op;
2320
2206
  if (op.done === undefined) {
2321
2207
  throw new Error('operation is missing the done field');
2322
2208
  }
2323
2209
  if (!op.done) {
2324
- throw errStillRunning;
2210
+ throw new StillRunningError();
2325
2211
  }
2326
2212
  if (op.result?.$case === 'error') {
2327
2213
  const err = op.result.error;
@@ -2338,15 +2224,9 @@ export class UpdateBranchOperation {
2338
2224
  }
2339
2225
  result = z.lazy(() => unmarshalBranchSchema).parse(op.result.response);
2340
2226
  };
2341
- const retryOptions = {
2342
- ...(options?.signal !== undefined && { signal: options.signal }),
2343
- retrier: () => retryOn({}, (err) => {
2344
- return err.message.includes('operation still in progress');
2345
- }),
2346
- };
2347
- await executeCall(call, retryOptions);
2227
+ await executeWait(call, options);
2348
2228
  if (result === undefined) {
2349
- throw new Error('API call completed without a result.');
2229
+ throw new Error('operation completed without a result.');
2350
2230
  }
2351
2231
  return result;
2352
2232
  }
@@ -2383,18 +2263,17 @@ export class UpdateDatabaseOperation {
2383
2263
  * Throws if the operation failed.
2384
2264
  */
2385
2265
  async wait(options) {
2386
- const errStillRunning = new Error('operation still in progress');
2387
2266
  let result;
2388
2267
  const call = async (callSignal) => {
2389
2268
  const op = await this.client.getOperation({
2390
2269
  name: this.operation.name,
2391
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
2270
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
2392
2271
  this.operation = op;
2393
2272
  if (op.done === undefined) {
2394
2273
  throw new Error('operation is missing the done field');
2395
2274
  }
2396
2275
  if (!op.done) {
2397
- throw errStillRunning;
2276
+ throw new StillRunningError();
2398
2277
  }
2399
2278
  if (op.result?.$case === 'error') {
2400
2279
  const err = op.result.error;
@@ -2411,15 +2290,9 @@ export class UpdateDatabaseOperation {
2411
2290
  }
2412
2291
  result = z.lazy(() => unmarshalDatabaseSchema).parse(op.result.response);
2413
2292
  };
2414
- const retryOptions = {
2415
- ...(options?.signal !== undefined && { signal: options.signal }),
2416
- retrier: () => retryOn({}, (err) => {
2417
- return err.message.includes('operation still in progress');
2418
- }),
2419
- };
2420
- await executeCall(call, retryOptions);
2293
+ await executeWait(call, options);
2421
2294
  if (result === undefined) {
2422
- throw new Error('API call completed without a result.');
2295
+ throw new Error('operation completed without a result.');
2423
2296
  }
2424
2297
  return result;
2425
2298
  }
@@ -2456,18 +2329,17 @@ export class UpdateEndpointOperation {
2456
2329
  * Throws if the operation failed.
2457
2330
  */
2458
2331
  async wait(options) {
2459
- const errStillRunning = new Error('operation still in progress');
2460
2332
  let result;
2461
2333
  const call = async (callSignal) => {
2462
2334
  const op = await this.client.getOperation({
2463
2335
  name: this.operation.name,
2464
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
2336
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
2465
2337
  this.operation = op;
2466
2338
  if (op.done === undefined) {
2467
2339
  throw new Error('operation is missing the done field');
2468
2340
  }
2469
2341
  if (!op.done) {
2470
- throw errStillRunning;
2342
+ throw new StillRunningError();
2471
2343
  }
2472
2344
  if (op.result?.$case === 'error') {
2473
2345
  const err = op.result.error;
@@ -2484,15 +2356,9 @@ export class UpdateEndpointOperation {
2484
2356
  }
2485
2357
  result = z.lazy(() => unmarshalEndpointSchema).parse(op.result.response);
2486
2358
  };
2487
- const retryOptions = {
2488
- ...(options?.signal !== undefined && { signal: options.signal }),
2489
- retrier: () => retryOn({}, (err) => {
2490
- return err.message.includes('operation still in progress');
2491
- }),
2492
- };
2493
- await executeCall(call, retryOptions);
2359
+ await executeWait(call, options);
2494
2360
  if (result === undefined) {
2495
- throw new Error('API call completed without a result.');
2361
+ throw new Error('operation completed without a result.');
2496
2362
  }
2497
2363
  return result;
2498
2364
  }
@@ -2529,18 +2395,17 @@ export class UpdateProjectOperation {
2529
2395
  * Throws if the operation failed.
2530
2396
  */
2531
2397
  async wait(options) {
2532
- const errStillRunning = new Error('operation still in progress');
2533
2398
  let result;
2534
2399
  const call = async (callSignal) => {
2535
2400
  const op = await this.client.getOperation({
2536
2401
  name: this.operation.name,
2537
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
2402
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
2538
2403
  this.operation = op;
2539
2404
  if (op.done === undefined) {
2540
2405
  throw new Error('operation is missing the done field');
2541
2406
  }
2542
2407
  if (!op.done) {
2543
- throw errStillRunning;
2408
+ throw new StillRunningError();
2544
2409
  }
2545
2410
  if (op.result?.$case === 'error') {
2546
2411
  const err = op.result.error;
@@ -2557,15 +2422,9 @@ export class UpdateProjectOperation {
2557
2422
  }
2558
2423
  result = z.lazy(() => unmarshalProjectSchema).parse(op.result.response);
2559
2424
  };
2560
- const retryOptions = {
2561
- ...(options?.signal !== undefined && { signal: options.signal }),
2562
- retrier: () => retryOn({}, (err) => {
2563
- return err.message.includes('operation still in progress');
2564
- }),
2565
- };
2566
- await executeCall(call, retryOptions);
2425
+ await executeWait(call, options);
2567
2426
  if (result === undefined) {
2568
- throw new Error('API call completed without a result.');
2427
+ throw new Error('operation completed without a result.');
2569
2428
  }
2570
2429
  return result;
2571
2430
  }
@@ -2602,18 +2461,17 @@ export class UpdateRoleOperation {
2602
2461
  * Throws if the operation failed.
2603
2462
  */
2604
2463
  async wait(options) {
2605
- const errStillRunning = new Error('operation still in progress');
2606
2464
  let result;
2607
2465
  const call = async (callSignal) => {
2608
2466
  const op = await this.client.getOperation({
2609
2467
  name: this.operation.name,
2610
- }, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
2468
+ }, callSignal !== undefined ? { signal: callSignal } : undefined);
2611
2469
  this.operation = op;
2612
2470
  if (op.done === undefined) {
2613
2471
  throw new Error('operation is missing the done field');
2614
2472
  }
2615
2473
  if (!op.done) {
2616
- throw errStillRunning;
2474
+ throw new StillRunningError();
2617
2475
  }
2618
2476
  if (op.result?.$case === 'error') {
2619
2477
  const err = op.result.error;
@@ -2630,15 +2488,9 @@ export class UpdateRoleOperation {
2630
2488
  }
2631
2489
  result = z.lazy(() => unmarshalRoleSchema).parse(op.result.response);
2632
2490
  };
2633
- const retryOptions = {
2634
- ...(options?.signal !== undefined && { signal: options.signal }),
2635
- retrier: () => retryOn({}, (err) => {
2636
- return err.message.includes('operation still in progress');
2637
- }),
2638
- };
2639
- await executeCall(call, retryOptions);
2491
+ await executeWait(call, options);
2640
2492
  if (result === undefined) {
2641
- throw new Error('API call completed without a result.');
2493
+ throw new Error('operation completed without a result.');
2642
2494
  }
2643
2495
  return result;
2644
2496
  }