@databricks/sdk-sharing 0.1.0-dev.1 → 0.1.0-dev.2
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 +8 -8
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +94 -94
- 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/model.d.ts +52 -52
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +24 -24
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/utils.d.ts +1 -2
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +1 -1
- package/dist/v1/utils.js.map +1 -1
- package/package.json +4 -4
- package/src/v1/client.ts +138 -139
- package/src/v1/index.ts +4 -4
- package/src/v1/model.ts +84 -84
- package/src/v1/utils.ts +3 -3
package/src/v1/client.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
|
|
4
|
-
import type {Call} from '@databricks/sdk-core/api';
|
|
5
4
|
import {createDefault} from '@databricks/sdk-core/clientinfo';
|
|
6
5
|
import type {Logger} from '@databricks/sdk-core/logger';
|
|
7
6
|
import {NoOpLogger} from '@databricks/sdk-core/logger';
|
|
@@ -35,10 +34,6 @@ import type {
|
|
|
35
34
|
GetFederationPolicyRequest,
|
|
36
35
|
GetProviderRequest,
|
|
37
36
|
GetRecipientRequest,
|
|
38
|
-
GetRecipientSharePermissionsRequest,
|
|
39
|
-
GetRecipientSharePermissionsRequest_Response,
|
|
40
|
-
GetSharePermissionsRequest,
|
|
41
|
-
GetSharePermissionsRequest_Response,
|
|
42
37
|
GetShareRequest,
|
|
43
38
|
ListFederationPoliciesRequest,
|
|
44
39
|
ListFederationPoliciesResponse,
|
|
@@ -48,8 +43,12 @@ import type {
|
|
|
48
43
|
ListProviderSharesRequest_Response,
|
|
49
44
|
ListProvidersRequest,
|
|
50
45
|
ListProvidersRequest_Response,
|
|
46
|
+
ListRecipientSharePermissionsRequest,
|
|
47
|
+
ListRecipientSharePermissionsRequest_Response,
|
|
51
48
|
ListRecipientsRequest,
|
|
52
49
|
ListRecipientsRequest_Response,
|
|
50
|
+
ListSharePermissionsRequest,
|
|
51
|
+
ListSharePermissionsRequest_Response,
|
|
53
52
|
ListSharesRequest,
|
|
54
53
|
ListSharesRequest_Response,
|
|
55
54
|
ProviderInfo,
|
|
@@ -80,13 +79,13 @@ import {
|
|
|
80
79
|
unmarshalDeleteShareRequest_ResponseSchema,
|
|
81
80
|
unmarshalFederationPolicySchema,
|
|
82
81
|
unmarshalGetActivationUrlInfoRequest_ResponseSchema,
|
|
83
|
-
unmarshalGetRecipientSharePermissionsRequest_ResponseSchema,
|
|
84
|
-
unmarshalGetSharePermissionsRequest_ResponseSchema,
|
|
85
82
|
unmarshalListFederationPoliciesResponseSchema,
|
|
86
83
|
unmarshalListProviderShareAssetsResponseSchema,
|
|
87
84
|
unmarshalListProviderSharesRequest_ResponseSchema,
|
|
88
85
|
unmarshalListProvidersRequest_ResponseSchema,
|
|
86
|
+
unmarshalListRecipientSharePermissionsRequest_ResponseSchema,
|
|
89
87
|
unmarshalListRecipientsRequest_ResponseSchema,
|
|
88
|
+
unmarshalListSharePermissionsRequest_ResponseSchema,
|
|
90
89
|
unmarshalListSharesRequest_ResponseSchema,
|
|
91
90
|
unmarshalProviderInfoSchema,
|
|
92
91
|
unmarshalRecipientInfoSchema,
|
|
@@ -157,7 +156,7 @@ export class SharingClient {
|
|
|
157
156
|
const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies`;
|
|
158
157
|
const body = marshalRequest(req.policy, marshalFederationPolicySchema);
|
|
159
158
|
let resp: FederationPolicy | undefined;
|
|
160
|
-
const call
|
|
159
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
161
160
|
const headers = new Headers({'Content-Type': 'application/json'});
|
|
162
161
|
if (this.workspaceId !== undefined) {
|
|
163
162
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -173,7 +172,7 @@ export class SharingClient {
|
|
|
173
172
|
};
|
|
174
173
|
await executeCall(call, options);
|
|
175
174
|
if (resp === undefined) {
|
|
176
|
-
throw new Error('
|
|
175
|
+
throw new Error('operation completed without a result.');
|
|
177
176
|
}
|
|
178
177
|
return resp;
|
|
179
178
|
}
|
|
@@ -189,7 +188,7 @@ export class SharingClient {
|
|
|
189
188
|
const url = `${this.host}/api/2.1/unity-catalog/providers`;
|
|
190
189
|
const body = marshalRequest(req, marshalCreateProviderRequestSchema);
|
|
191
190
|
let resp: ProviderInfo | undefined;
|
|
192
|
-
const call
|
|
191
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
193
192
|
const headers = new Headers({'Content-Type': 'application/json'});
|
|
194
193
|
if (this.workspaceId !== undefined) {
|
|
195
194
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -205,7 +204,7 @@ export class SharingClient {
|
|
|
205
204
|
};
|
|
206
205
|
await executeCall(call, options);
|
|
207
206
|
if (resp === undefined) {
|
|
208
|
-
throw new Error('
|
|
207
|
+
throw new Error('operation completed without a result.');
|
|
209
208
|
}
|
|
210
209
|
return resp;
|
|
211
210
|
}
|
|
@@ -221,7 +220,7 @@ export class SharingClient {
|
|
|
221
220
|
const url = `${this.host}/api/2.1/unity-catalog/recipients`;
|
|
222
221
|
const body = marshalRequest(req, marshalCreateRecipientRequestSchema);
|
|
223
222
|
let resp: RecipientInfo | undefined;
|
|
224
|
-
const call
|
|
223
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
225
224
|
const headers = new Headers({'Content-Type': 'application/json'});
|
|
226
225
|
if (this.workspaceId !== undefined) {
|
|
227
226
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -237,7 +236,7 @@ export class SharingClient {
|
|
|
237
236
|
};
|
|
238
237
|
await executeCall(call, options);
|
|
239
238
|
if (resp === undefined) {
|
|
240
|
-
throw new Error('
|
|
239
|
+
throw new Error('operation completed without a result.');
|
|
241
240
|
}
|
|
242
241
|
return resp;
|
|
243
242
|
}
|
|
@@ -253,7 +252,7 @@ export class SharingClient {
|
|
|
253
252
|
const url = `${this.host}/api/2.1/unity-catalog/shares`;
|
|
254
253
|
const body = marshalRequest(req, marshalCreateShareRequestSchema);
|
|
255
254
|
let resp: ShareInfo | undefined;
|
|
256
|
-
const call
|
|
255
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
257
256
|
const headers = new Headers({'Content-Type': 'application/json'});
|
|
258
257
|
if (this.workspaceId !== undefined) {
|
|
259
258
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -269,7 +268,7 @@ export class SharingClient {
|
|
|
269
268
|
};
|
|
270
269
|
await executeCall(call, options);
|
|
271
270
|
if (resp === undefined) {
|
|
272
|
-
throw new Error('
|
|
271
|
+
throw new Error('operation completed without a result.');
|
|
273
272
|
}
|
|
274
273
|
return resp;
|
|
275
274
|
}
|
|
@@ -283,7 +282,7 @@ export class SharingClient {
|
|
|
283
282
|
options?: CallOptions
|
|
284
283
|
): Promise<void> {
|
|
285
284
|
const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies/${req.name ?? ''}`;
|
|
286
|
-
const call
|
|
285
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
287
286
|
const headers = new Headers();
|
|
288
287
|
if (this.workspaceId !== undefined) {
|
|
289
288
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -306,7 +305,7 @@ export class SharingClient {
|
|
|
306
305
|
): Promise<DeleteProviderRequest_Response> {
|
|
307
306
|
const url = `${this.host}/api/2.1/unity-catalog/providers/${req.nameArg ?? ''}`;
|
|
308
307
|
let resp: DeleteProviderRequest_Response | undefined;
|
|
309
|
-
const call
|
|
308
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
310
309
|
const headers = new Headers();
|
|
311
310
|
if (this.workspaceId !== undefined) {
|
|
312
311
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -325,7 +324,7 @@ export class SharingClient {
|
|
|
325
324
|
};
|
|
326
325
|
await executeCall(call, options);
|
|
327
326
|
if (resp === undefined) {
|
|
328
|
-
throw new Error('
|
|
327
|
+
throw new Error('operation completed without a result.');
|
|
329
328
|
}
|
|
330
329
|
return resp;
|
|
331
330
|
}
|
|
@@ -337,7 +336,7 @@ export class SharingClient {
|
|
|
337
336
|
): Promise<DeleteRecipientRequest_Response> {
|
|
338
337
|
const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}`;
|
|
339
338
|
let resp: DeleteRecipientRequest_Response | undefined;
|
|
340
|
-
const call
|
|
339
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
341
340
|
const headers = new Headers();
|
|
342
341
|
if (this.workspaceId !== undefined) {
|
|
343
342
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -356,7 +355,7 @@ export class SharingClient {
|
|
|
356
355
|
};
|
|
357
356
|
await executeCall(call, options);
|
|
358
357
|
if (resp === undefined) {
|
|
359
|
-
throw new Error('
|
|
358
|
+
throw new Error('operation completed without a result.');
|
|
360
359
|
}
|
|
361
360
|
return resp;
|
|
362
361
|
}
|
|
@@ -368,7 +367,7 @@ export class SharingClient {
|
|
|
368
367
|
): Promise<DeleteShareRequest_Response> {
|
|
369
368
|
const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}`;
|
|
370
369
|
let resp: DeleteShareRequest_Response | undefined;
|
|
371
|
-
const call
|
|
370
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
372
371
|
const headers = new Headers();
|
|
373
372
|
if (this.workspaceId !== undefined) {
|
|
374
373
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -387,7 +386,7 @@ export class SharingClient {
|
|
|
387
386
|
};
|
|
388
387
|
await executeCall(call, options);
|
|
389
388
|
if (resp === undefined) {
|
|
390
|
-
throw new Error('
|
|
389
|
+
throw new Error('operation completed without a result.');
|
|
391
390
|
}
|
|
392
391
|
return resp;
|
|
393
392
|
}
|
|
@@ -399,7 +398,7 @@ export class SharingClient {
|
|
|
399
398
|
): Promise<GetActivationUrlInfoRequest_Response> {
|
|
400
399
|
const url = `${this.host}/api/2.1/unity-catalog/public/data_sharing_activation_info/${req.activationUrl ?? ''}`;
|
|
401
400
|
let resp: GetActivationUrlInfoRequest_Response | undefined;
|
|
402
|
-
const call
|
|
401
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
403
402
|
const headers = new Headers();
|
|
404
403
|
if (this.workspaceId !== undefined) {
|
|
405
404
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -418,7 +417,7 @@ export class SharingClient {
|
|
|
418
417
|
};
|
|
419
418
|
await executeCall(call, options);
|
|
420
419
|
if (resp === undefined) {
|
|
421
|
-
throw new Error('
|
|
420
|
+
throw new Error('operation completed without a result.');
|
|
422
421
|
}
|
|
423
422
|
return resp;
|
|
424
423
|
}
|
|
@@ -433,7 +432,7 @@ export class SharingClient {
|
|
|
433
432
|
): Promise<FederationPolicy> {
|
|
434
433
|
const url = `${this.host}/api/2.0/data-sharing/recipients/${req.recipientName ?? ''}/federation-policies/${req.name ?? ''}`;
|
|
435
434
|
let resp: FederationPolicy | undefined;
|
|
436
|
-
const call
|
|
435
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
437
436
|
const headers = new Headers();
|
|
438
437
|
if (this.workspaceId !== undefined) {
|
|
439
438
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -449,7 +448,7 @@ export class SharingClient {
|
|
|
449
448
|
};
|
|
450
449
|
await executeCall(call, options);
|
|
451
450
|
if (resp === undefined) {
|
|
452
|
-
throw new Error('
|
|
451
|
+
throw new Error('operation completed without a result.');
|
|
453
452
|
}
|
|
454
453
|
return resp;
|
|
455
454
|
}
|
|
@@ -464,7 +463,7 @@ export class SharingClient {
|
|
|
464
463
|
): Promise<ProviderInfo> {
|
|
465
464
|
const url = `${this.host}/api/2.1/unity-catalog/providers/${req.nameArg ?? ''}`;
|
|
466
465
|
let resp: ProviderInfo | undefined;
|
|
467
|
-
const call
|
|
466
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
468
467
|
const headers = new Headers();
|
|
469
468
|
if (this.workspaceId !== undefined) {
|
|
470
469
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -480,7 +479,7 @@ export class SharingClient {
|
|
|
480
479
|
};
|
|
481
480
|
await executeCall(call, options);
|
|
482
481
|
if (resp === undefined) {
|
|
483
|
-
throw new Error('
|
|
482
|
+
throw new Error('operation completed without a result.');
|
|
484
483
|
}
|
|
485
484
|
return resp;
|
|
486
485
|
}
|
|
@@ -497,7 +496,7 @@ export class SharingClient {
|
|
|
497
496
|
): Promise<RecipientInfo> {
|
|
498
497
|
const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}`;
|
|
499
498
|
let resp: RecipientInfo | undefined;
|
|
500
|
-
const call
|
|
499
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
501
500
|
const headers = new Headers();
|
|
502
501
|
if (this.workspaceId !== undefined) {
|
|
503
502
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -513,47 +512,7 @@ export class SharingClient {
|
|
|
513
512
|
};
|
|
514
513
|
await executeCall(call, options);
|
|
515
514
|
if (resp === undefined) {
|
|
516
|
-
throw new Error('
|
|
517
|
-
}
|
|
518
|
-
return resp;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
/** Gets the share permissions for the specified Recipient. The caller must have the **USE_RECIPIENT** privilege on the metastore or be the owner of the Recipient. */
|
|
522
|
-
async getRecipientSharePermissions(
|
|
523
|
-
req: GetRecipientSharePermissionsRequest,
|
|
524
|
-
options?: CallOptions
|
|
525
|
-
): Promise<GetRecipientSharePermissionsRequest_Response> {
|
|
526
|
-
const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}/share-permissions`;
|
|
527
|
-
const params = new URLSearchParams();
|
|
528
|
-
if (req.maxResults !== undefined) {
|
|
529
|
-
params.append('max_results', String(req.maxResults));
|
|
530
|
-
}
|
|
531
|
-
if (req.pageToken !== undefined) {
|
|
532
|
-
params.append('page_token', req.pageToken);
|
|
533
|
-
}
|
|
534
|
-
const query = params.toString();
|
|
535
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
536
|
-
let resp: GetRecipientSharePermissionsRequest_Response | undefined;
|
|
537
|
-
const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
538
|
-
const headers = new Headers();
|
|
539
|
-
if (this.workspaceId !== undefined) {
|
|
540
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
541
|
-
}
|
|
542
|
-
headers.set('User-Agent', this.userAgent);
|
|
543
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
544
|
-
const respBody = await executeHttpCall({
|
|
545
|
-
request: httpReq,
|
|
546
|
-
httpClient: this.httpClient,
|
|
547
|
-
logger: this.logger,
|
|
548
|
-
});
|
|
549
|
-
resp = parseResponse(
|
|
550
|
-
respBody,
|
|
551
|
-
unmarshalGetRecipientSharePermissionsRequest_ResponseSchema
|
|
552
|
-
);
|
|
553
|
-
};
|
|
554
|
-
await executeCall(call, options);
|
|
555
|
-
if (resp === undefined) {
|
|
556
|
-
throw new Error('API call completed without a result.');
|
|
515
|
+
throw new Error('operation completed without a result.');
|
|
557
516
|
}
|
|
558
517
|
return resp;
|
|
559
518
|
}
|
|
@@ -571,7 +530,7 @@ export class SharingClient {
|
|
|
571
530
|
const query = params.toString();
|
|
572
531
|
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
573
532
|
let resp: ShareInfo | undefined;
|
|
574
|
-
const call
|
|
533
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
575
534
|
const headers = new Headers();
|
|
576
535
|
if (this.workspaceId !== undefined) {
|
|
577
536
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -587,50 +546,7 @@ export class SharingClient {
|
|
|
587
546
|
};
|
|
588
547
|
await executeCall(call, options);
|
|
589
548
|
if (resp === undefined) {
|
|
590
|
-
throw new Error('
|
|
591
|
-
}
|
|
592
|
-
return resp;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
* Gets the permissions for a data share from the metastore.
|
|
597
|
-
* The caller must have the USE_SHARE privilege on the metastore or be the owner of the share.
|
|
598
|
-
*/
|
|
599
|
-
async getSharePermissions(
|
|
600
|
-
req: GetSharePermissionsRequest,
|
|
601
|
-
options?: CallOptions
|
|
602
|
-
): Promise<GetSharePermissionsRequest_Response> {
|
|
603
|
-
const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}/permissions`;
|
|
604
|
-
const params = new URLSearchParams();
|
|
605
|
-
if (req.maxResults !== undefined) {
|
|
606
|
-
params.append('max_results', String(req.maxResults));
|
|
607
|
-
}
|
|
608
|
-
if (req.pageToken !== undefined) {
|
|
609
|
-
params.append('page_token', req.pageToken);
|
|
610
|
-
}
|
|
611
|
-
const query = params.toString();
|
|
612
|
-
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
613
|
-
let resp: GetSharePermissionsRequest_Response | undefined;
|
|
614
|
-
const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
615
|
-
const headers = new Headers();
|
|
616
|
-
if (this.workspaceId !== undefined) {
|
|
617
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
618
|
-
}
|
|
619
|
-
headers.set('User-Agent', this.userAgent);
|
|
620
|
-
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
621
|
-
const respBody = await executeHttpCall({
|
|
622
|
-
request: httpReq,
|
|
623
|
-
httpClient: this.httpClient,
|
|
624
|
-
logger: this.logger,
|
|
625
|
-
});
|
|
626
|
-
resp = parseResponse(
|
|
627
|
-
respBody,
|
|
628
|
-
unmarshalGetSharePermissionsRequest_ResponseSchema
|
|
629
|
-
);
|
|
630
|
-
};
|
|
631
|
-
await executeCall(call, options);
|
|
632
|
-
if (resp === undefined) {
|
|
633
|
-
throw new Error('API call completed without a result.');
|
|
549
|
+
throw new Error('operation completed without a result.');
|
|
634
550
|
}
|
|
635
551
|
return resp;
|
|
636
552
|
}
|
|
@@ -654,7 +570,7 @@ export class SharingClient {
|
|
|
654
570
|
const query = params.toString();
|
|
655
571
|
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
656
572
|
let resp: ListFederationPoliciesResponse | undefined;
|
|
657
|
-
const call
|
|
573
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
658
574
|
const headers = new Headers();
|
|
659
575
|
if (this.workspaceId !== undefined) {
|
|
660
576
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -673,7 +589,7 @@ export class SharingClient {
|
|
|
673
589
|
};
|
|
674
590
|
await executeCall(call, options);
|
|
675
591
|
if (resp === undefined) {
|
|
676
|
-
throw new Error('
|
|
592
|
+
throw new Error('operation completed without a result.');
|
|
677
593
|
}
|
|
678
594
|
return resp;
|
|
679
595
|
}
|
|
@@ -720,7 +636,7 @@ export class SharingClient {
|
|
|
720
636
|
const query = params.toString();
|
|
721
637
|
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
722
638
|
let resp: ListProviderShareAssetsResponse | undefined;
|
|
723
|
-
const call
|
|
639
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
724
640
|
const headers = new Headers();
|
|
725
641
|
if (this.workspaceId !== undefined) {
|
|
726
642
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -739,7 +655,7 @@ export class SharingClient {
|
|
|
739
655
|
};
|
|
740
656
|
await executeCall(call, options);
|
|
741
657
|
if (resp === undefined) {
|
|
742
|
-
throw new Error('
|
|
658
|
+
throw new Error('operation completed without a result.');
|
|
743
659
|
}
|
|
744
660
|
return resp;
|
|
745
661
|
}
|
|
@@ -765,7 +681,7 @@ export class SharingClient {
|
|
|
765
681
|
const query = params.toString();
|
|
766
682
|
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
767
683
|
let resp: ListProviderSharesRequest_Response | undefined;
|
|
768
|
-
const call
|
|
684
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
769
685
|
const headers = new Headers();
|
|
770
686
|
if (this.workspaceId !== undefined) {
|
|
771
687
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -784,7 +700,7 @@ export class SharingClient {
|
|
|
784
700
|
};
|
|
785
701
|
await executeCall(call, options);
|
|
786
702
|
if (resp === undefined) {
|
|
787
|
-
throw new Error('
|
|
703
|
+
throw new Error('operation completed without a result.');
|
|
788
704
|
}
|
|
789
705
|
return resp;
|
|
790
706
|
}
|
|
@@ -834,7 +750,7 @@ export class SharingClient {
|
|
|
834
750
|
const query = params.toString();
|
|
835
751
|
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
836
752
|
let resp: ListProvidersRequest_Response | undefined;
|
|
837
|
-
const call
|
|
753
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
838
754
|
const headers = new Headers();
|
|
839
755
|
if (this.workspaceId !== undefined) {
|
|
840
756
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -853,7 +769,7 @@ export class SharingClient {
|
|
|
853
769
|
};
|
|
854
770
|
await executeCall(call, options);
|
|
855
771
|
if (resp === undefined) {
|
|
856
|
-
throw new Error('
|
|
772
|
+
throw new Error('operation completed without a result.');
|
|
857
773
|
}
|
|
858
774
|
return resp;
|
|
859
775
|
}
|
|
@@ -875,6 +791,46 @@ export class SharingClient {
|
|
|
875
791
|
}
|
|
876
792
|
}
|
|
877
793
|
|
|
794
|
+
/** Gets the share permissions for the specified Recipient. The caller must have the **USE_RECIPIENT** privilege on the metastore or be the owner of the Recipient. */
|
|
795
|
+
async listRecipientSharePermissions(
|
|
796
|
+
req: ListRecipientSharePermissionsRequest,
|
|
797
|
+
options?: CallOptions
|
|
798
|
+
): Promise<ListRecipientSharePermissionsRequest_Response> {
|
|
799
|
+
const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}/share-permissions`;
|
|
800
|
+
const params = new URLSearchParams();
|
|
801
|
+
if (req.maxResults !== undefined) {
|
|
802
|
+
params.append('max_results', String(req.maxResults));
|
|
803
|
+
}
|
|
804
|
+
if (req.pageToken !== undefined) {
|
|
805
|
+
params.append('page_token', req.pageToken);
|
|
806
|
+
}
|
|
807
|
+
const query = params.toString();
|
|
808
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
809
|
+
let resp: ListRecipientSharePermissionsRequest_Response | undefined;
|
|
810
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
811
|
+
const headers = new Headers();
|
|
812
|
+
if (this.workspaceId !== undefined) {
|
|
813
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
814
|
+
}
|
|
815
|
+
headers.set('User-Agent', this.userAgent);
|
|
816
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
817
|
+
const respBody = await executeHttpCall({
|
|
818
|
+
request: httpReq,
|
|
819
|
+
httpClient: this.httpClient,
|
|
820
|
+
logger: this.logger,
|
|
821
|
+
});
|
|
822
|
+
resp = parseResponse(
|
|
823
|
+
respBody,
|
|
824
|
+
unmarshalListRecipientSharePermissionsRequest_ResponseSchema
|
|
825
|
+
);
|
|
826
|
+
};
|
|
827
|
+
await executeCall(call, options);
|
|
828
|
+
if (resp === undefined) {
|
|
829
|
+
throw new Error('operation completed without a result.');
|
|
830
|
+
}
|
|
831
|
+
return resp;
|
|
832
|
+
}
|
|
833
|
+
|
|
878
834
|
/**
|
|
879
835
|
* Gets an array of all share recipients within the current metastore where:
|
|
880
836
|
*
|
|
@@ -903,7 +859,7 @@ export class SharingClient {
|
|
|
903
859
|
const query = params.toString();
|
|
904
860
|
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
905
861
|
let resp: ListRecipientsRequest_Response | undefined;
|
|
906
|
-
const call
|
|
862
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
907
863
|
const headers = new Headers();
|
|
908
864
|
if (this.workspaceId !== undefined) {
|
|
909
865
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -922,7 +878,7 @@ export class SharingClient {
|
|
|
922
878
|
};
|
|
923
879
|
await executeCall(call, options);
|
|
924
880
|
if (resp === undefined) {
|
|
925
|
-
throw new Error('
|
|
881
|
+
throw new Error('operation completed without a result.');
|
|
926
882
|
}
|
|
927
883
|
return resp;
|
|
928
884
|
}
|
|
@@ -944,6 +900,49 @@ export class SharingClient {
|
|
|
944
900
|
}
|
|
945
901
|
}
|
|
946
902
|
|
|
903
|
+
/**
|
|
904
|
+
* Gets the permissions for a data share from the metastore.
|
|
905
|
+
* The caller must have the USE_SHARE privilege on the metastore or be the owner of the share.
|
|
906
|
+
*/
|
|
907
|
+
async listSharePermissions(
|
|
908
|
+
req: ListSharePermissionsRequest,
|
|
909
|
+
options?: CallOptions
|
|
910
|
+
): Promise<ListSharePermissionsRequest_Response> {
|
|
911
|
+
const url = `${this.host}/api/2.1/unity-catalog/shares/${req.name ?? ''}/permissions`;
|
|
912
|
+
const params = new URLSearchParams();
|
|
913
|
+
if (req.maxResults !== undefined) {
|
|
914
|
+
params.append('max_results', String(req.maxResults));
|
|
915
|
+
}
|
|
916
|
+
if (req.pageToken !== undefined) {
|
|
917
|
+
params.append('page_token', req.pageToken);
|
|
918
|
+
}
|
|
919
|
+
const query = params.toString();
|
|
920
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
921
|
+
let resp: ListSharePermissionsRequest_Response | undefined;
|
|
922
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
923
|
+
const headers = new Headers();
|
|
924
|
+
if (this.workspaceId !== undefined) {
|
|
925
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
926
|
+
}
|
|
927
|
+
headers.set('User-Agent', this.userAgent);
|
|
928
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
929
|
+
const respBody = await executeHttpCall({
|
|
930
|
+
request: httpReq,
|
|
931
|
+
httpClient: this.httpClient,
|
|
932
|
+
logger: this.logger,
|
|
933
|
+
});
|
|
934
|
+
resp = parseResponse(
|
|
935
|
+
respBody,
|
|
936
|
+
unmarshalListSharePermissionsRequest_ResponseSchema
|
|
937
|
+
);
|
|
938
|
+
};
|
|
939
|
+
await executeCall(call, options);
|
|
940
|
+
if (resp === undefined) {
|
|
941
|
+
throw new Error('operation completed without a result.');
|
|
942
|
+
}
|
|
943
|
+
return resp;
|
|
944
|
+
}
|
|
945
|
+
|
|
947
946
|
/**
|
|
948
947
|
* Gets an array of data object shares from the metastore. If the caller has the USE_SHARE privilege on the metastore, all shares are returned. Otherwise, only shares owned by the caller are returned.
|
|
949
948
|
* There is no guarantee of a specific ordering of the elements in the array.
|
|
@@ -963,7 +962,7 @@ export class SharingClient {
|
|
|
963
962
|
const query = params.toString();
|
|
964
963
|
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
965
964
|
let resp: ListSharesRequest_Response | undefined;
|
|
966
|
-
const call
|
|
965
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
967
966
|
const headers = new Headers();
|
|
968
967
|
if (this.workspaceId !== undefined) {
|
|
969
968
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -979,7 +978,7 @@ export class SharingClient {
|
|
|
979
978
|
};
|
|
980
979
|
await executeCall(call, options);
|
|
981
980
|
if (resp === undefined) {
|
|
982
|
-
throw new Error('
|
|
981
|
+
throw new Error('operation completed without a result.');
|
|
983
982
|
}
|
|
984
983
|
return resp;
|
|
985
984
|
}
|
|
@@ -1011,7 +1010,7 @@ export class SharingClient {
|
|
|
1011
1010
|
): Promise<RetrieveToken_Response> {
|
|
1012
1011
|
const url = `${this.host}/api/2.1/unity-catalog/public/data_sharing_activation/${req.activationUrl ?? ''}`;
|
|
1013
1012
|
let resp: RetrieveToken_Response | undefined;
|
|
1014
|
-
const call
|
|
1013
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
1015
1014
|
const headers = new Headers();
|
|
1016
1015
|
if (this.workspaceId !== undefined) {
|
|
1017
1016
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -1027,7 +1026,7 @@ export class SharingClient {
|
|
|
1027
1026
|
};
|
|
1028
1027
|
await executeCall(call, options);
|
|
1029
1028
|
if (resp === undefined) {
|
|
1030
|
-
throw new Error('
|
|
1029
|
+
throw new Error('operation completed without a result.');
|
|
1031
1030
|
}
|
|
1032
1031
|
return resp;
|
|
1033
1032
|
}
|
|
@@ -1043,7 +1042,7 @@ export class SharingClient {
|
|
|
1043
1042
|
const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.name ?? ''}/rotate-token`;
|
|
1044
1043
|
const body = marshalRequest(req, marshalRotateRecipientTokenRequestSchema);
|
|
1045
1044
|
let resp: RecipientInfo | undefined;
|
|
1046
|
-
const call
|
|
1045
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
1047
1046
|
const headers = new Headers({'Content-Type': 'application/json'});
|
|
1048
1047
|
if (this.workspaceId !== undefined) {
|
|
1049
1048
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -1059,7 +1058,7 @@ export class SharingClient {
|
|
|
1059
1058
|
};
|
|
1060
1059
|
await executeCall(call, options);
|
|
1061
1060
|
if (resp === undefined) {
|
|
1062
|
-
throw new Error('
|
|
1061
|
+
throw new Error('operation completed without a result.');
|
|
1063
1062
|
}
|
|
1064
1063
|
return resp;
|
|
1065
1064
|
}
|
|
@@ -1075,7 +1074,7 @@ export class SharingClient {
|
|
|
1075
1074
|
const url = `${this.host}/api/2.1/unity-catalog/providers/${req.nameArg ?? ''}`;
|
|
1076
1075
|
const body = marshalRequest(req, marshalUpdateProviderRequestSchema);
|
|
1077
1076
|
let resp: ProviderInfo | undefined;
|
|
1078
|
-
const call
|
|
1077
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
1079
1078
|
const headers = new Headers({'Content-Type': 'application/json'});
|
|
1080
1079
|
if (this.workspaceId !== undefined) {
|
|
1081
1080
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -1091,7 +1090,7 @@ export class SharingClient {
|
|
|
1091
1090
|
};
|
|
1092
1091
|
await executeCall(call, options);
|
|
1093
1092
|
if (resp === undefined) {
|
|
1094
|
-
throw new Error('
|
|
1093
|
+
throw new Error('operation completed without a result.');
|
|
1095
1094
|
}
|
|
1096
1095
|
return resp;
|
|
1097
1096
|
}
|
|
@@ -1107,7 +1106,7 @@ export class SharingClient {
|
|
|
1107
1106
|
const url = `${this.host}/api/2.1/unity-catalog/recipients/${req.nameArg ?? ''}`;
|
|
1108
1107
|
const body = marshalRequest(req, marshalUpdateRecipientRequestSchema);
|
|
1109
1108
|
let resp: RecipientInfo | undefined;
|
|
1110
|
-
const call
|
|
1109
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
1111
1110
|
const headers = new Headers({'Content-Type': 'application/json'});
|
|
1112
1111
|
if (this.workspaceId !== undefined) {
|
|
1113
1112
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -1123,7 +1122,7 @@ export class SharingClient {
|
|
|
1123
1122
|
};
|
|
1124
1123
|
await executeCall(call, options);
|
|
1125
1124
|
if (resp === undefined) {
|
|
1126
|
-
throw new Error('
|
|
1125
|
+
throw new Error('operation completed without a result.');
|
|
1127
1126
|
}
|
|
1128
1127
|
return resp;
|
|
1129
1128
|
}
|
|
@@ -1152,7 +1151,7 @@ export class SharingClient {
|
|
|
1152
1151
|
const url = `${this.host}/api/2.1/unity-catalog/shares/${req.nameArg ?? ''}`;
|
|
1153
1152
|
const body = marshalRequest(req, marshalUpdateShareRequestSchema);
|
|
1154
1153
|
let resp: ShareInfo | undefined;
|
|
1155
|
-
const call
|
|
1154
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
1156
1155
|
const headers = new Headers({'Content-Type': 'application/json'});
|
|
1157
1156
|
if (this.workspaceId !== undefined) {
|
|
1158
1157
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -1168,7 +1167,7 @@ export class SharingClient {
|
|
|
1168
1167
|
};
|
|
1169
1168
|
await executeCall(call, options);
|
|
1170
1169
|
if (resp === undefined) {
|
|
1171
|
-
throw new Error('
|
|
1170
|
+
throw new Error('operation completed without a result.');
|
|
1172
1171
|
}
|
|
1173
1172
|
return resp;
|
|
1174
1173
|
}
|
|
@@ -1191,7 +1190,7 @@ export class SharingClient {
|
|
|
1191
1190
|
marshalUpdateSharePermissionsRequestSchema
|
|
1192
1191
|
);
|
|
1193
1192
|
let resp: UpdateSharePermissionsRequest_Response | undefined;
|
|
1194
|
-
const call
|
|
1193
|
+
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
1195
1194
|
const headers = new Headers({'Content-Type': 'application/json'});
|
|
1196
1195
|
if (this.workspaceId !== undefined) {
|
|
1197
1196
|
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
@@ -1210,7 +1209,7 @@ export class SharingClient {
|
|
|
1210
1209
|
};
|
|
1211
1210
|
await executeCall(call, options);
|
|
1212
1211
|
if (resp === undefined) {
|
|
1213
|
-
throw new Error('
|
|
1212
|
+
throw new Error('operation completed without a result.');
|
|
1214
1213
|
}
|
|
1215
1214
|
return resp;
|
|
1216
1215
|
}
|
package/src/v1/index.ts
CHANGED
|
@@ -38,10 +38,6 @@ export type {
|
|
|
38
38
|
GetFederationPolicyRequest,
|
|
39
39
|
GetProviderRequest,
|
|
40
40
|
GetRecipientRequest,
|
|
41
|
-
GetRecipientSharePermissionsRequest,
|
|
42
|
-
GetRecipientSharePermissionsRequest_Response,
|
|
43
|
-
GetSharePermissionsRequest,
|
|
44
|
-
GetSharePermissionsRequest_Response,
|
|
45
41
|
GetShareRequest,
|
|
46
42
|
IpAccessList,
|
|
47
43
|
ListFederationPoliciesRequest,
|
|
@@ -52,8 +48,12 @@ export type {
|
|
|
52
48
|
ListProviderSharesRequest_Response,
|
|
53
49
|
ListProvidersRequest,
|
|
54
50
|
ListProvidersRequest_Response,
|
|
51
|
+
ListRecipientSharePermissionsRequest,
|
|
52
|
+
ListRecipientSharePermissionsRequest_Response,
|
|
55
53
|
ListRecipientsRequest,
|
|
56
54
|
ListRecipientsRequest_Response,
|
|
55
|
+
ListSharePermissionsRequest,
|
|
56
|
+
ListSharePermissionsRequest_Response,
|
|
57
57
|
ListSharesRequest,
|
|
58
58
|
ListSharesRequest_Response,
|
|
59
59
|
NotebookFile,
|