@databricks/sdk-uc-rfa 0.34.0 → 0.36.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 +7 -0
- package/dist/package.js.map +1 -0
- package/dist/v1/client.d.ts +43 -39
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +121 -142
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +3 -8
- package/dist/v1/index.js +4 -8
- package/dist/v1/model.d.ts +175 -172
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +160 -206
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +21 -17
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +60 -69
- package/dist/v1/transport.js.map +1 -1
- package/dist/v1/utils.d.ts +18 -14
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +76 -103
- package/dist/v1/utils.js.map +1 -1
- package/package.json +5 -5
- package/dist/v1/index.d.ts.map +0 -1
- package/dist/v1/index.js.map +0 -1
package/dist/package.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
package/dist/v1/client.d.ts
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { AccessRequestDestinations, BatchCreateAccessRequestsRequest, BatchCreateAccessRequestsResponse, GetAccessRequestDestinationsRequest, UpdateAccessRequestDestinationsRequest } from "./model.js";
|
|
2
|
+
import { CallOptions } from "@databricks/sdk-options/call";
|
|
3
|
+
import { ClientOptions } from "@databricks/sdk-options/client";
|
|
4
|
+
|
|
5
|
+
//#region src/v1/client.d.ts
|
|
6
|
+
declare class RfaClient {
|
|
7
|
+
private readonly options;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private readonly userAgent;
|
|
10
|
+
private config;
|
|
11
|
+
constructor(options: ClientOptions);
|
|
12
|
+
private resolveConfig;
|
|
13
|
+
/**
|
|
14
|
+
* Creates access requests for Unity Catalog permissions for a specified principal on a securable object.
|
|
15
|
+
* This Batch API can take in multiple principals, securable objects,
|
|
16
|
+
* and permissions as the input and returns the access request destinations for each.
|
|
17
|
+
* Principals must be unique across the API call.
|
|
18
|
+
*
|
|
19
|
+
* The supported securable types are: "metastore", "catalog", "schema", "table",
|
|
20
|
+
* "external_location", "connection", "credential", "function", "registered_model", and "volume".
|
|
21
|
+
*/
|
|
22
|
+
batchCreateAccessRequests(req: BatchCreateAccessRequestsRequest, options?: CallOptions): Promise<BatchCreateAccessRequestsResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets an array of access request destinations for the specified securable.
|
|
25
|
+
* Any caller can see URL destinations or the destinations on the metastore.
|
|
26
|
+
* Otherwise, only those with **BROWSE** permissions on the securable can see destinations.
|
|
27
|
+
*
|
|
28
|
+
* The supported securable types are: "metastore", "catalog", "schema", "table",
|
|
29
|
+
* "external_location", "connection", "credential", "function", "registered_model", and "volume".
|
|
30
|
+
*/
|
|
31
|
+
getAccessRequestDestinations(req: GetAccessRequestDestinationsRequest, options?: CallOptions): Promise<AccessRequestDestinations>;
|
|
32
|
+
/**
|
|
33
|
+
* Updates the access request destinations for the given securable.
|
|
34
|
+
* The caller must be a metastore admin, the owner of the securable, or a user that has the **MANAGE** privilege on the securable in order to assign destinations.
|
|
35
|
+
* A maximum of 5 emails and 5 external notification destinations (Slack, Microsoft Teams, and Generic Webhook destinations) can be assigned to a securable.
|
|
36
|
+
* If a URL destination is assigned, no other destinations can be set.
|
|
37
|
+
*
|
|
38
|
+
* The supported securable types are: "metastore", "catalog", "schema", "table",
|
|
39
|
+
* "external_location", "connection", "credential", "function", "registered_model", and "volume".
|
|
40
|
+
*/
|
|
41
|
+
updateAccessRequestDestinations(req: UpdateAccessRequestDestinationsRequest, options?: CallOptions): Promise<AccessRequestDestinations>;
|
|
40
42
|
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { RfaClient };
|
|
41
45
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/v1/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;cAsCa,SAAA;EAAA,iBACM,OAAA;EAAA,iBACA,MAAA;EAAA,iBAIA,SAAA;EAAA,QAIT,MAAA;cAEI,OAAA,EAAS,aAAA;EAAA,QAUb,aAAA;EAgBI;;;;;;;;;EAFN,yBAAA,CACJ,GAAA,EAAK,gCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,iCAAA;EAgFR;;;;;;;;EAxCG,4BAAA,CACJ,GAAA,EAAK,mCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,yBAAA;EAtEC;;;;;;;;;EAwGN,+BAAA,CACJ,GAAA,EAAK,sCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,yBAAA;AAAA"}
|
package/dist/v1/client.js
CHANGED
|
@@ -1,145 +1,124 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { resolveClientConfig } from "./transport.js";
|
|
2
|
+
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
|
|
3
|
+
import { name, version } from "../package.js";
|
|
4
|
+
import { marshalAccessRequestDestinationsSchema, marshalBatchCreateAccessRequestsRequestSchema, unmarshalAccessRequestDestinationsSchema, unmarshalBatchCreateAccessRequestsResponseSchema } from "./model.js";
|
|
5
|
+
import { VERSION } from "@databricks/sdk-auth";
|
|
6
|
+
import { createDefault } from "@databricks/sdk-core/clientinfo";
|
|
7
|
+
import { NoOpLogger } from "@databricks/sdk-core/logger";
|
|
8
|
+
|
|
9
|
+
//#region src/v1/client.ts
|
|
10
10
|
const PACKAGE_SEGMENT = {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
key: "sdk-js-" + name.replace(/^@[^/]+\/sdk-/, ""),
|
|
12
|
+
value: version
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const call = async (callSignal) => {
|
|
125
|
-
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
126
|
-
if (workspaceId !== undefined) {
|
|
127
|
-
headers.set('X-Databricks-Workspace-Id', workspaceId);
|
|
128
|
-
}
|
|
129
|
-
headers.set('User-Agent', this.userAgent);
|
|
130
|
-
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
131
|
-
const respBody = await executeHttpCall({
|
|
132
|
-
request: httpReq,
|
|
133
|
-
httpClient,
|
|
134
|
-
logger: this.logger,
|
|
135
|
-
});
|
|
136
|
-
resp = parseResponse(respBody, unmarshalAccessRequestDestinationsSchema);
|
|
137
|
-
};
|
|
138
|
-
await executeCall(call, options);
|
|
139
|
-
if (resp === undefined) {
|
|
140
|
-
throw new Error('operation completed without a result.');
|
|
141
|
-
}
|
|
142
|
-
return resp;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
14
|
+
var RfaClient = class {
|
|
15
|
+
options;
|
|
16
|
+
logger;
|
|
17
|
+
userAgent;
|
|
18
|
+
config;
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = options;
|
|
21
|
+
this.logger = options.logger ?? new NoOpLogger();
|
|
22
|
+
this.userAgent = createDefault().with(PACKAGE_SEGMENT).with({
|
|
23
|
+
key: "sdk-js-auth",
|
|
24
|
+
value: VERSION
|
|
25
|
+
}).with({
|
|
26
|
+
key: "auth",
|
|
27
|
+
value: options.credentials?.name() ?? "default"
|
|
28
|
+
}).toString();
|
|
29
|
+
}
|
|
30
|
+
resolveConfig() {
|
|
31
|
+
this.config ??= resolveClientConfig(this.options);
|
|
32
|
+
return this.config;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates access requests for Unity Catalog permissions for a specified principal on a securable object.
|
|
36
|
+
* This Batch API can take in multiple principals, securable objects,
|
|
37
|
+
* and permissions as the input and returns the access request destinations for each.
|
|
38
|
+
* Principals must be unique across the API call.
|
|
39
|
+
*
|
|
40
|
+
* The supported securable types are: "metastore", "catalog", "schema", "table",
|
|
41
|
+
* "external_location", "connection", "credential", "function", "registered_model", and "volume".
|
|
42
|
+
*/
|
|
43
|
+
async batchCreateAccessRequests(req, options) {
|
|
44
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
45
|
+
const url = `${host}/api/3.0/rfa/requests`;
|
|
46
|
+
const body = marshalRequest(req, marshalBatchCreateAccessRequestsRequestSchema);
|
|
47
|
+
let resp;
|
|
48
|
+
const call = async (callSignal) => {
|
|
49
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
50
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
51
|
+
headers.set("User-Agent", this.userAgent);
|
|
52
|
+
resp = parseResponse(await executeHttpCall({
|
|
53
|
+
request: buildHttpRequest("POST", url, headers, callSignal, body),
|
|
54
|
+
httpClient,
|
|
55
|
+
logger: this.logger
|
|
56
|
+
}), unmarshalBatchCreateAccessRequestsResponseSchema);
|
|
57
|
+
};
|
|
58
|
+
await executeCall(call, options);
|
|
59
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
60
|
+
return resp;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Gets an array of access request destinations for the specified securable.
|
|
64
|
+
* Any caller can see URL destinations or the destinations on the metastore.
|
|
65
|
+
* Otherwise, only those with **BROWSE** permissions on the securable can see destinations.
|
|
66
|
+
*
|
|
67
|
+
* The supported securable types are: "metastore", "catalog", "schema", "table",
|
|
68
|
+
* "external_location", "connection", "credential", "function", "registered_model", and "volume".
|
|
69
|
+
*/
|
|
70
|
+
async getAccessRequestDestinations(req, options) {
|
|
71
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
72
|
+
const url = `${host}/api/3.0/rfa/destinations/${req.securableType ?? ""}/${req.fullName ?? ""}`;
|
|
73
|
+
let resp;
|
|
74
|
+
const call = async (callSignal) => {
|
|
75
|
+
const headers = new Headers();
|
|
76
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
77
|
+
headers.set("User-Agent", this.userAgent);
|
|
78
|
+
resp = parseResponse(await executeHttpCall({
|
|
79
|
+
request: buildHttpRequest("GET", url, headers, callSignal),
|
|
80
|
+
httpClient,
|
|
81
|
+
logger: this.logger
|
|
82
|
+
}), unmarshalAccessRequestDestinationsSchema);
|
|
83
|
+
};
|
|
84
|
+
await executeCall(call, options);
|
|
85
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
86
|
+
return resp;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Updates the access request destinations for the given securable.
|
|
90
|
+
* The caller must be a metastore admin, the owner of the securable, or a user that has the **MANAGE** privilege on the securable in order to assign destinations.
|
|
91
|
+
* A maximum of 5 emails and 5 external notification destinations (Slack, Microsoft Teams, and Generic Webhook destinations) can be assigned to a securable.
|
|
92
|
+
* If a URL destination is assigned, no other destinations can be set.
|
|
93
|
+
*
|
|
94
|
+
* The supported securable types are: "metastore", "catalog", "schema", "table",
|
|
95
|
+
* "external_location", "connection", "credential", "function", "registered_model", and "volume".
|
|
96
|
+
*/
|
|
97
|
+
async updateAccessRequestDestinations(req, options) {
|
|
98
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
99
|
+
const url = `${host}/api/3.0/rfa/destinations`;
|
|
100
|
+
const params = new URLSearchParams();
|
|
101
|
+
if (req.updateMask !== void 0) params.append("update_mask", req.updateMask.toString());
|
|
102
|
+
const query = params.toString();
|
|
103
|
+
const fullUrl = query !== "" ? `${url}?${query}` : url;
|
|
104
|
+
const body = marshalRequest(req.accessRequestDestinations, marshalAccessRequestDestinationsSchema);
|
|
105
|
+
let resp;
|
|
106
|
+
const call = async (callSignal) => {
|
|
107
|
+
const headers = new Headers({ "Content-Type": "application/json" });
|
|
108
|
+
if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
|
|
109
|
+
headers.set("User-Agent", this.userAgent);
|
|
110
|
+
resp = parseResponse(await executeHttpCall({
|
|
111
|
+
request: buildHttpRequest("PATCH", fullUrl, headers, callSignal, body),
|
|
112
|
+
httpClient,
|
|
113
|
+
logger: this.logger
|
|
114
|
+
}), unmarshalAccessRequestDestinationsSchema);
|
|
115
|
+
};
|
|
116
|
+
await executeCall(call, options);
|
|
117
|
+
if (resp === void 0) throw new Error("operation completed without a result.");
|
|
118
|
+
return resp;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
export { RfaClient };
|
|
145
124
|
//# sourceMappingURL=client.js.map
|
package/dist/v1/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EA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AAe,CAAC;gBACrC,OAAO,EAAE,OAAO;gBAChB,UAAU;gBACV,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,IAAI,GAAG,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,CAAC;QAC3E,CAAC,CAAC;QACF,MAAM,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
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 AccessRequestDestinations,\n BatchCreateAccessRequestsRequest,\n BatchCreateAccessRequestsResponse,\n GetAccessRequestDestinationsRequest,\n UpdateAccessRequestDestinationsRequest,\n} from './model';\nimport {\n marshalAccessRequestDestinationsSchema,\n marshalBatchCreateAccessRequestsRequestSchema,\n unmarshalAccessRequestDestinationsSchema,\n unmarshalBatchCreateAccessRequestsResponseSchema,\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 RfaClient {\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 * Creates access requests for Unity Catalog permissions for a specified principal on a securable object.\n * This Batch API can take in multiple principals, securable objects,\n * and permissions as the input and returns the access request destinations for each.\n * Principals must be unique across the API call.\n *\n * The supported securable types are: \"metastore\", \"catalog\", \"schema\", \"table\",\n * \"external_location\", \"connection\", \"credential\", \"function\", \"registered_model\", and \"volume\".\n */\n async batchCreateAccessRequests(\n req: BatchCreateAccessRequestsRequest,\n options?: CallOptions\n ): Promise<BatchCreateAccessRequestsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/3.0/rfa/requests`;\n const body = marshalRequest(\n req,\n marshalBatchCreateAccessRequestsRequestSchema\n );\n let resp: BatchCreateAccessRequestsResponse | 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('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalBatchCreateAccessRequestsResponseSchema\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 an array of access request destinations for the specified securable.\n * Any caller can see URL destinations or the destinations on the metastore.\n * Otherwise, only those with **BROWSE** permissions on the securable can see destinations.\n *\n * The supported securable types are: \"metastore\", \"catalog\", \"schema\", \"table\",\n * \"external_location\", \"connection\", \"credential\", \"function\", \"registered_model\", and \"volume\".\n */\n async getAccessRequestDestinations(\n req: GetAccessRequestDestinationsRequest,\n options?: CallOptions\n ): Promise<AccessRequestDestinations> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/3.0/rfa/destinations/${req.securableType ?? ''}/${req.fullName ?? ''}`;\n let resp: AccessRequestDestinations | 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', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAccessRequestDestinationsSchema);\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 * Updates the access request destinations for the given securable.\n * The caller must be a metastore admin, the owner of the securable, or a user that has the **MANAGE** privilege on the securable in order to assign destinations.\n * A maximum of 5 emails and 5 external notification destinations (Slack, Microsoft Teams, and Generic Webhook destinations) can be assigned to a securable.\n * If a URL destination is assigned, no other destinations can be set.\n *\n * The supported securable types are: \"metastore\", \"catalog\", \"schema\", \"table\",\n * \"external_location\", \"connection\", \"credential\", \"function\", \"registered_model\", and \"volume\".\n */\n async updateAccessRequestDestinations(\n req: UpdateAccessRequestDestinationsRequest,\n options?: CallOptions\n ): Promise<AccessRequestDestinations> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/3.0/rfa/destinations`;\n const params = new URLSearchParams();\n if (req.updateMask !== undefined) {\n params.append('update_mask', req.updateMask.toString());\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n const body = marshalRequest(\n req.accessRequestDestinations,\n marshalAccessRequestDestinationsSchema\n );\n let resp: AccessRequestDestinations | 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(\n 'PATCH',\n fullUrl,\n headers,\n callSignal,\n body\n );\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalAccessRequestDestinationsSchema);\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":";;;;;;;;;AAiCA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,YAAb,MAAuB;CACrB,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;;CAGlC,AAAQ,gBAA+C;AACrD,OAAK,WAAW,oBAAoB,KAAK,QAAQ;AACjD,SAAO,KAAK;;;;;;;;;;;CAYd,MAAM,0BACJ,KACA,SAC4C;EAC5C,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MA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B,QAAO,OAAO,eAAe,IAAI,WAAW,UAAU,CAAC;EAEzD,MAAM,QAAQ,OAAO,UAAU;EAC/B,MAAM,UAAU,UAAU,KAAK,GAAG,IAAI,GAAG,UAAU;EACnD,MAAM,OAAO,eACX,IAAI,2BACJ,uCACD;EACD,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;AAazC,UAAO,cALU,MAAM,gBAAgB;IACrC,SARc,iBACd,SACA,SACA,SACA,YACA,KACD;IAGC;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,yCAAyC;;AAE1E,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { RfaClient } from './client';
|
|
5
|
-
export { DestinationType, PrincipalType, SecurableType, SpecialDestination, } from './model';
|
|
6
|
-
export type { AccessRequestDestinations, BatchCreateAccessRequestsRequest, BatchCreateAccessRequestsResponse, CreateAccessRequest, CreateAccessRequestResponse, GetAccessRequestDestinationsRequest, NotificationDestination, Principal, Securable, SecurablePermissions, UpdateAccessRequestDestinationsRequest, } from './model';
|
|
7
|
-
export { accessRequestDestinationsFieldMask } from './model';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { AccessRequestDestinations, BatchCreateAccessRequestsRequest, BatchCreateAccessRequestsResponse, CreateAccessRequest, CreateAccessRequestResponse, DestinationType, GetAccessRequestDestinationsRequest, NotificationDestination, Principal, PrincipalType, Securable, SecurablePermissions, SecurableType, SpecialDestination, UpdateAccessRequestDestinationsRequest, accessRequestDestinationsFieldMask } from "./model.js";
|
|
2
|
+
import { RfaClient } from "./client.js";
|
|
3
|
+
export { type AccessRequestDestinations, type BatchCreateAccessRequestsRequest, type BatchCreateAccessRequestsResponse, type CreateAccessRequest, type CreateAccessRequestResponse, DestinationType, type GetAccessRequestDestinationsRequest, type NotificationDestination, type Principal, PrincipalType, RfaClient, type Securable, type SecurablePermissions, SecurableType, SpecialDestination, type UpdateAccessRequestDestinationsRequest, accessRequestDestinationsFieldMask };
|
package/dist/v1/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { RfaClient } from './client';
|
|
6
|
-
export { DestinationType, PrincipalType, SecurableType, SpecialDestination, } from './model';
|
|
7
|
-
export { accessRequestDestinationsFieldMask } from './model';
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { DestinationType, PrincipalType, SecurableType, SpecialDestination, accessRequestDestinationsFieldMask } from "./model.js";
|
|
2
|
+
import { RfaClient } from "./client.js";
|
|
3
|
+
|
|
4
|
+
export { DestinationType, PrincipalType, RfaClient, SecurableType, SpecialDestination, accessRequestDestinationsFieldMask };
|