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