@databricks/sdk-uc-grants 0.52.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.js +1 -1
- package/dist/v1/client.d.ts +2 -2
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +38 -34
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +1 -1
- package/dist/v1/index.js +2 -1
- package/dist/v1/model.d.ts +105 -14
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +281 -16
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +18 -5
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +51 -24
- package/dist/v1/transport.js.map +1 -1
- package/dist/v1/utils.d.ts +11 -5
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +33 -7
- package/dist/v1/utils.js.map +1 -1
- package/package.json +4 -4
package/dist/package.js
CHANGED
package/dist/v1/client.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EffectivePrivilegeAssignment, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetPermissionsRequest, GetPermissionsResponse, ListEffectivePrivilegeAssignmentsRequest, ListEffectivePrivilegeAssignmentsResponse, ListPrivilegeAssignmentsRequest, ListPrivilegeAssignmentsResponse, PrivilegeAssignment, UpdatePermissionsRequest, UpdatePermissionsResponse } from "./model.js";
|
|
2
|
-
import { CallOptions } from "@databricks/sdk-options/call";
|
|
3
2
|
import { ClientOptions } from "@databricks/sdk-options/client";
|
|
3
|
+
import { CallOptions } from "@databricks/sdk-options/call";
|
|
4
4
|
|
|
5
5
|
//#region src/v1/client.d.ts
|
|
6
6
|
declare class GrantsClient {
|
|
7
7
|
private readonly options;
|
|
8
8
|
private readonly logger;
|
|
9
|
-
private readonly
|
|
9
|
+
private readonly clientInfo;
|
|
10
10
|
private config;
|
|
11
11
|
constructor(options: ClientOptions);
|
|
12
12
|
private resolveConfig;
|
package/dist/v1/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;cAiDa,YAAA;EAAA,iBACM,OAAA;EAAA,iBACA,MAAA;EAAA,iBAIA,UAAA;EAAA,QAIT,MAAA;cAEI,OAAA,EAAS,aAAA;EAAA,QASb,aAAA;EAeI;;;;;;;;EAFN,uBAAA,CACJ,GAAA,EAAK,8BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,+BAAA;EAqGA;;;;;;;;EAlDL,cAAA,CACJ,GAAA,EAAK,qBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,sBAAA;EAwHR;;;;EA5EG,iCAAA,CACJ,GAAA,EAAK,wCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,yCAAA;EA8CJ,qCAAA,CACL,GAAA,EAAK,wCAAA,EACL,OAAA,GAAU,WAAA,GACT,cAAA,CAAe,4BAAA;EA0FN;;;;EArEN,wBAAA,CACJ,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,gCAAA;EA8CJ,4BAAA,CACL,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,cAAA,CAAe,mBAAA;EAlQD;EAiRX,iBAAA,CACJ,GAAA,EAAK,wBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,yBAAA;AAAA"}
|
package/dist/v1/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveClientConfig } from "./transport.js";
|
|
2
|
-
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
|
|
1
|
+
import { checkClientOptions, resolveClientConfig } from "./transport.js";
|
|
2
|
+
import { buildHttpRequest, encodePathVariable, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
|
|
3
3
|
import { name, version } from "../package.js";
|
|
4
4
|
import { marshalUpdatePermissionsRequestSchema, unmarshalGetEffectivePermissionsResponseSchema, unmarshalGetPermissionsResponseSchema, unmarshalListEffectivePrivilegeAssignmentsResponseSchema, unmarshalListPrivilegeAssignmentsResponseSchema, unmarshalUpdatePermissionsResponseSchema } from "./model.js";
|
|
5
5
|
import { VERSION } from "@databricks/sdk-auth";
|
|
@@ -14,21 +14,19 @@ const PACKAGE_SEGMENT = {
|
|
|
14
14
|
var GrantsClient = class {
|
|
15
15
|
options;
|
|
16
16
|
logger;
|
|
17
|
-
|
|
17
|
+
clientInfo;
|
|
18
18
|
config;
|
|
19
19
|
constructor(options) {
|
|
20
|
+
checkClientOptions(options);
|
|
20
21
|
this.options = options;
|
|
21
22
|
this.logger = options.logger ?? new NoOpLogger();
|
|
22
|
-
this.
|
|
23
|
+
this.clientInfo = createDefault().with(PACKAGE_SEGMENT).with({
|
|
23
24
|
key: "sdk-js-auth",
|
|
24
25
|
value: VERSION
|
|
25
|
-
})
|
|
26
|
-
key: "auth",
|
|
27
|
-
value: options.credentials?.name() ?? "default"
|
|
28
|
-
}).toString();
|
|
26
|
+
});
|
|
29
27
|
}
|
|
30
28
|
resolveConfig() {
|
|
31
|
-
this.config ??= resolveClientConfig(this.options);
|
|
29
|
+
this.config ??= resolveClientConfig(this.options, this.clientInfo);
|
|
32
30
|
return this.config;
|
|
33
31
|
}
|
|
34
32
|
/**
|
|
@@ -40,26 +38,27 @@ var GrantsClient = class {
|
|
|
40
38
|
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
41
39
|
*/
|
|
42
40
|
async getEffectivePermissions(req, options) {
|
|
43
|
-
|
|
44
|
-
const
|
|
41
|
+
if (req.securableType === void 0) throw new Error("path parameter \"securable_type\" is required");
|
|
42
|
+
const { host, workspaceId, httpClient, timeout } = await this.resolveConfig();
|
|
43
|
+
const url = `${host}/api/2.1/unity-catalog/effective-permissions/${encodePathVariable(req.securableType)}/${encodePathVariable(req.securableFullName ?? "")}`;
|
|
45
44
|
const params = new URLSearchParams();
|
|
46
45
|
if (req.principal !== void 0) params.append("principal", req.principal);
|
|
47
46
|
if (req.maxResults !== void 0) params.append("max_results", String(req.maxResults));
|
|
48
47
|
if (req.pageToken !== void 0) params.append("page_token", req.pageToken);
|
|
48
|
+
params.sort();
|
|
49
49
|
const query = params.toString();
|
|
50
50
|
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
51
51
|
let resp;
|
|
52
52
|
const call = async (callSignal) => {
|
|
53
53
|
const headers = new Headers();
|
|
54
|
-
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
55
|
-
headers.set("User-Agent", this.userAgent);
|
|
54
|
+
if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
56
55
|
resp = parseResponse(await executeHttpCall({
|
|
57
56
|
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
58
57
|
httpClient,
|
|
59
58
|
logger: this.logger
|
|
60
59
|
}), unmarshalGetEffectivePermissionsResponseSchema);
|
|
61
60
|
};
|
|
62
|
-
await executeCall(call, options);
|
|
61
|
+
await executeCall(call, options, timeout);
|
|
63
62
|
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
64
63
|
return resp;
|
|
65
64
|
}
|
|
@@ -72,26 +71,27 @@ var GrantsClient = class {
|
|
|
72
71
|
* Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
|
|
73
72
|
*/
|
|
74
73
|
async getPermissions(req, options) {
|
|
75
|
-
|
|
76
|
-
const
|
|
74
|
+
if (req.securableType === void 0) throw new Error("path parameter \"securable_type\" is required");
|
|
75
|
+
const { host, workspaceId, httpClient, timeout } = await this.resolveConfig();
|
|
76
|
+
const url = `${host}/api/2.1/unity-catalog/permissions/${encodePathVariable(req.securableType)}/${encodePathVariable(req.securableFullName ?? "")}`;
|
|
77
77
|
const params = new URLSearchParams();
|
|
78
78
|
if (req.principal !== void 0) params.append("principal", req.principal);
|
|
79
79
|
if (req.maxResults !== void 0) params.append("max_results", String(req.maxResults));
|
|
80
80
|
if (req.pageToken !== void 0) params.append("page_token", req.pageToken);
|
|
81
|
+
params.sort();
|
|
81
82
|
const query = params.toString();
|
|
82
83
|
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
83
84
|
let resp;
|
|
84
85
|
const call = async (callSignal) => {
|
|
85
86
|
const headers = new Headers();
|
|
86
|
-
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
87
|
-
headers.set("User-Agent", this.userAgent);
|
|
87
|
+
if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
88
88
|
resp = parseResponse(await executeHttpCall({
|
|
89
89
|
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
90
90
|
httpClient,
|
|
91
91
|
logger: this.logger
|
|
92
92
|
}), unmarshalGetPermissionsResponseSchema);
|
|
93
93
|
};
|
|
94
|
-
await executeCall(call, options);
|
|
94
|
+
await executeCall(call, options, timeout);
|
|
95
95
|
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
96
96
|
return resp;
|
|
97
97
|
}
|
|
@@ -100,26 +100,28 @@ var GrantsClient = class {
|
|
|
100
100
|
* Paginated version of Get Effective Permissions API.
|
|
101
101
|
*/
|
|
102
102
|
async listEffectivePrivilegeAssignments(req, options) {
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
if (req.securableType === void 0) throw new Error("path parameter \"securable_type\" is required");
|
|
104
|
+
if (req.fullName === void 0) throw new Error("path parameter \"full_name\" is required");
|
|
105
|
+
const { host, workspaceId, httpClient, timeout } = await this.resolveConfig();
|
|
106
|
+
const url = `${host}/api/2.1/unity-catalog/effective-privilege-assignments/${encodePathVariable(req.securableType)}/${encodePathVariable(req.fullName)}`;
|
|
105
107
|
const params = new URLSearchParams();
|
|
106
108
|
if (req.principal !== void 0) params.append("principal", req.principal);
|
|
107
109
|
if (req.pageSize !== void 0) params.append("page_size", String(req.pageSize));
|
|
108
110
|
if (req.pageToken !== void 0) params.append("page_token", req.pageToken);
|
|
111
|
+
params.sort();
|
|
109
112
|
const query = params.toString();
|
|
110
113
|
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
111
114
|
let resp;
|
|
112
115
|
const call = async (callSignal) => {
|
|
113
116
|
const headers = new Headers();
|
|
114
|
-
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
115
|
-
headers.set("User-Agent", this.userAgent);
|
|
117
|
+
if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
116
118
|
resp = parseResponse(await executeHttpCall({
|
|
117
119
|
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
118
120
|
httpClient,
|
|
119
121
|
logger: this.logger
|
|
120
122
|
}), unmarshalListEffectivePrivilegeAssignmentsResponseSchema);
|
|
121
123
|
};
|
|
122
|
-
await executeCall(call, options);
|
|
124
|
+
await executeCall(call, options, timeout);
|
|
123
125
|
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
124
126
|
return resp;
|
|
125
127
|
}
|
|
@@ -137,26 +139,28 @@ var GrantsClient = class {
|
|
|
137
139
|
* Paginated version of Get Permissions API.
|
|
138
140
|
*/
|
|
139
141
|
async listPrivilegeAssignments(req, options) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
if (req.securableType === void 0) throw new Error("path parameter \"securable_type\" is required");
|
|
143
|
+
if (req.fullName === void 0) throw new Error("path parameter \"full_name\" is required");
|
|
144
|
+
const { host, workspaceId, httpClient, timeout } = await this.resolveConfig();
|
|
145
|
+
const url = `${host}/api/2.1/unity-catalog/privilege-assignments/${encodePathVariable(req.securableType)}/${encodePathVariable(req.fullName)}`;
|
|
142
146
|
const params = new URLSearchParams();
|
|
143
147
|
if (req.principal !== void 0) params.append("principal", req.principal);
|
|
144
148
|
if (req.pageSize !== void 0) params.append("page_size", String(req.pageSize));
|
|
145
149
|
if (req.pageToken !== void 0) params.append("page_token", req.pageToken);
|
|
150
|
+
params.sort();
|
|
146
151
|
const query = params.toString();
|
|
147
152
|
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
148
153
|
let resp;
|
|
149
154
|
const call = async (callSignal) => {
|
|
150
155
|
const headers = new Headers();
|
|
151
|
-
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
152
|
-
headers.set("User-Agent", this.userAgent);
|
|
156
|
+
if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
153
157
|
resp = parseResponse(await executeHttpCall({
|
|
154
158
|
request: buildHttpRequest("GET", fullUrl, headers, callSignal),
|
|
155
159
|
httpClient,
|
|
156
160
|
logger: this.logger
|
|
157
161
|
}), unmarshalListPrivilegeAssignmentsResponseSchema);
|
|
158
162
|
};
|
|
159
|
-
await executeCall(call, options);
|
|
163
|
+
await executeCall(call, options, timeout);
|
|
160
164
|
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
161
165
|
return resp;
|
|
162
166
|
}
|
|
@@ -171,21 +175,21 @@ var GrantsClient = class {
|
|
|
171
175
|
}
|
|
172
176
|
/** Updates the permissions for a securable. */
|
|
173
177
|
async updatePermissions(req, options) {
|
|
174
|
-
|
|
175
|
-
const
|
|
178
|
+
if (req.securableType === void 0) throw new Error("path parameter \"securable_type\" is required");
|
|
179
|
+
const { host, workspaceId, httpClient, timeout } = await this.resolveConfig();
|
|
180
|
+
const url = `${host}/api/2.1/unity-catalog/permissions/${encodePathVariable(req.securableType)}/${encodePathVariable(req.securableFullName ?? "")}`;
|
|
176
181
|
const body = marshalRequest(req, marshalUpdatePermissionsRequestSchema);
|
|
177
182
|
let resp;
|
|
178
183
|
const call = async (callSignal) => {
|
|
179
184
|
const headers = new Headers({ "Content-Type": "application/json" });
|
|
180
|
-
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
181
|
-
headers.set("User-Agent", this.userAgent);
|
|
185
|
+
if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
182
186
|
resp = parseResponse(await executeHttpCall({
|
|
183
187
|
request: buildHttpRequest("PATCH", url, headers, callSignal, body),
|
|
184
188
|
httpClient,
|
|
185
189
|
logger: this.logger
|
|
186
190
|
}), unmarshalUpdatePermissionsResponseSchema);
|
|
187
191
|
};
|
|
188
|
-
await executeCall(call, options);
|
|
192
|
+
await executeCall(call, options, timeout);
|
|
189
193
|
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
190
194
|
return resp;
|
|
191
195
|
}
|
package/dist/v1/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n EffectivePrivilegeAssignment,\n GetEffectivePermissionsRequest,\n GetEffectivePermissionsResponse,\n GetPermissionsRequest,\n GetPermissionsResponse,\n ListEffectivePrivilegeAssignmentsRequest,\n ListEffectivePrivilegeAssignmentsResponse,\n ListPrivilegeAssignmentsRequest,\n ListPrivilegeAssignmentsResponse,\n PrivilegeAssignment,\n UpdatePermissionsRequest,\n UpdatePermissionsResponse,\n} from './model';\nimport {\n marshalUpdatePermissionsRequestSchema,\n unmarshalGetEffectivePermissionsResponseSchema,\n unmarshalGetPermissionsResponseSchema,\n unmarshalListEffectivePrivilegeAssignmentsResponseSchema,\n unmarshalListPrivilegeAssignmentsResponseSchema,\n unmarshalUpdatePermissionsResponseSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class GrantsClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent header value. Composed once at construction from\n // createDefault() merged with this package's identity and the active\n // credential's name.\n private readonly userAgent: string;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n const info = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION})\n .with({key: 'auth', value: options.credentials?.name() ?? 'default'});\n this.userAgent = info.toString();\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options);\n return this.config;\n }\n\n /**\n * Gets the effective permissions for a securable. Includes inherited permissions from any parent securables.\n *\n * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.\n *\n * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async getEffectivePermissions(\n req: GetEffectivePermissionsRequest,\n options?: CallOptions\n ): Promise<GetEffectivePermissionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/effective-permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: GetEffectivePermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalGetEffectivePermissionsResponseSchema\n );\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Gets the permissions for a securable. Does not include inherited permissions.\n *\n * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.\n *\n * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async getPermissions(\n req: GetPermissionsRequest,\n options?: CallOptions\n ): Promise<GetPermissionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: GetPermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalGetPermissionsResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Lists the effective privilege assignments for a securable. Includes inherited privileges.\n * Paginated version of Get Effective Permissions API.\n */\n async listEffectivePrivilegeAssignments(\n req: ListEffectivePrivilegeAssignmentsRequest,\n options?: CallOptions\n ): Promise<ListEffectivePrivilegeAssignmentsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/effective-privilege-assignments/${req.securableType ?? ''}/${req.fullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListEffectivePrivilegeAssignmentsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalListEffectivePrivilegeAssignmentsResponseSchema\n );\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listEffectivePrivilegeAssignmentsIter(\n req: ListEffectivePrivilegeAssignmentsRequest,\n options?: CallOptions\n ): AsyncGenerator<EffectivePrivilegeAssignment> {\n const pageReq: ListEffectivePrivilegeAssignmentsRequest = {...req};\n for (;;) {\n const resp = await this.listEffectivePrivilegeAssignments(\n pageReq,\n options\n );\n for (const item of resp.effectivePrivilegeAssignments ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /**\n * Lists the privilege assignments for a securable. Does not include inherited privileges.\n * Paginated version of Get Permissions API.\n */\n async listPrivilegeAssignments(\n req: ListPrivilegeAssignmentsRequest,\n options?: CallOptions\n ): Promise<ListPrivilegeAssignmentsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/privilege-assignments/${req.securableType ?? ''}/${req.fullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListPrivilegeAssignmentsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalListPrivilegeAssignmentsResponseSchema\n );\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listPrivilegeAssignmentsIter(\n req: ListPrivilegeAssignmentsRequest,\n options?: CallOptions\n ): AsyncGenerator<PrivilegeAssignment> {\n const pageReq: ListPrivilegeAssignmentsRequest = {...req};\n for (;;) {\n const resp = await this.listPrivilegeAssignments(pageReq, options);\n for (const item of resp.privilegeAssignments ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /** Updates the permissions for a securable. */\n async updatePermissions(\n req: UpdatePermissionsRequest,\n options?: CallOptions\n ): Promise<UpdatePermissionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;\n const body = marshalRequest(req, marshalUpdatePermissionsRequestSchema);\n let resp: UpdatePermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalUpdatePermissionsResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n}\n"],"mappings":";;;;;;;;;AA0CA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,eAAb,MAA0B;CACxB,AAAiB;CACjB,AAAiB;CAIjB,AAAiB;CAIjB,AAAQ;CAER,YAAY,SAAwB;AAClC,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,IAAI,YAAY;AAKhD,OAAK,YAJQ,eAAe,CACzB,KAAK,gBAAgB,CACrB,KAAK;GAAC,KAAK;GAAe,OAAOC;GAAa,CAAC,CAC/C,KAAK;GAAC,KAAK;GAAQ,OAAO,QAAQ,aAAa,MAAM,IAAI;GAAU,CAAC,CACjD,UAAU;;CAGl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AS,WAAW;IAGnE;IACA,QAAQ,KAAK;IACd,CAAC,EAGA,gDACD;;AAEH,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;CAGT,OAAO,6BACL,KACA,SACqC;EACrC,MAAM,UAA2C,EAAC,GAAG,KAAI;AACzD,WAAS;GACP,MAAM,OAAO,MAAM,KAAK,yBAAyB,SAAS,QAAQ;AAClE,QAAK,MAAM,QAAQ,KAAK,wBAAwB,EAAE,CAChD,OAAM;AAER,OAAI,KAAK,kBAAkB,UAAa,KAAK,kBAAkB,GAC7D;AAEF,WAAQ,YAAY,KAAK;;;;CAK7B,MAAM,kBACJ,KACA,SACoC;EACpC,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK,qCAAqC,IAAI,iBAAiB,GAAG,GAAG,IAAI,qBAAqB;EAC7G,MAAM,OAAO,eAAe,KAAK,sCAAsC;EACvE,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,QAAQ,EAAC,gBAAgB,oBAAmB,CAAC;AACjE,OAAI,gBAAgB,OAClB,SAAQ,IAAI,6BAA6B,YAAY;AAEvD,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,SAAS,KAAK,SAAS,YAAY,KAAK;IAGvE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,yCAAyC;;AAE1E,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport type {ClientInfo} from '@databricks/sdk-core/clientinfo';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {checkClientOptions, resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n encodePathVariable,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n EffectivePrivilegeAssignment,\n GetEffectivePermissionsRequest,\n GetEffectivePermissionsResponse,\n GetPermissionsRequest,\n GetPermissionsResponse,\n ListEffectivePrivilegeAssignmentsRequest,\n ListEffectivePrivilegeAssignmentsResponse,\n ListPrivilegeAssignmentsRequest,\n ListPrivilegeAssignmentsResponse,\n PrivilegeAssignment,\n UpdatePermissionsRequest,\n UpdatePermissionsResponse,\n} from './model';\nimport {\n marshalUpdatePermissionsRequestSchema,\n unmarshalGetEffectivePermissionsResponseSchema,\n unmarshalGetPermissionsResponseSchema,\n unmarshalListEffectivePrivilegeAssignmentsResponseSchema,\n unmarshalListPrivilegeAssignmentsResponseSchema,\n unmarshalUpdatePermissionsResponseSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class GrantsClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent segments, composed once at construction from createDefault()\n // merged with this package's identity. Each request adds the auth method,\n // which default credentials choose only when they first sign a request.\n private readonly clientInfo: ClientInfo;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n checkClientOptions(options);\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n this.clientInfo = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION});\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options, this.clientInfo);\n return this.config;\n }\n\n /**\n * Gets the effective permissions for a securable. Includes inherited permissions from any parent securables.\n *\n * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.\n *\n * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async getEffectivePermissions(\n req: GetEffectivePermissionsRequest,\n options?: CallOptions\n ): Promise<GetEffectivePermissionsResponse> {\n if (req.securableType === undefined) {\n throw new Error('path parameter \"securable_type\" is required');\n }\n const {host, workspaceId, httpClient, timeout} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/effective-permissions/${encodePathVariable(req.securableType)}/${encodePathVariable(req.securableFullName ?? '')}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n params.sort();\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: GetEffectivePermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalGetEffectivePermissionsResponseSchema\n );\n };\n await executeCall(call, options, timeout);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Gets the permissions for a securable. Does not include inherited permissions.\n *\n * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.\n *\n * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async getPermissions(\n req: GetPermissionsRequest,\n options?: CallOptions\n ): Promise<GetPermissionsResponse> {\n if (req.securableType === undefined) {\n throw new Error('path parameter \"securable_type\" is required');\n }\n const {host, workspaceId, httpClient, timeout} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/permissions/${encodePathVariable(req.securableType)}/${encodePathVariable(req.securableFullName ?? '')}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n params.sort();\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: GetPermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalGetPermissionsResponseSchema);\n };\n await executeCall(call, options, timeout);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Lists the effective privilege assignments for a securable. Includes inherited privileges.\n * Paginated version of Get Effective Permissions API.\n */\n async listEffectivePrivilegeAssignments(\n req: ListEffectivePrivilegeAssignmentsRequest,\n options?: CallOptions\n ): Promise<ListEffectivePrivilegeAssignmentsResponse> {\n if (req.securableType === undefined) {\n throw new Error('path parameter \"securable_type\" is required');\n }\n if (req.fullName === undefined) {\n throw new Error('path parameter \"full_name\" is required');\n }\n const {host, workspaceId, httpClient, timeout} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/effective-privilege-assignments/${encodePathVariable(req.securableType)}/${encodePathVariable(req.fullName)}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n params.sort();\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListEffectivePrivilegeAssignmentsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalListEffectivePrivilegeAssignmentsResponseSchema\n );\n };\n await executeCall(call, options, timeout);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listEffectivePrivilegeAssignmentsIter(\n req: ListEffectivePrivilegeAssignmentsRequest,\n options?: CallOptions\n ): AsyncGenerator<EffectivePrivilegeAssignment> {\n const pageReq: ListEffectivePrivilegeAssignmentsRequest = {...req};\n for (;;) {\n const resp = await this.listEffectivePrivilegeAssignments(\n pageReq,\n options\n );\n for (const item of resp.effectivePrivilegeAssignments ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /**\n * Lists the privilege assignments for a securable. Does not include inherited privileges.\n * Paginated version of Get Permissions API.\n */\n async listPrivilegeAssignments(\n req: ListPrivilegeAssignmentsRequest,\n options?: CallOptions\n ): Promise<ListPrivilegeAssignmentsResponse> {\n if (req.securableType === undefined) {\n throw new Error('path parameter \"securable_type\" is required');\n }\n if (req.fullName === undefined) {\n throw new Error('path parameter \"full_name\" is required');\n }\n const {host, workspaceId, httpClient, timeout} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/privilege-assignments/${encodePathVariable(req.securableType)}/${encodePathVariable(req.fullName)}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n params.sort();\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListPrivilegeAssignmentsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalListPrivilegeAssignmentsResponseSchema\n );\n };\n await executeCall(call, options, timeout);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listPrivilegeAssignmentsIter(\n req: ListPrivilegeAssignmentsRequest,\n options?: CallOptions\n ): AsyncGenerator<PrivilegeAssignment> {\n const pageReq: ListPrivilegeAssignmentsRequest = {...req};\n for (;;) {\n const resp = await this.listPrivilegeAssignments(pageReq, options);\n for (const item of resp.privilegeAssignments ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /** Updates the permissions for a securable. */\n async updatePermissions(\n req: UpdatePermissionsRequest,\n options?: CallOptions\n ): Promise<UpdatePermissionsResponse> {\n if (req.securableType === undefined) {\n throw new Error('path parameter \"securable_type\" is required');\n }\n const {host, workspaceId, httpClient, timeout} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/permissions/${encodePathVariable(req.securableType)}/${encodePathVariable(req.securableFullName ?? '')}`;\n const body = marshalRequest(req, marshalUpdatePermissionsRequestSchema);\n let resp: UpdatePermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalUpdatePermissionsResponseSchema);\n };\n await executeCall(call, options, timeout);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n}\n"],"mappings":";;;;;;;;;AA4CA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,eAAb,MAA0B;CACxB,AAAiB;CACjB,AAAiB;CAIjB,AAAiB;CAIjB,AAAQ;CAER,YAAY,SAAwB;AAClC,qBAAmB,QAAQ;AAC3B,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,IAAI,YAAY;AAChD,OAAK,aAAa,eAAe,CAC9B,KAAK,gBAAgB,CACrB,KAAK;GAAC,KAAK;GAAe,OAAOC;GAAa,CAAC;;CAGpD,AAAQ,gBAA+C;AACrD,OAAK,WAAW,oBAAoB,KAAK,SAAS,KAAK,WAAW;AAClE,SAAO,KAAK;;;;;;;;;;CAWd,MAAM,wBACJ,KACA,SAC0C;AAC1C,MAAI,IAAI,kBAAkB,OACxB,OAAM,IAAI,MAAM,gDAA8C;EAEhE,MAAM,EAAC,MAAM,aAAa,YAAY,YAAW,MAAM,KAAK,eAAe;EAC3E,MAAM,MAAM,GAAG,KAAK,+CAA+C,mB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QAAQ;AACzC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EffectivePrivilege, EffectivePrivilegeAssignment, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetPermissionsRequest, GetPermissionsResponse, ListEffectivePrivilegeAssignmentsRequest, ListEffectivePrivilegeAssignmentsResponse, ListPrivilegeAssignmentsRequest, ListPrivilegeAssignmentsResponse, PermissionsChange, PrivilegeAssignment, UpdatePermissionsRequest, UpdatePermissionsResponse } from "./model.js";
|
|
2
2
|
import { GrantsClient } from "./client.js";
|
|
3
|
-
export {
|
|
3
|
+
export { EffectivePrivilege, EffectivePrivilegeAssignment, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetPermissionsRequest, GetPermissionsResponse, GrantsClient, ListEffectivePrivilegeAssignmentsRequest, ListEffectivePrivilegeAssignmentsResponse, ListPrivilegeAssignmentsRequest, ListPrivilegeAssignmentsResponse, PermissionsChange, PrivilegeAssignment, UpdatePermissionsRequest, UpdatePermissionsResponse };
|
package/dist/v1/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EffectivePrivilege, EffectivePrivilegeAssignment, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetPermissionsRequest, GetPermissionsResponse, ListEffectivePrivilegeAssignmentsRequest, ListEffectivePrivilegeAssignmentsResponse, ListPrivilegeAssignmentsRequest, ListPrivilegeAssignmentsResponse, PermissionsChange, PrivilegeAssignment, UpdatePermissionsRequest, UpdatePermissionsResponse } from "./model.js";
|
|
1
2
|
import { GrantsClient } from "./client.js";
|
|
2
3
|
|
|
3
|
-
export { GrantsClient };
|
|
4
|
+
export { EffectivePrivilege, EffectivePrivilegeAssignment, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetPermissionsRequest, GetPermissionsResponse, GrantsClient, ListEffectivePrivilegeAssignmentsRequest, ListEffectivePrivilegeAssignmentsResponse, ListPrivilegeAssignmentsRequest, ListPrivilegeAssignmentsResponse, PermissionsChange, PrivilegeAssignment, UpdatePermissionsRequest, UpdatePermissionsResponse };
|
package/dist/v1/model.d.ts
CHANGED
|
@@ -55,9 +55,12 @@ interface GetEffectivePermissionsResponse {
|
|
|
55
55
|
privilegeAssignments?: EffectivePrivilegeAssignment[] | undefined;
|
|
56
56
|
}
|
|
57
57
|
interface GetPermissionsRequest {
|
|
58
|
-
/** Type of securable. */
|
|
58
|
+
/** Type of the securable, such as `catalog`, `schema`, `table` or `volume`. The value is case-insensitive. */
|
|
59
59
|
securableType?: string | undefined;
|
|
60
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Full name of the securable. Tables, views, volumes and functions use the three-level name
|
|
62
|
+
* `catalog.schema.object`; a metastore uses its metastore ID.
|
|
63
|
+
*/
|
|
61
64
|
securableFullName?: string | undefined;
|
|
62
65
|
/** If provided, only the permissions for the specified principal (user or group) are returned. */
|
|
63
66
|
principal?: string | undefined;
|
|
@@ -153,10 +156,7 @@ interface ListPrivilegeAssignmentsResponse {
|
|
|
153
156
|
nextPageToken?: string | undefined;
|
|
154
157
|
}
|
|
155
158
|
interface PermissionsChange {
|
|
156
|
-
/**
|
|
157
|
-
* The principal whose privileges we are changing.
|
|
158
|
-
* Only one of principal or principal_id should be specified, never both at the same time.
|
|
159
|
-
*/
|
|
159
|
+
/** The principal whose privileges we are changing. */
|
|
160
160
|
principal?: string | undefined;
|
|
161
161
|
/** The set of privileges to add. */
|
|
162
162
|
add?: string[] | undefined;
|
|
@@ -164,20 +164,23 @@ interface PermissionsChange {
|
|
|
164
164
|
remove?: string[] | undefined;
|
|
165
165
|
}
|
|
166
166
|
interface PrivilegeAssignment {
|
|
167
|
-
/**
|
|
168
|
-
* The principal (user email address or group name).
|
|
169
|
-
* For deleted principals, `principal` is empty while `principal_id` is populated.
|
|
170
|
-
*/
|
|
167
|
+
/** The principal (user email address or group name). */
|
|
171
168
|
principal?: string | undefined;
|
|
172
169
|
/** The privileges assigned to the principal. */
|
|
173
170
|
privileges?: string[] | undefined;
|
|
174
171
|
}
|
|
175
172
|
interface UpdatePermissionsRequest {
|
|
176
|
-
/** Type of securable. */
|
|
173
|
+
/** Type of the securable, such as `catalog`, `schema`, `table` or `volume`. The value is case-insensitive. */
|
|
177
174
|
securableType?: string | undefined;
|
|
178
|
-
/**
|
|
175
|
+
/**
|
|
176
|
+
* Full name of the securable. Tables, views, volumes and functions use the three-level name
|
|
177
|
+
* `catalog.schema.object`; a metastore uses its metastore ID.
|
|
178
|
+
*/
|
|
179
179
|
securableFullName?: string | undefined;
|
|
180
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* Whether to omit the privilege assignments from the response. When false, the response lists all direct privilege
|
|
182
|
+
* assignments on the securable after the update.
|
|
183
|
+
*/
|
|
181
184
|
omitPermissionsInResponse?: boolean | undefined;
|
|
182
185
|
/** Array of permissions change objects. */
|
|
183
186
|
changes?: PermissionsChange[] | undefined;
|
|
@@ -188,14 +191,102 @@ interface UpdatePermissionsResponse {
|
|
|
188
191
|
}
|
|
189
192
|
declare const unmarshalEffectivePrivilegeSchema: z.ZodType<EffectivePrivilege>;
|
|
190
193
|
declare const unmarshalEffectivePrivilegeAssignmentSchema: z.ZodType<EffectivePrivilegeAssignment>;
|
|
194
|
+
declare const unmarshalGetEffectivePermissionsRequestSchema: z.ZodType<GetEffectivePermissionsRequest>;
|
|
191
195
|
declare const unmarshalGetEffectivePermissionsResponseSchema: z.ZodType<GetEffectivePermissionsResponse>;
|
|
196
|
+
declare const unmarshalGetPermissionsRequestSchema: z.ZodType<GetPermissionsRequest>;
|
|
192
197
|
declare const unmarshalGetPermissionsResponseSchema: z.ZodType<GetPermissionsResponse>;
|
|
198
|
+
declare const unmarshalListEffectivePrivilegeAssignmentsRequestSchema: z.ZodType<ListEffectivePrivilegeAssignmentsRequest>;
|
|
193
199
|
declare const unmarshalListEffectivePrivilegeAssignmentsResponseSchema: z.ZodType<ListEffectivePrivilegeAssignmentsResponse>;
|
|
200
|
+
declare const unmarshalListPrivilegeAssignmentsRequestSchema: z.ZodType<ListPrivilegeAssignmentsRequest>;
|
|
194
201
|
declare const unmarshalListPrivilegeAssignmentsResponseSchema: z.ZodType<ListPrivilegeAssignmentsResponse>;
|
|
202
|
+
declare const unmarshalPermissionsChangeSchema: z.ZodType<PermissionsChange>;
|
|
195
203
|
declare const unmarshalPrivilegeAssignmentSchema: z.ZodType<PrivilegeAssignment>;
|
|
204
|
+
declare const unmarshalUpdatePermissionsRequestSchema: z.ZodType<UpdatePermissionsRequest>;
|
|
196
205
|
declare const unmarshalUpdatePermissionsResponseSchema: z.ZodType<UpdatePermissionsResponse>;
|
|
206
|
+
declare const marshalEffectivePrivilegeSchema: z.ZodType;
|
|
207
|
+
declare const marshalEffectivePrivilegeAssignmentSchema: z.ZodType;
|
|
208
|
+
declare const marshalGetEffectivePermissionsRequestSchema: z.ZodType;
|
|
209
|
+
declare const marshalGetEffectivePermissionsResponseSchema: z.ZodType;
|
|
210
|
+
declare const marshalGetPermissionsRequestSchema: z.ZodType;
|
|
211
|
+
declare const marshalGetPermissionsResponseSchema: z.ZodType;
|
|
212
|
+
declare const marshalListEffectivePrivilegeAssignmentsRequestSchema: z.ZodType;
|
|
213
|
+
declare const marshalListEffectivePrivilegeAssignmentsResponseSchema: z.ZodType;
|
|
214
|
+
declare const marshalListPrivilegeAssignmentsRequestSchema: z.ZodType;
|
|
215
|
+
declare const marshalListPrivilegeAssignmentsResponseSchema: z.ZodType;
|
|
197
216
|
declare const marshalPermissionsChangeSchema: z.ZodType;
|
|
217
|
+
declare const marshalPrivilegeAssignmentSchema: z.ZodType;
|
|
198
218
|
declare const marshalUpdatePermissionsRequestSchema: z.ZodType;
|
|
219
|
+
declare const marshalUpdatePermissionsResponseSchema: z.ZodType;
|
|
220
|
+
/** Converts EffectivePrivilege messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
221
|
+
declare const EffectivePrivilege: {
|
|
222
|
+
/** Returns the JSON of the message. */toJson: (message: EffectivePrivilege) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
223
|
+
fromJson: (json: string) => EffectivePrivilege;
|
|
224
|
+
};
|
|
225
|
+
/** Converts EffectivePrivilegeAssignment messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
226
|
+
declare const EffectivePrivilegeAssignment: {
|
|
227
|
+
/** Returns the JSON of the message. */toJson: (message: EffectivePrivilegeAssignment) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
228
|
+
fromJson: (json: string) => EffectivePrivilegeAssignment;
|
|
229
|
+
};
|
|
230
|
+
/** Converts GetEffectivePermissionsRequest messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
231
|
+
declare const GetEffectivePermissionsRequest: {
|
|
232
|
+
/** Returns the JSON of the message. */toJson: (message: GetEffectivePermissionsRequest) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
233
|
+
fromJson: (json: string) => GetEffectivePermissionsRequest;
|
|
234
|
+
};
|
|
235
|
+
/** Converts GetEffectivePermissionsResponse messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
236
|
+
declare const GetEffectivePermissionsResponse: {
|
|
237
|
+
/** Returns the JSON of the message. */toJson: (message: GetEffectivePermissionsResponse) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
238
|
+
fromJson: (json: string) => GetEffectivePermissionsResponse;
|
|
239
|
+
};
|
|
240
|
+
/** Converts GetPermissionsRequest messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
241
|
+
declare const GetPermissionsRequest: {
|
|
242
|
+
/** Returns the JSON of the message. */toJson: (message: GetPermissionsRequest) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
243
|
+
fromJson: (json: string) => GetPermissionsRequest;
|
|
244
|
+
};
|
|
245
|
+
/** Converts GetPermissionsResponse messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
246
|
+
declare const GetPermissionsResponse: {
|
|
247
|
+
/** Returns the JSON of the message. */toJson: (message: GetPermissionsResponse) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
248
|
+
fromJson: (json: string) => GetPermissionsResponse;
|
|
249
|
+
};
|
|
250
|
+
/** Converts ListEffectivePrivilegeAssignmentsRequest messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
251
|
+
declare const ListEffectivePrivilegeAssignmentsRequest: {
|
|
252
|
+
/** Returns the JSON of the message. */toJson: (message: ListEffectivePrivilegeAssignmentsRequest) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
253
|
+
fromJson: (json: string) => ListEffectivePrivilegeAssignmentsRequest;
|
|
254
|
+
};
|
|
255
|
+
/** Converts ListEffectivePrivilegeAssignmentsResponse messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
256
|
+
declare const ListEffectivePrivilegeAssignmentsResponse: {
|
|
257
|
+
/** Returns the JSON of the message. */toJson: (message: ListEffectivePrivilegeAssignmentsResponse) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
258
|
+
fromJson: (json: string) => ListEffectivePrivilegeAssignmentsResponse;
|
|
259
|
+
};
|
|
260
|
+
/** Converts ListPrivilegeAssignmentsRequest messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
261
|
+
declare const ListPrivilegeAssignmentsRequest: {
|
|
262
|
+
/** Returns the JSON of the message. */toJson: (message: ListPrivilegeAssignmentsRequest) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
263
|
+
fromJson: (json: string) => ListPrivilegeAssignmentsRequest;
|
|
264
|
+
};
|
|
265
|
+
/** Converts ListPrivilegeAssignmentsResponse messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
266
|
+
declare const ListPrivilegeAssignmentsResponse: {
|
|
267
|
+
/** Returns the JSON of the message. */toJson: (message: ListPrivilegeAssignmentsResponse) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
268
|
+
fromJson: (json: string) => ListPrivilegeAssignmentsResponse;
|
|
269
|
+
};
|
|
270
|
+
/** Converts PermissionsChange messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
271
|
+
declare const PermissionsChange: {
|
|
272
|
+
/** Returns the JSON of the message. */toJson: (message: PermissionsChange) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
273
|
+
fromJson: (json: string) => PermissionsChange;
|
|
274
|
+
};
|
|
275
|
+
/** Converts PrivilegeAssignment messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
276
|
+
declare const PrivilegeAssignment: {
|
|
277
|
+
/** Returns the JSON of the message. */toJson: (message: PrivilegeAssignment) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
278
|
+
fromJson: (json: string) => PrivilegeAssignment;
|
|
279
|
+
};
|
|
280
|
+
/** Converts UpdatePermissionsRequest messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
281
|
+
declare const UpdatePermissionsRequest: {
|
|
282
|
+
/** Returns the JSON of the message. */toJson: (message: UpdatePermissionsRequest) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
283
|
+
fromJson: (json: string) => UpdatePermissionsRequest;
|
|
284
|
+
};
|
|
285
|
+
/** Converts UpdatePermissionsResponse messages to and from the JSON that the API uses, with the fields that a request sends in its URL path or query as regular fields. */
|
|
286
|
+
declare const UpdatePermissionsResponse: {
|
|
287
|
+
/** Returns the JSON of the message. */toJson: (message: UpdatePermissionsResponse) => string; /** Reads the message from its JSON. Throws when the JSON sets two members of one oneof, or a field mask in it names a missing field. */
|
|
288
|
+
fromJson: (json: string) => UpdatePermissionsResponse;
|
|
289
|
+
};
|
|
199
290
|
//#endregion
|
|
200
|
-
export { EffectivePrivilege, EffectivePrivilegeAssignment, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetPermissionsRequest, GetPermissionsResponse, ListEffectivePrivilegeAssignmentsRequest, ListEffectivePrivilegeAssignmentsResponse, ListPrivilegeAssignmentsRequest, ListPrivilegeAssignmentsResponse, PermissionsChange, PrivilegeAssignment, UpdatePermissionsRequest, UpdatePermissionsResponse, marshalPermissionsChangeSchema, marshalUpdatePermissionsRequestSchema, unmarshalEffectivePrivilegeAssignmentSchema, unmarshalEffectivePrivilegeSchema, unmarshalGetEffectivePermissionsResponseSchema, unmarshalGetPermissionsResponseSchema, unmarshalListEffectivePrivilegeAssignmentsResponseSchema, unmarshalListPrivilegeAssignmentsResponseSchema, unmarshalPrivilegeAssignmentSchema, unmarshalUpdatePermissionsResponseSchema };
|
|
291
|
+
export { EffectivePrivilege, EffectivePrivilegeAssignment, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetPermissionsRequest, GetPermissionsResponse, ListEffectivePrivilegeAssignmentsRequest, ListEffectivePrivilegeAssignmentsResponse, ListPrivilegeAssignmentsRequest, ListPrivilegeAssignmentsResponse, PermissionsChange, PrivilegeAssignment, UpdatePermissionsRequest, UpdatePermissionsResponse, marshalEffectivePrivilegeAssignmentSchema, marshalEffectivePrivilegeSchema, marshalGetEffectivePermissionsRequestSchema, marshalGetEffectivePermissionsResponseSchema, marshalGetPermissionsRequestSchema, marshalGetPermissionsResponseSchema, marshalListEffectivePrivilegeAssignmentsRequestSchema, marshalListEffectivePrivilegeAssignmentsResponseSchema, marshalListPrivilegeAssignmentsRequestSchema, marshalListPrivilegeAssignmentsResponseSchema, marshalPermissionsChangeSchema, marshalPrivilegeAssignmentSchema, marshalUpdatePermissionsRequestSchema, marshalUpdatePermissionsResponseSchema, unmarshalEffectivePrivilegeAssignmentSchema, unmarshalEffectivePrivilegeSchema, unmarshalGetEffectivePermissionsRequestSchema, unmarshalGetEffectivePermissionsResponseSchema, unmarshalGetPermissionsRequestSchema, unmarshalGetPermissionsResponseSchema, unmarshalListEffectivePrivilegeAssignmentsRequestSchema, unmarshalListEffectivePrivilegeAssignmentsResponseSchema, unmarshalListPrivilegeAssignmentsRequestSchema, unmarshalListPrivilegeAssignmentsResponseSchema, unmarshalPermissionsChangeSchema, unmarshalPrivilegeAssignmentSchema, unmarshalUpdatePermissionsRequestSchema, unmarshalUpdatePermissionsResponseSchema };
|
|
201
292
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/v1/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","names":[],"sources":["../../src/v1/model.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"model.d.ts","names":[],"sources":["../../src/v1/model.ts"],"mappings":";;;UA+CiB,kBAAA;;EAEf,SAAA;EAFiC;;;;EAOjC,iBAAA;EAKA;;;AAGF;EAHE,iBAAA;AAAA;AAAA,UAGe,4BAAA;EAEf;EAAA,SAAA;EAEa;EAAb,UAAA,GAAa,kBAAA;AAAA;AAAA,UAGE,8BAAA;EAA8B;EAE7C,aAAA;EAF6C;EAI7C,iBAAA;EAAA;EAEA,SAAA;EAcA;;;;AAKF;;;;;;;;;EALE,UAAA;EAeoC;EAbpC,SAAA;AAAA;AAAA,UAGe,+BAAA;EAiBf;;;;EAZA,aAAA;EA8BS;EA5BT,oBAAA,GAAuB,4BAAA;AAAA;AAAA,UAGR,qBAAA;EAmC2B;EAjC1C,aAAA;EAiCA;;;;EA5BA,iBAAA;EA+BuD;EA7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