@databricks/sdk-uc-grants 0.0.0-dev → 0.1.0-dev.1
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/LICENSE +203 -0
- package/dist/v1/client.d.ts +32 -0
- package/dist/v1/client.d.ts.map +1 -0
- package/dist/v1/client.js +152 -0
- package/dist/v1/client.js.map +1 -0
- package/dist/v1/index.d.ts +3 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +3 -0
- package/dist/v1/index.js.map +1 -0
- package/dist/v1/model.d.ts +128 -0
- package/dist/v1/model.d.ts.map +1 -0
- package/dist/v1/model.js +90 -0
- package/dist/v1/model.js.map +1 -0
- package/dist/v1/transport.d.ts +5 -0
- package/dist/v1/transport.d.ts.map +1 -0
- package/dist/v1/transport.js +57 -0
- package/dist/v1/transport.js.map +1 -0
- package/dist/v1/utils.d.ts +22 -0
- package/dist/v1/utils.d.ts.map +1 -0
- package/dist/v1/utils.js +113 -0
- package/dist/v1/utils.js.map +1 -0
- package/package.json +38 -4
- package/src/v1/client.ts +200 -0
- package/src/v1/index.ts +16 -0
- package/src/v1/model.ts +235 -0
- package/src/v1/transport.ts +73 -0
- package/src/v1/utils.ts +156 -0
- package/README.md +0 -1
- package/index.js +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Copyright 2026 Databricks, Inc. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Apache License
|
|
4
|
+
Version 2.0, January 2004
|
|
5
|
+
http://www.apache.org/licenses/
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
1. Definitions.
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
12
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
13
|
+
|
|
14
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
15
|
+
the copyright owner that is granting the License.
|
|
16
|
+
|
|
17
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
18
|
+
other entities that control, are controlled by, or are under common
|
|
19
|
+
control with that entity. For the purposes of this definition,
|
|
20
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
21
|
+
direction or management of such entity, whether by contract or
|
|
22
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
23
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
24
|
+
|
|
25
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
26
|
+
exercising permissions granted by this License.
|
|
27
|
+
|
|
28
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
29
|
+
including but not limited to software source code, documentation
|
|
30
|
+
source, and configuration files.
|
|
31
|
+
|
|
32
|
+
"Object" form shall mean any form resulting from mechanical
|
|
33
|
+
transformation or translation of a Source form, including but
|
|
34
|
+
not limited to compiled object code, generated documentation,
|
|
35
|
+
and conversions to other media types.
|
|
36
|
+
|
|
37
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
38
|
+
Object form, made available under the License, as indicated by a
|
|
39
|
+
copyright notice that is included in or attached to the work
|
|
40
|
+
(an example is provided in the Appendix below).
|
|
41
|
+
|
|
42
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
43
|
+
form, that is based on (or derived from) the Work and for which the
|
|
44
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
45
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
46
|
+
of this License, Derivative Works shall not include works that remain
|
|
47
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
48
|
+
the Work and Derivative Works thereof.
|
|
49
|
+
|
|
50
|
+
"Contribution" shall mean any work of authorship, including
|
|
51
|
+
the original version of the Work and any modifications or additions
|
|
52
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
53
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
54
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
55
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
56
|
+
means any form of electronic, verbal, or written communication sent
|
|
57
|
+
to the Licensor or its representatives, including but not limited to
|
|
58
|
+
communication on electronic mailing lists, source code control systems,
|
|
59
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
60
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
61
|
+
excluding communication that is conspicuously marked or otherwise
|
|
62
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
63
|
+
|
|
64
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
65
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
66
|
+
subsequently incorporated within the Work.
|
|
67
|
+
|
|
68
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
69
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
70
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
71
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
72
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
73
|
+
Work and such Derivative Works in Source or Object form.
|
|
74
|
+
|
|
75
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
76
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
77
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
78
|
+
(except as stated in this section) patent license to make, have made,
|
|
79
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
80
|
+
where such license applies only to those patent claims licensable
|
|
81
|
+
by such Contributor that are necessarily infringed by their
|
|
82
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
83
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
84
|
+
institute patent litigation against any entity (including a
|
|
85
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
86
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
87
|
+
or contributory patent infringement, then any patent licenses
|
|
88
|
+
granted to You under this License for that Work shall terminate
|
|
89
|
+
as of the date such litigation is filed.
|
|
90
|
+
|
|
91
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
92
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
93
|
+
modifications, and in Source or Object form, provided that You
|
|
94
|
+
meet the following conditions:
|
|
95
|
+
|
|
96
|
+
(a) You must give any other recipients of the Work or
|
|
97
|
+
Derivative Works a copy of this License; and
|
|
98
|
+
|
|
99
|
+
(b) You must cause any modified files to carry prominent notices
|
|
100
|
+
stating that You changed the files; and
|
|
101
|
+
|
|
102
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
103
|
+
that You distribute, all copyright, patent, trademark, and
|
|
104
|
+
attribution notices from the Source form of the Work,
|
|
105
|
+
excluding those notices that do not pertain to any part of
|
|
106
|
+
the Derivative Works; and
|
|
107
|
+
|
|
108
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
109
|
+
distribution, then any Derivative Works that You distribute must
|
|
110
|
+
include a readable copy of the attribution notices contained
|
|
111
|
+
within such NOTICE file, excluding those notices that do not
|
|
112
|
+
pertain to any part of the Derivative Works, in at least one
|
|
113
|
+
of the following places: within a NOTICE text file distributed
|
|
114
|
+
as part of the Derivative Works; within the Source form or
|
|
115
|
+
documentation, if provided along with the Derivative Works; or,
|
|
116
|
+
within a display generated by the Derivative Works, if and
|
|
117
|
+
wherever such third-party notices normally appear. The contents
|
|
118
|
+
of the NOTICE file are for informational purposes only and
|
|
119
|
+
do not modify the License. You may add Your own attribution
|
|
120
|
+
notices within Derivative Works that You distribute, alongside
|
|
121
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
122
|
+
that such additional attribution notices cannot be construed
|
|
123
|
+
as modifying the License.
|
|
124
|
+
|
|
125
|
+
You may add Your own copyright statement to Your modifications and
|
|
126
|
+
may provide additional or different license terms and conditions
|
|
127
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
+
the conditions stated in this License.
|
|
131
|
+
|
|
132
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
+
this License, without any additional terms or conditions.
|
|
136
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
+
the terms of any separate license agreement you may have executed
|
|
138
|
+
with Licensor regarding such Contributions.
|
|
139
|
+
|
|
140
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
+
except as required for reasonable and customary use in describing the
|
|
143
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
144
|
+
|
|
145
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
146
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
147
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
148
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
149
|
+
implied, including, without limitation, any warranties or conditions
|
|
150
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
151
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
152
|
+
appropriateness of using or redistributing the Work and assume any
|
|
153
|
+
risks associated with Your exercise of permissions under this License.
|
|
154
|
+
|
|
155
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
156
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
157
|
+
unless required by applicable law (such as deliberate and grossly
|
|
158
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
159
|
+
liable to You for damages, including any direct, indirect, special,
|
|
160
|
+
incidental, or consequential damages of any character arising as a
|
|
161
|
+
result of this License or out of the use or inability to use the
|
|
162
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
163
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
164
|
+
other commercial damages or losses), even if such Contributor
|
|
165
|
+
has been advised of the possibility of such damages.
|
|
166
|
+
|
|
167
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
168
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
169
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
170
|
+
or other liability obligations and/or rights consistent with this
|
|
171
|
+
License. However, in accepting such obligations, You may act only
|
|
172
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
173
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
174
|
+
defend, and hold each Contributor harmless for any liability
|
|
175
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
176
|
+
of your accepting any such warranty or additional liability.
|
|
177
|
+
|
|
178
|
+
END OF TERMS AND CONDITIONS
|
|
179
|
+
|
|
180
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
181
|
+
|
|
182
|
+
To apply the Apache License to your work, attach the following
|
|
183
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
184
|
+
replaced with your own identifying information. (Don't include
|
|
185
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
186
|
+
comment syntax for the file format. We also recommend that a
|
|
187
|
+
file or class name and description of purpose be included on the
|
|
188
|
+
same "printed page" as the copyright notice for easier
|
|
189
|
+
identification within third-party archives.
|
|
190
|
+
|
|
191
|
+
Copyright [yyyy] [name of copyright owner]
|
|
192
|
+
|
|
193
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
194
|
+
you may not use this file except in compliance with the License.
|
|
195
|
+
You may obtain a copy of the License at
|
|
196
|
+
|
|
197
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
198
|
+
|
|
199
|
+
Unless required by applicable law or agreed to in writing, software
|
|
200
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
|
+
See the License for the specific language governing permissions and
|
|
203
|
+
limitations under the License.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CallOptions } from '@databricks/sdk-options/call';
|
|
2
|
+
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
|
+
import type { GetEffectivePermissionsRequest, GetEffectivePermissionsRequest_Response, GetPermissionsRequest, GetPermissionsRequest_Response, UpdatePermissionsRequest, UpdatePermissionsRequest_Response } from './model';
|
|
4
|
+
export declare class GrantsClient {
|
|
5
|
+
private readonly host;
|
|
6
|
+
private readonly workspaceId;
|
|
7
|
+
private readonly httpClient;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private readonly userAgent;
|
|
10
|
+
constructor(options: ClientOptions);
|
|
11
|
+
/**
|
|
12
|
+
* Gets the effective permissions for a securable. Includes inherited permissions from any parent securables.
|
|
13
|
+
*
|
|
14
|
+
* NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.
|
|
15
|
+
*
|
|
16
|
+
* PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.
|
|
17
|
+
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
18
|
+
*/
|
|
19
|
+
getEffectivePermissions(req: GetEffectivePermissionsRequest, options?: CallOptions): Promise<GetEffectivePermissionsRequest_Response>;
|
|
20
|
+
/**
|
|
21
|
+
* Gets the permissions for a securable. Does not include inherited permissions.
|
|
22
|
+
*
|
|
23
|
+
* NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.
|
|
24
|
+
*
|
|
25
|
+
* PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.
|
|
26
|
+
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
27
|
+
*/
|
|
28
|
+
getPermissions(req: GetPermissionsRequest, options?: CallOptions): Promise<GetPermissionsRequest_Response>;
|
|
29
|
+
/** Updates the permissions for a securable. */
|
|
30
|
+
updatePermissions(req: UpdatePermissionsRequest, options?: CallOptions): Promise<UpdatePermissionsRequest_Response>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAWlE,OAAO,KAAK,EACV,8BAA8B,EAC9B,uCAAuC,EACvC,qBAAqB,EACrB,8BAA8B,EAC9B,wBAAwB,EACxB,iCAAiC,EAClC,MAAM,SAAS,CAAC;AAcjB,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAI9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAIhC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,EAAE,aAAa;IAelC;;;;;;;OAOG;IACG,uBAAuB,CAC3B,GAAG,EAAE,8BAA8B,EACnC,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,uCAAuC,CAAC;IAuCnD;;;;;;;OAOG;IACG,cAAc,CAClB,GAAG,EAAE,qBAAqB,EAC1B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,8BAA8B,CAAC;IAuC1C,+CAA+C;IACzC,iBAAiB,CACrB,GAAG,EAAE,wBAAwB,EAC7B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,iCAAiC,CAAC;CA2B9C"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
|
|
3
|
+
import { createDefault } from '@databricks/sdk-core/clientinfo';
|
|
4
|
+
import { NoOpLogger } from '@databricks/sdk-core/logger';
|
|
5
|
+
import { newHttpClient } from './transport';
|
|
6
|
+
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
|
|
7
|
+
import pkgJson from '../../package.json' with { type: 'json' };
|
|
8
|
+
import { marshalUpdatePermissionsRequestSchema, unmarshalGetEffectivePermissionsRequest_ResponseSchema, unmarshalGetPermissionsRequest_ResponseSchema, unmarshalUpdatePermissionsRequest_ResponseSchema, } from './model';
|
|
9
|
+
// Package identity segment for this client to be used in the User-Agent header.
|
|
10
|
+
const PACKAGE_SEGMENT = {
|
|
11
|
+
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
12
|
+
value: pkgJson.version,
|
|
13
|
+
};
|
|
14
|
+
export class GrantsClient {
|
|
15
|
+
host;
|
|
16
|
+
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
17
|
+
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
18
|
+
// request.
|
|
19
|
+
workspaceId;
|
|
20
|
+
httpClient;
|
|
21
|
+
logger;
|
|
22
|
+
// User-Agent header value. Composed once at construction from
|
|
23
|
+
// createDefault() merged with this package's identity and the active
|
|
24
|
+
// credential's name.
|
|
25
|
+
userAgent;
|
|
26
|
+
constructor(options) {
|
|
27
|
+
if (options.host === undefined) {
|
|
28
|
+
throw new Error('Host is required.');
|
|
29
|
+
}
|
|
30
|
+
this.host = options.host.replace(/\/$/, '');
|
|
31
|
+
this.workspaceId = options.workspaceId;
|
|
32
|
+
this.logger = options.logger ?? new NoOpLogger();
|
|
33
|
+
const info = createDefault()
|
|
34
|
+
.with(PACKAGE_SEGMENT)
|
|
35
|
+
.with({ key: 'sdk-js-auth', value: AUTH_VERSION })
|
|
36
|
+
.with({ key: 'auth', value: options.credentials?.name() ?? 'default' });
|
|
37
|
+
this.userAgent = info.toString();
|
|
38
|
+
this.httpClient = newHttpClient(options);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Gets the effective permissions for a securable. Includes inherited permissions from any parent securables.
|
|
42
|
+
*
|
|
43
|
+
* NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.
|
|
44
|
+
*
|
|
45
|
+
* PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.
|
|
46
|
+
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
47
|
+
*/
|
|
48
|
+
async getEffectivePermissions(req, options) {
|
|
49
|
+
const url = `${this.host}/api/2.1/unity-catalog/effective-permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;
|
|
50
|
+
const params = new URLSearchParams();
|
|
51
|
+
if (req.principal !== undefined) {
|
|
52
|
+
params.append('principal', req.principal);
|
|
53
|
+
}
|
|
54
|
+
if (req.maxResults !== undefined) {
|
|
55
|
+
params.append('max_results', String(req.maxResults));
|
|
56
|
+
}
|
|
57
|
+
if (req.pageToken !== undefined) {
|
|
58
|
+
params.append('page_token', req.pageToken);
|
|
59
|
+
}
|
|
60
|
+
const query = params.toString();
|
|
61
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
62
|
+
let resp;
|
|
63
|
+
const call = async (callSignal) => {
|
|
64
|
+
const headers = new Headers();
|
|
65
|
+
if (this.workspaceId !== undefined) {
|
|
66
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
67
|
+
}
|
|
68
|
+
headers.set('User-Agent', this.userAgent);
|
|
69
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
70
|
+
const respBody = await executeHttpCall({
|
|
71
|
+
request: httpReq,
|
|
72
|
+
httpClient: this.httpClient,
|
|
73
|
+
logger: this.logger,
|
|
74
|
+
});
|
|
75
|
+
resp = parseResponse(respBody, unmarshalGetEffectivePermissionsRequest_ResponseSchema);
|
|
76
|
+
};
|
|
77
|
+
await executeCall(call, options);
|
|
78
|
+
if (resp === undefined) {
|
|
79
|
+
throw new Error('API call completed without a result.');
|
|
80
|
+
}
|
|
81
|
+
return resp;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Gets the permissions for a securable. Does not include inherited permissions.
|
|
85
|
+
*
|
|
86
|
+
* NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.
|
|
87
|
+
*
|
|
88
|
+
* PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.
|
|
89
|
+
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
90
|
+
*/
|
|
91
|
+
async getPermissions(req, options) {
|
|
92
|
+
const url = `${this.host}/api/2.1/unity-catalog/permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;
|
|
93
|
+
const params = new URLSearchParams();
|
|
94
|
+
if (req.principal !== undefined) {
|
|
95
|
+
params.append('principal', req.principal);
|
|
96
|
+
}
|
|
97
|
+
if (req.maxResults !== undefined) {
|
|
98
|
+
params.append('max_results', String(req.maxResults));
|
|
99
|
+
}
|
|
100
|
+
if (req.pageToken !== undefined) {
|
|
101
|
+
params.append('page_token', req.pageToken);
|
|
102
|
+
}
|
|
103
|
+
const query = params.toString();
|
|
104
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
105
|
+
let resp;
|
|
106
|
+
const call = async (callSignal) => {
|
|
107
|
+
const headers = new Headers();
|
|
108
|
+
if (this.workspaceId !== undefined) {
|
|
109
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
110
|
+
}
|
|
111
|
+
headers.set('User-Agent', this.userAgent);
|
|
112
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
113
|
+
const respBody = await executeHttpCall({
|
|
114
|
+
request: httpReq,
|
|
115
|
+
httpClient: this.httpClient,
|
|
116
|
+
logger: this.logger,
|
|
117
|
+
});
|
|
118
|
+
resp = parseResponse(respBody, unmarshalGetPermissionsRequest_ResponseSchema);
|
|
119
|
+
};
|
|
120
|
+
await executeCall(call, options);
|
|
121
|
+
if (resp === undefined) {
|
|
122
|
+
throw new Error('API call completed without a result.');
|
|
123
|
+
}
|
|
124
|
+
return resp;
|
|
125
|
+
}
|
|
126
|
+
/** Updates the permissions for a securable. */
|
|
127
|
+
async updatePermissions(req, options) {
|
|
128
|
+
const url = `${this.host}/api/2.1/unity-catalog/permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;
|
|
129
|
+
const body = marshalRequest(req, marshalUpdatePermissionsRequestSchema);
|
|
130
|
+
let resp;
|
|
131
|
+
const call = async (callSignal) => {
|
|
132
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
133
|
+
if (this.workspaceId !== undefined) {
|
|
134
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
135
|
+
}
|
|
136
|
+
headers.set('User-Agent', this.userAgent);
|
|
137
|
+
const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
|
|
138
|
+
const respBody = await executeHttpCall({
|
|
139
|
+
request: httpReq,
|
|
140
|
+
httpClient: this.httpClient,
|
|
141
|
+
logger: this.logger,
|
|
142
|
+
});
|
|
143
|
+
resp = parseResponse(respBody, unmarshalUpdatePermissionsRequest_ResponseSchema);
|
|
144
|
+
};
|
|
145
|
+
await executeCall(call, options);
|
|
146
|
+
if (resp === undefined) {
|
|
147
|
+
throw new Error('API call completed without a result.');
|
|
148
|
+
}
|
|
149
|
+
return resp;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAIvD,OAAO,EAAC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
+
export { GrantsClient } from './client';
|
|
2
|
+
export type { EffectivePrivilege, EffectivePrivilegeAssignment, GetEffectivePermissionsRequest, GetEffectivePermissionsRequest_Response, GetPermissionsRequest, GetPermissionsRequest_Response, PermissionsChange, PrivilegeAssignment, UpdatePermissionsRequest, UpdatePermissionsRequest_Response, } from './model';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtC,YAAY,EACV,kBAAkB,EAClB,4BAA4B,EAC5B,8BAA8B,EAC9B,uCAAuC,EACvC,qBAAqB,EACrB,8BAA8B,EAC9B,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,iCAAiC,GAClC,MAAM,SAAS,CAAC"}
|
package/dist/v1/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface EffectivePrivilege {
|
|
3
|
+
/** The privilege assigned to the principal. */
|
|
4
|
+
privilege?: string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* The type of the object that conveys this privilege via inheritance.
|
|
7
|
+
* This field is omitted when privilege is not inherited (it's assigned to the securable itself).
|
|
8
|
+
*/
|
|
9
|
+
inheritedFromType?: string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The full name of the object that conveys this privilege via inheritance.
|
|
12
|
+
* This field is omitted when privilege is not inherited (it's assigned to the securable itself).
|
|
13
|
+
*/
|
|
14
|
+
inheritedFromName?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface EffectivePrivilegeAssignment {
|
|
17
|
+
/** The principal (user email address or group name). */
|
|
18
|
+
principal?: string | undefined;
|
|
19
|
+
/** The privileges conveyed to the principal (either directly or via inheritance). */
|
|
20
|
+
privileges?: EffectivePrivilege[] | undefined;
|
|
21
|
+
}
|
|
22
|
+
export interface GetEffectivePermissionsRequest {
|
|
23
|
+
/** Type of securable. */
|
|
24
|
+
securableType?: string | undefined;
|
|
25
|
+
/** Full name of securable. */
|
|
26
|
+
securableFullName?: string | undefined;
|
|
27
|
+
/** If provided, only the effective permissions for the specified principal (user or group) are returned. */
|
|
28
|
+
principal?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Specifies the maximum number of privileges to return (page length).
|
|
31
|
+
* Every EffectivePrivilegeAssignment present in a single page response is guaranteed to contain all the effective
|
|
32
|
+
* privileges granted on (or inherited by) the requested Securable for the respective principal.
|
|
33
|
+
*
|
|
34
|
+
* If not set, all the effective permissions are returned.
|
|
35
|
+
* If set to
|
|
36
|
+
* - lesser than 0: invalid parameter error
|
|
37
|
+
* - 0: page length is set to a server configured value
|
|
38
|
+
* - lesser than 150 but greater than 0: invalid parameter error (this is to ensure that server is able to return at
|
|
39
|
+
* least one complete EffectivePrivilegeAssignment in a single page response)
|
|
40
|
+
* - greater than (or equal to) 150: page length is the minimum of this value and a server configured value
|
|
41
|
+
*/
|
|
42
|
+
maxResults?: number | undefined;
|
|
43
|
+
/** Opaque token for the next page of results (pagination). */
|
|
44
|
+
pageToken?: string | undefined;
|
|
45
|
+
}
|
|
46
|
+
export interface GetEffectivePermissionsRequest_Response {
|
|
47
|
+
/**
|
|
48
|
+
* Opaque token to retrieve the next page of results. Absent if there are no more pages.
|
|
49
|
+
* __page_token__ should be set to this value for the next request (for the next page of results).
|
|
50
|
+
*/
|
|
51
|
+
nextPageToken?: string | undefined;
|
|
52
|
+
/** The privileges conveyed to each principal (either directly or via inheritance) */
|
|
53
|
+
privilegeAssignments?: EffectivePrivilegeAssignment[] | undefined;
|
|
54
|
+
}
|
|
55
|
+
export interface GetPermissionsRequest {
|
|
56
|
+
/** Type of securable. */
|
|
57
|
+
securableType?: string | undefined;
|
|
58
|
+
/** Full name of securable. */
|
|
59
|
+
securableFullName?: string | undefined;
|
|
60
|
+
/** If provided, only the permissions for the specified principal (user or group) are returned. */
|
|
61
|
+
principal?: string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Specifies the maximum number of privileges to return (page length).
|
|
64
|
+
* Every PrivilegeAssignment present in a single page response is guaranteed to contain all the privileges granted on
|
|
65
|
+
* the requested Securable for the respective principal.
|
|
66
|
+
*
|
|
67
|
+
* If not set, all the permissions are returned.
|
|
68
|
+
* If set to
|
|
69
|
+
* - lesser than 0: invalid parameter error
|
|
70
|
+
* - 0: page length is set to a server configured value
|
|
71
|
+
* - lesser than 150 but greater than 0: invalid parameter error (this is to ensure that server is able to return at
|
|
72
|
+
* least one complete PrivilegeAssignment in a single page response)
|
|
73
|
+
* - greater than (or equal to) 150: page length is the minimum of this value and a server configured value
|
|
74
|
+
*/
|
|
75
|
+
maxResults?: number | undefined;
|
|
76
|
+
/** Opaque pagination token to go to next page based on previous query. */
|
|
77
|
+
pageToken?: string | undefined;
|
|
78
|
+
}
|
|
79
|
+
export interface GetPermissionsRequest_Response {
|
|
80
|
+
/**
|
|
81
|
+
* Opaque token to retrieve the next page of results. Absent if there are no more pages.
|
|
82
|
+
* __page_token__ should be set to this value for the next request (for the next page of results).
|
|
83
|
+
*/
|
|
84
|
+
nextPageToken?: string | undefined;
|
|
85
|
+
/** The privileges assigned to each principal */
|
|
86
|
+
privilegeAssignments?: PrivilegeAssignment[] | undefined;
|
|
87
|
+
}
|
|
88
|
+
export interface PermissionsChange {
|
|
89
|
+
/**
|
|
90
|
+
* The principal whose privileges we are changing.
|
|
91
|
+
* Only one of principal or principal_id should be specified, never both at the same time.
|
|
92
|
+
*/
|
|
93
|
+
principal?: string | undefined;
|
|
94
|
+
/** The set of privileges to add. */
|
|
95
|
+
add?: string[] | undefined;
|
|
96
|
+
/** The set of privileges to remove. */
|
|
97
|
+
remove?: string[] | undefined;
|
|
98
|
+
}
|
|
99
|
+
export interface PrivilegeAssignment {
|
|
100
|
+
/**
|
|
101
|
+
* The principal (user email address or group name).
|
|
102
|
+
* For deleted principals, `principal` is empty while `principal_id` is populated.
|
|
103
|
+
*/
|
|
104
|
+
principal?: string | undefined;
|
|
105
|
+
/** The privileges assigned to the principal. */
|
|
106
|
+
privileges?: string[] | undefined;
|
|
107
|
+
}
|
|
108
|
+
export interface UpdatePermissionsRequest {
|
|
109
|
+
/** Type of securable. */
|
|
110
|
+
securableType?: string | undefined;
|
|
111
|
+
/** Full name of securable. */
|
|
112
|
+
securableFullName?: string | undefined;
|
|
113
|
+
/** Array of permissions change objects. */
|
|
114
|
+
changes?: PermissionsChange[] | undefined;
|
|
115
|
+
}
|
|
116
|
+
export interface UpdatePermissionsRequest_Response {
|
|
117
|
+
/** The privileges assigned to each principal */
|
|
118
|
+
privilegeAssignments?: PrivilegeAssignment[] | undefined;
|
|
119
|
+
}
|
|
120
|
+
export declare const unmarshalEffectivePrivilegeSchema: z.ZodType<EffectivePrivilege>;
|
|
121
|
+
export declare const unmarshalEffectivePrivilegeAssignmentSchema: z.ZodType<EffectivePrivilegeAssignment>;
|
|
122
|
+
export declare const unmarshalGetEffectivePermissionsRequest_ResponseSchema: z.ZodType<GetEffectivePermissionsRequest_Response>;
|
|
123
|
+
export declare const unmarshalGetPermissionsRequest_ResponseSchema: z.ZodType<GetPermissionsRequest_Response>;
|
|
124
|
+
export declare const unmarshalPrivilegeAssignmentSchema: z.ZodType<PrivilegeAssignment>;
|
|
125
|
+
export declare const unmarshalUpdatePermissionsRequest_ResponseSchema: z.ZodType<UpdatePermissionsRequest_Response>;
|
|
126
|
+
export declare const marshalPermissionsChangeSchema: z.ZodType;
|
|
127
|
+
export declare const marshalUpdatePermissionsRequestSchema: z.ZodType;
|
|
128
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|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AC;AAGR,eAAO,MAAM,sDAAsD,EAAE,CAAC,CAAC,OAAO,CAAC,uCAAuC,CAW/G,CAAC;AAGR,eAAO,MAAM,6CAA6C,EAAE,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAW7F,CAAC;AAER,eAAO,MAAM,kCAAkC,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CASvE,CAAC;AAGR,eAAO,MAAM,gDAAgD,EAAE,CAAC,CAAC,OAAO,CAAC,iCAAiC,CASnG,CAAC;AAER,eAAO,MAAM,8BAA8B,EAAE,CAAC,CAAC,OAU1C,CAAC;AAEN,eAAO,MAAM,qCAAqC,EAAE,CAAC,CAAC,OAUjD,CAAC"}
|
package/dist/v1/model.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const unmarshalEffectivePrivilegeSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
privilege: z.string().optional(),
|
|
6
|
+
inherited_from_type: z.string().optional(),
|
|
7
|
+
inherited_from_name: z.string().optional(),
|
|
8
|
+
})
|
|
9
|
+
.transform(d => ({
|
|
10
|
+
privilege: d.privilege,
|
|
11
|
+
inheritedFromType: d.inherited_from_type,
|
|
12
|
+
inheritedFromName: d.inherited_from_name,
|
|
13
|
+
}));
|
|
14
|
+
export const unmarshalEffectivePrivilegeAssignmentSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
principal: z.string().optional(),
|
|
17
|
+
privileges: z
|
|
18
|
+
.array(z.lazy(() => unmarshalEffectivePrivilegeSchema))
|
|
19
|
+
.optional(),
|
|
20
|
+
})
|
|
21
|
+
.transform(d => ({
|
|
22
|
+
principal: d.principal,
|
|
23
|
+
privileges: d.privileges,
|
|
24
|
+
}));
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
26
|
+
export const unmarshalGetEffectivePermissionsRequest_ResponseSchema = z
|
|
27
|
+
.object({
|
|
28
|
+
next_page_token: z.string().optional(),
|
|
29
|
+
privilege_assignments: z
|
|
30
|
+
.array(z.lazy(() => unmarshalEffectivePrivilegeAssignmentSchema))
|
|
31
|
+
.optional(),
|
|
32
|
+
})
|
|
33
|
+
.transform(d => ({
|
|
34
|
+
nextPageToken: d.next_page_token,
|
|
35
|
+
privilegeAssignments: d.privilege_assignments,
|
|
36
|
+
}));
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
38
|
+
export const unmarshalGetPermissionsRequest_ResponseSchema = z
|
|
39
|
+
.object({
|
|
40
|
+
next_page_token: z.string().optional(),
|
|
41
|
+
privilege_assignments: z
|
|
42
|
+
.array(z.lazy(() => unmarshalPrivilegeAssignmentSchema))
|
|
43
|
+
.optional(),
|
|
44
|
+
})
|
|
45
|
+
.transform(d => ({
|
|
46
|
+
nextPageToken: d.next_page_token,
|
|
47
|
+
privilegeAssignments: d.privilege_assignments,
|
|
48
|
+
}));
|
|
49
|
+
export const unmarshalPrivilegeAssignmentSchema = z
|
|
50
|
+
.object({
|
|
51
|
+
principal: z.string().optional(),
|
|
52
|
+
privileges: z.array(z.string()).optional(),
|
|
53
|
+
})
|
|
54
|
+
.transform(d => ({
|
|
55
|
+
principal: d.principal,
|
|
56
|
+
privileges: d.privileges,
|
|
57
|
+
}));
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
59
|
+
export const unmarshalUpdatePermissionsRequest_ResponseSchema = z
|
|
60
|
+
.object({
|
|
61
|
+
privilege_assignments: z
|
|
62
|
+
.array(z.lazy(() => unmarshalPrivilegeAssignmentSchema))
|
|
63
|
+
.optional(),
|
|
64
|
+
})
|
|
65
|
+
.transform(d => ({
|
|
66
|
+
privilegeAssignments: d.privilege_assignments,
|
|
67
|
+
}));
|
|
68
|
+
export const marshalPermissionsChangeSchema = z
|
|
69
|
+
.object({
|
|
70
|
+
principal: z.string().optional(),
|
|
71
|
+
add: z.array(z.string()).optional(),
|
|
72
|
+
remove: z.array(z.string()).optional(),
|
|
73
|
+
})
|
|
74
|
+
.transform(d => ({
|
|
75
|
+
principal: d.principal,
|
|
76
|
+
add: d.add,
|
|
77
|
+
remove: d.remove,
|
|
78
|
+
}));
|
|
79
|
+
export const marshalUpdatePermissionsRequestSchema = z
|
|
80
|
+
.object({
|
|
81
|
+
securableType: z.string().optional(),
|
|
82
|
+
securableFullName: z.string().optional(),
|
|
83
|
+
changes: z.array(z.lazy(() => marshalPermissionsChangeSchema)).optional(),
|
|
84
|
+
})
|
|
85
|
+
.transform(d => ({
|
|
86
|
+
securable_type: d.securableType,
|
|
87
|
+
securable_full_name: d.securableFullName,
|
|
88
|
+
changes: d.changes,
|
|
89
|
+
}));
|
|
90
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAqItB,MAAM,CAAC,MAAM,iCAAiC,GAC5C,CAAC;KACE,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC;KACD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,SAAS,EAAE,CAAC,CAAC,SAAS;IACtB,iBAAiB,EAAE,CAAC,CAAC,mBAAmB;IACxC,iBAAiB,EAAE,CAAC,CAAC,mBAAmB;CACzC,CAAC,CAAC,CAAC;AAER,MAAM,CAAC,MAAM,2CAA2C,GACtD,CAAC;KACE,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM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