@databricks/sdk-uc-abacpolicies 0.0.0-dev → 0.1.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +203 -0
- package/dist/v1/client.js.map +1 -0
- package/dist/v1/index.d.ts +5 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +5 -0
- package/dist/v1/index.js.map +1 -0
- package/dist/v1/model.d.ts +242 -0
- package/dist/v1/model.d.ts.map +1 -0
- package/dist/v1/model.js +264 -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 +21 -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 +267 -0
- package/src/v1/index.ts +22 -0
- package/src/v1/model.ts +503 -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
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { FieldMask } from '@databricks/sdk-core/wkt';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare enum PolicyType {
|
|
4
|
+
/** For detecting field not being set to a supported value */
|
|
5
|
+
POLICY_TYPE_UNSPECIFIED = "POLICY_TYPE_UNSPECIFIED",
|
|
6
|
+
POLICY_TYPE_ROW_FILTER = "POLICY_TYPE_ROW_FILTER",
|
|
7
|
+
POLICY_TYPE_COLUMN_MASK = "POLICY_TYPE_COLUMN_MASK"
|
|
8
|
+
}
|
|
9
|
+
/** The type of Unity Catalog securable. */
|
|
10
|
+
export declare enum SecurableType {
|
|
11
|
+
CATALOG = "CATALOG",
|
|
12
|
+
SCHEMA = "SCHEMA",
|
|
13
|
+
TABLE = "TABLE",
|
|
14
|
+
STORAGE_CREDENTIAL = "STORAGE_CREDENTIAL",
|
|
15
|
+
EXTERNAL_LOCATION = "EXTERNAL_LOCATION",
|
|
16
|
+
FUNCTION = "FUNCTION",
|
|
17
|
+
SHARE = "SHARE",
|
|
18
|
+
PROVIDER = "PROVIDER",
|
|
19
|
+
RECIPIENT = "RECIPIENT",
|
|
20
|
+
CLEAN_ROOM = "CLEAN_ROOM",
|
|
21
|
+
METASTORE = "METASTORE",
|
|
22
|
+
PIPELINE = "PIPELINE",
|
|
23
|
+
VOLUME = "VOLUME",
|
|
24
|
+
CONNECTION = "CONNECTION",
|
|
25
|
+
CREDENTIAL = "CREDENTIAL",
|
|
26
|
+
EXTERNAL_METADATA = "EXTERNAL_METADATA",
|
|
27
|
+
/** TODO: [UC-2980] Staging tables aren't full-fleged securables yet. */
|
|
28
|
+
STAGING_TABLE = "STAGING_TABLE"
|
|
29
|
+
}
|
|
30
|
+
export interface ColumnMaskOptions {
|
|
31
|
+
/**
|
|
32
|
+
* The fully qualified name of the column mask function.
|
|
33
|
+
* The function is called on each row of the target table.
|
|
34
|
+
* The function's first argument and its return type should match the type of the masked column.
|
|
35
|
+
* Required on create and update.
|
|
36
|
+
*/
|
|
37
|
+
functionName?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The alias of the column to be masked. The alias must refer to one of matched columns.
|
|
40
|
+
* The values of the column is passed to the column mask function as the first argument.
|
|
41
|
+
* Required on create and update.
|
|
42
|
+
*/
|
|
43
|
+
onColumn?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Optional list of column aliases or constant literals to be passed as additional arguments to the column mask function.
|
|
46
|
+
* The type of each column should match the positional argument of the column mask function.
|
|
47
|
+
*/
|
|
48
|
+
using?: FunctionArgument[] | undefined;
|
|
49
|
+
}
|
|
50
|
+
export interface CreatePolicyRequest {
|
|
51
|
+
/** Required. The policy to create. */
|
|
52
|
+
policyInfo?: PolicyInfo | undefined;
|
|
53
|
+
}
|
|
54
|
+
export interface DeletePolicyRequest {
|
|
55
|
+
/** Required. The type of the securable to delete the policy from. */
|
|
56
|
+
onSecurableType?: string | undefined;
|
|
57
|
+
/** Required. The fully qualified name of the securable to delete the policy from. */
|
|
58
|
+
onSecurableFullname?: string | undefined;
|
|
59
|
+
/** Required. The name of the policy to delete */
|
|
60
|
+
name?: string | undefined;
|
|
61
|
+
}
|
|
62
|
+
export interface DeletePolicyRequest_Response {
|
|
63
|
+
}
|
|
64
|
+
export interface FunctionArgument {
|
|
65
|
+
/** A positional argument pass to a row filter or column mask function. */
|
|
66
|
+
arg?: {
|
|
67
|
+
$case: 'alias';
|
|
68
|
+
/** The alias of a matched column. */
|
|
69
|
+
alias: string;
|
|
70
|
+
} | {
|
|
71
|
+
$case: 'constant';
|
|
72
|
+
/** A constant literal. */
|
|
73
|
+
constant: string;
|
|
74
|
+
} | undefined;
|
|
75
|
+
}
|
|
76
|
+
export interface GetPolicyRequest {
|
|
77
|
+
/** Required. The type of the securable to retrieve the policy for. */
|
|
78
|
+
onSecurableType?: string | undefined;
|
|
79
|
+
/** Required. The fully qualified name of securable to retrieve policy for. */
|
|
80
|
+
onSecurableFullname?: string | undefined;
|
|
81
|
+
/** Required. The name of the policy to retrieve. */
|
|
82
|
+
name?: string | undefined;
|
|
83
|
+
}
|
|
84
|
+
export interface ListPoliciesRequest {
|
|
85
|
+
/** Required. The type of the securable to list policies for. */
|
|
86
|
+
onSecurableType?: string | undefined;
|
|
87
|
+
/** Required. The fully qualified name of securable to list policies for. */
|
|
88
|
+
onSecurableFullname?: string | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Optional. Whether to include policies defined on parent securables.
|
|
91
|
+
* By default, the inherited policies are not included.
|
|
92
|
+
*/
|
|
93
|
+
includeInherited?: boolean | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Optional. Maximum number of policies to return on a single page (page length).
|
|
96
|
+
* - When not set or set to 0, the page length is set to a server configured value (recommended);
|
|
97
|
+
* - When set to a value greater than 0, the page length is the minimum of this value and a server configured value;
|
|
98
|
+
*/
|
|
99
|
+
maxResults?: number | undefined;
|
|
100
|
+
/** Optional. Opaque pagination token to go to next page based on previous query. */
|
|
101
|
+
pageToken?: string | undefined;
|
|
102
|
+
}
|
|
103
|
+
export interface ListPoliciesRequest_Response {
|
|
104
|
+
/** The list of retrieved policies. */
|
|
105
|
+
policies?: PolicyInfo[] | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Optional opaque token for continuing pagination. `page_token` should be set to this value for
|
|
108
|
+
* the next request to retrieve the next page of results.
|
|
109
|
+
*/
|
|
110
|
+
nextPageToken?: string | undefined;
|
|
111
|
+
}
|
|
112
|
+
export interface MatchColumn {
|
|
113
|
+
/** The condition expression used to match a table column. */
|
|
114
|
+
condition?: string | undefined;
|
|
115
|
+
/** Optional alias of the matched column. */
|
|
116
|
+
alias?: string | undefined;
|
|
117
|
+
}
|
|
118
|
+
export interface PolicyInfo {
|
|
119
|
+
/** Unique identifier of the policy. This field is output only and is generated by the system. */
|
|
120
|
+
id?: string | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Type of the securable on which the policy is defined.
|
|
123
|
+
* Only `CATALOG`, `SCHEMA` and `TABLE` are supported at this moment.
|
|
124
|
+
* Required on create.
|
|
125
|
+
*/
|
|
126
|
+
onSecurableType?: SecurableType | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Full name of the securable on which the policy is defined.
|
|
129
|
+
* Required on create.
|
|
130
|
+
*/
|
|
131
|
+
onSecurableFullname?: string | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Name of the policy. Required on create and optional on update.
|
|
134
|
+
* To rename the policy, set `name` to a different value on update.
|
|
135
|
+
*/
|
|
136
|
+
name?: string | undefined;
|
|
137
|
+
/** Optional description of the policy. */
|
|
138
|
+
comment?: string | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* List of user or group names that the policy applies to.
|
|
141
|
+
* Required on create and optional on update.
|
|
142
|
+
*/
|
|
143
|
+
toPrincipals?: string[] | undefined;
|
|
144
|
+
/** Optional list of user or group names that should be excluded from the policy. */
|
|
145
|
+
exceptPrincipals?: string[] | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* Type of securables that the policy should take effect on.
|
|
148
|
+
* Only `TABLE` is supported at this moment.
|
|
149
|
+
* Required on create and optional on update.
|
|
150
|
+
*/
|
|
151
|
+
forSecurableType?: SecurableType | undefined;
|
|
152
|
+
/** Optional condition when the policy should take effect. */
|
|
153
|
+
whenCondition?: string | undefined;
|
|
154
|
+
/** Type of the policy. Required on create. */
|
|
155
|
+
policyType?: PolicyType | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* (--[Create:REQ Update:OPT] Type-specific options for the Policy--)
|
|
158
|
+
* Type-specific options for the policy.
|
|
159
|
+
*/
|
|
160
|
+
options?: {
|
|
161
|
+
$case: 'rowFilter';
|
|
162
|
+
/**
|
|
163
|
+
* Options for row filter policies. Valid only if `policy_type` is `POLICY_TYPE_ROW_FILTER`.
|
|
164
|
+
* Required on create and optional on update. When specified on update,
|
|
165
|
+
* the new options will replace the existing options as a whole.
|
|
166
|
+
*/
|
|
167
|
+
rowFilter: RowFilterOptions;
|
|
168
|
+
} | {
|
|
169
|
+
$case: 'columnMask';
|
|
170
|
+
/**
|
|
171
|
+
* Options for column mask policies. Valid only if `policy_type` is `POLICY_TYPE_COLUMN_MASK`.
|
|
172
|
+
* Required on create and optional on update. When specified on update,
|
|
173
|
+
* the new options will replace the existing options as a whole.
|
|
174
|
+
*/
|
|
175
|
+
columnMask: ColumnMaskOptions;
|
|
176
|
+
} | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* Optional list of condition expressions used to match table columns.
|
|
179
|
+
* Only valid when `for_securable_type` is `TABLE`.
|
|
180
|
+
* When specified, the policy only applies to tables whose columns satisfy all match conditions.
|
|
181
|
+
*/
|
|
182
|
+
matchColumns?: MatchColumn[] | undefined;
|
|
183
|
+
/** Time at which the policy was created, in epoch milliseconds. Output only. */
|
|
184
|
+
createdAt?: bigint | undefined;
|
|
185
|
+
/** Username of the user who created the policy. Output only. */
|
|
186
|
+
createdBy?: string | undefined;
|
|
187
|
+
/** Time at which the policy was last modified, in epoch milliseconds. Output only. */
|
|
188
|
+
updatedAt?: bigint | undefined;
|
|
189
|
+
/** Username of the user who last modified the policy. Output only. */
|
|
190
|
+
updatedBy?: string | undefined;
|
|
191
|
+
}
|
|
192
|
+
export interface RowFilterOptions {
|
|
193
|
+
/**
|
|
194
|
+
* The fully qualified name of the row filter function.
|
|
195
|
+
* The function is called on each row of the target table. It should return a boolean value
|
|
196
|
+
* indicating whether the row should be visible to the user.
|
|
197
|
+
* Required on create and update.
|
|
198
|
+
*/
|
|
199
|
+
functionName?: string | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* Optional list of column aliases or constant literals to be passed as arguments to the row filter function.
|
|
202
|
+
* The type of each column should match the positional argument of the row filter function.
|
|
203
|
+
*/
|
|
204
|
+
using?: FunctionArgument[] | undefined;
|
|
205
|
+
}
|
|
206
|
+
export interface UpdatePolicyRequest {
|
|
207
|
+
/** Required. The type of the securable to update the policy for. */
|
|
208
|
+
onSecurableType?: string | undefined;
|
|
209
|
+
/** Required. The fully qualified name of the securable to update the policy for. */
|
|
210
|
+
onSecurableFullname?: string | undefined;
|
|
211
|
+
/** Required. The name of the policy to update. */
|
|
212
|
+
name?: string | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* Optional fields to update. This is the request body for updating a policy.
|
|
215
|
+
* Use `update_mask` field to specify which fields in the request is to be updated.
|
|
216
|
+
* - If `update_mask` is empty or "*", all specified fields will be updated.
|
|
217
|
+
* - If `update_mask` is specified, only the fields specified in the `update_mask` will be updated.
|
|
218
|
+
* If a field is specified in `update_mask` and not set in the request, the field will be cleared.
|
|
219
|
+
* Users can use the update mask to explicitly unset optional fields such as
|
|
220
|
+
* `exception_principals` and `when_condition`.
|
|
221
|
+
*/
|
|
222
|
+
policyInfo?: PolicyInfo | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* Optional. The update mask field for specifying user intentions on which
|
|
225
|
+
* fields to update in the request.
|
|
226
|
+
*/
|
|
227
|
+
updateMask?: FieldMask<PolicyInfo> | undefined;
|
|
228
|
+
}
|
|
229
|
+
export declare const unmarshalColumnMaskOptionsSchema: z.ZodType<ColumnMaskOptions>;
|
|
230
|
+
export declare const unmarshalDeletePolicyRequest_ResponseSchema: z.ZodType<DeletePolicyRequest_Response>;
|
|
231
|
+
export declare const unmarshalFunctionArgumentSchema: z.ZodType<FunctionArgument>;
|
|
232
|
+
export declare const unmarshalListPoliciesRequest_ResponseSchema: z.ZodType<ListPoliciesRequest_Response>;
|
|
233
|
+
export declare const unmarshalMatchColumnSchema: z.ZodType<MatchColumn>;
|
|
234
|
+
export declare const unmarshalPolicyInfoSchema: z.ZodType<PolicyInfo>;
|
|
235
|
+
export declare const unmarshalRowFilterOptionsSchema: z.ZodType<RowFilterOptions>;
|
|
236
|
+
export declare const marshalColumnMaskOptionsSchema: z.ZodType;
|
|
237
|
+
export declare const marshalFunctionArgumentSchema: z.ZodType;
|
|
238
|
+
export declare const marshalMatchColumnSchema: z.ZodType;
|
|
239
|
+
export declare const marshalPolicyInfoSchema: z.ZodType;
|
|
240
|
+
export declare const marshalRowFilterOptionsSchema: z.ZodType;
|
|
241
|
+
export declare function policyInfoFieldMask(...paths: string[]): FieldMask<PolicyInfo>;
|
|
242
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,oBAAY,UAAU;IACpB,6DAA6D;IAC7D,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;IACjD,uB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import { FieldMask } from '@databricks/sdk-core/wkt';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export var PolicyType;
|
|
5
|
+
(function (PolicyType) {
|
|
6
|
+
/** For detecting field not being set to a supported value */
|
|
7
|
+
PolicyType["POLICY_TYPE_UNSPECIFIED"] = "POLICY_TYPE_UNSPECIFIED";
|
|
8
|
+
PolicyType["POLICY_TYPE_ROW_FILTER"] = "POLICY_TYPE_ROW_FILTER";
|
|
9
|
+
PolicyType["POLICY_TYPE_COLUMN_MASK"] = "POLICY_TYPE_COLUMN_MASK";
|
|
10
|
+
})(PolicyType || (PolicyType = {}));
|
|
11
|
+
/** The type of Unity Catalog securable. */
|
|
12
|
+
export var SecurableType;
|
|
13
|
+
(function (SecurableType) {
|
|
14
|
+
SecurableType["CATALOG"] = "CATALOG";
|
|
15
|
+
SecurableType["SCHEMA"] = "SCHEMA";
|
|
16
|
+
SecurableType["TABLE"] = "TABLE";
|
|
17
|
+
SecurableType["STORAGE_CREDENTIAL"] = "STORAGE_CREDENTIAL";
|
|
18
|
+
SecurableType["EXTERNAL_LOCATION"] = "EXTERNAL_LOCATION";
|
|
19
|
+
SecurableType["FUNCTION"] = "FUNCTION";
|
|
20
|
+
SecurableType["SHARE"] = "SHARE";
|
|
21
|
+
SecurableType["PROVIDER"] = "PROVIDER";
|
|
22
|
+
SecurableType["RECIPIENT"] = "RECIPIENT";
|
|
23
|
+
SecurableType["CLEAN_ROOM"] = "CLEAN_ROOM";
|
|
24
|
+
SecurableType["METASTORE"] = "METASTORE";
|
|
25
|
+
SecurableType["PIPELINE"] = "PIPELINE";
|
|
26
|
+
SecurableType["VOLUME"] = "VOLUME";
|
|
27
|
+
SecurableType["CONNECTION"] = "CONNECTION";
|
|
28
|
+
SecurableType["CREDENTIAL"] = "CREDENTIAL";
|
|
29
|
+
SecurableType["EXTERNAL_METADATA"] = "EXTERNAL_METADATA";
|
|
30
|
+
/** TODO: [UC-2980] Staging tables aren't full-fleged securables yet. */
|
|
31
|
+
SecurableType["STAGING_TABLE"] = "STAGING_TABLE";
|
|
32
|
+
})(SecurableType || (SecurableType = {}));
|
|
33
|
+
export const unmarshalColumnMaskOptionsSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
function_name: z.string().optional(),
|
|
36
|
+
on_column: z.string().optional(),
|
|
37
|
+
using: z.array(z.lazy(() => unmarshalFunctionArgumentSchema)).optional(),
|
|
38
|
+
})
|
|
39
|
+
.transform(d => ({
|
|
40
|
+
functionName: d.function_name,
|
|
41
|
+
onColumn: d.on_column,
|
|
42
|
+
using: d.using,
|
|
43
|
+
}));
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
45
|
+
export const unmarshalDeletePolicyRequest_ResponseSchema = z.object({});
|
|
46
|
+
export const unmarshalFunctionArgumentSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
alias: z.string().optional(),
|
|
49
|
+
constant: z.string().optional(),
|
|
50
|
+
})
|
|
51
|
+
.transform(d => ({
|
|
52
|
+
arg: d.alias !== undefined
|
|
53
|
+
? { $case: 'alias', alias: d.alias }
|
|
54
|
+
: d.constant !== undefined
|
|
55
|
+
? { $case: 'constant', constant: d.constant }
|
|
56
|
+
: undefined,
|
|
57
|
+
}));
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
59
|
+
export const unmarshalListPoliciesRequest_ResponseSchema = z
|
|
60
|
+
.object({
|
|
61
|
+
policies: z.array(z.lazy(() => unmarshalPolicyInfoSchema)).optional(),
|
|
62
|
+
next_page_token: z.string().optional(),
|
|
63
|
+
})
|
|
64
|
+
.transform(d => ({
|
|
65
|
+
policies: d.policies,
|
|
66
|
+
nextPageToken: d.next_page_token,
|
|
67
|
+
}));
|
|
68
|
+
export const unmarshalMatchColumnSchema = z
|
|
69
|
+
.object({
|
|
70
|
+
condition: z.string().optional(),
|
|
71
|
+
alias: z.string().optional(),
|
|
72
|
+
})
|
|
73
|
+
.transform(d => ({
|
|
74
|
+
condition: d.condition,
|
|
75
|
+
alias: d.alias,
|
|
76
|
+
}));
|
|
77
|
+
export const unmarshalPolicyInfoSchema = z
|
|
78
|
+
.object({
|
|
79
|
+
id: z.string().optional(),
|
|
80
|
+
on_securable_type: z.enum(SecurableType).optional(),
|
|
81
|
+
on_securable_fullname: z.string().optional(),
|
|
82
|
+
name: z.string().optional(),
|
|
83
|
+
comment: z.string().optional(),
|
|
84
|
+
to_principals: z.array(z.string()).optional(),
|
|
85
|
+
except_principals: z.array(z.string()).optional(),
|
|
86
|
+
for_securable_type: z.enum(SecurableType).optional(),
|
|
87
|
+
when_condition: z.string().optional(),
|
|
88
|
+
policy_type: z.enum(PolicyType).optional(),
|
|
89
|
+
row_filter: z.lazy(() => unmarshalRowFilterOptionsSchema).optional(),
|
|
90
|
+
column_mask: z.lazy(() => unmarshalColumnMaskOptionsSchema).optional(),
|
|
91
|
+
match_columns: z.array(z.lazy(() => unmarshalMatchColumnSchema)).optional(),
|
|
92
|
+
created_at: z
|
|
93
|
+
.union([z.number(), z.bigint()])
|
|
94
|
+
.transform(v => BigInt(v))
|
|
95
|
+
.optional(),
|
|
96
|
+
created_by: z.string().optional(),
|
|
97
|
+
updated_at: z
|
|
98
|
+
.union([z.number(), z.bigint()])
|
|
99
|
+
.transform(v => BigInt(v))
|
|
100
|
+
.optional(),
|
|
101
|
+
updated_by: z.string().optional(),
|
|
102
|
+
})
|
|
103
|
+
.transform(d => ({
|
|
104
|
+
id: d.id,
|
|
105
|
+
onSecurableType: d.on_securable_type,
|
|
106
|
+
onSecurableFullname: d.on_securable_fullname,
|
|
107
|
+
name: d.name,
|
|
108
|
+
comment: d.comment,
|
|
109
|
+
toPrincipals: d.to_principals,
|
|
110
|
+
exceptPrincipals: d.except_principals,
|
|
111
|
+
forSecurableType: d.for_securable_type,
|
|
112
|
+
whenCondition: d.when_condition,
|
|
113
|
+
policyType: d.policy_type,
|
|
114
|
+
options: d.row_filter !== undefined
|
|
115
|
+
? { $case: 'rowFilter', rowFilter: d.row_filter }
|
|
116
|
+
: d.column_mask !== undefined
|
|
117
|
+
? { $case: 'columnMask', columnMask: d.column_mask }
|
|
118
|
+
: undefined,
|
|
119
|
+
matchColumns: d.match_columns,
|
|
120
|
+
createdAt: d.created_at,
|
|
121
|
+
createdBy: d.created_by,
|
|
122
|
+
updatedAt: d.updated_at,
|
|
123
|
+
updatedBy: d.updated_by,
|
|
124
|
+
}));
|
|
125
|
+
export const unmarshalRowFilterOptionsSchema = z
|
|
126
|
+
.object({
|
|
127
|
+
function_name: z.string().optional(),
|
|
128
|
+
using: z.array(z.lazy(() => unmarshalFunctionArgumentSchema)).optional(),
|
|
129
|
+
})
|
|
130
|
+
.transform(d => ({
|
|
131
|
+
functionName: d.function_name,
|
|
132
|
+
using: d.using,
|
|
133
|
+
}));
|
|
134
|
+
export const marshalColumnMaskOptionsSchema = z
|
|
135
|
+
.object({
|
|
136
|
+
functionName: z.string().optional(),
|
|
137
|
+
onColumn: z.string().optional(),
|
|
138
|
+
using: z.array(z.lazy(() => marshalFunctionArgumentSchema)).optional(),
|
|
139
|
+
})
|
|
140
|
+
.transform(d => ({
|
|
141
|
+
function_name: d.functionName,
|
|
142
|
+
on_column: d.onColumn,
|
|
143
|
+
using: d.using,
|
|
144
|
+
}));
|
|
145
|
+
export const marshalFunctionArgumentSchema = z
|
|
146
|
+
.object({
|
|
147
|
+
arg: z
|
|
148
|
+
.discriminatedUnion('$case', [
|
|
149
|
+
z.object({ $case: z.literal('alias'), alias: z.string() }),
|
|
150
|
+
z.object({ $case: z.literal('constant'), constant: z.string() }),
|
|
151
|
+
])
|
|
152
|
+
.optional(),
|
|
153
|
+
})
|
|
154
|
+
.transform(d => ({
|
|
155
|
+
...(d.arg?.$case === 'alias' && { alias: d.arg.alias }),
|
|
156
|
+
...(d.arg?.$case === 'constant' && { constant: d.arg.constant }),
|
|
157
|
+
}));
|
|
158
|
+
export const marshalMatchColumnSchema = z
|
|
159
|
+
.object({
|
|
160
|
+
condition: z.string().optional(),
|
|
161
|
+
alias: z.string().optional(),
|
|
162
|
+
})
|
|
163
|
+
.transform(d => ({
|
|
164
|
+
condition: d.condition,
|
|
165
|
+
alias: d.alias,
|
|
166
|
+
}));
|
|
167
|
+
export const marshalPolicyInfoSchema = z
|
|
168
|
+
.object({
|
|
169
|
+
id: z.string().optional(),
|
|
170
|
+
onSecurableType: z.enum(SecurableType).optional(),
|
|
171
|
+
onSecurableFullname: z.string().optional(),
|
|
172
|
+
name: z.string().optional(),
|
|
173
|
+
comment: z.string().optional(),
|
|
174
|
+
toPrincipals: z.array(z.string()).optional(),
|
|
175
|
+
exceptPrincipals: z.array(z.string()).optional(),
|
|
176
|
+
forSecurableType: z.enum(SecurableType).optional(),
|
|
177
|
+
whenCondition: z.string().optional(),
|
|
178
|
+
policyType: z.enum(PolicyType).optional(),
|
|
179
|
+
options: z
|
|
180
|
+
.discriminatedUnion('$case', [
|
|
181
|
+
z.object({
|
|
182
|
+
$case: z.literal('rowFilter'),
|
|
183
|
+
rowFilter: z.lazy(() => marshalRowFilterOptionsSchema),
|
|
184
|
+
}),
|
|
185
|
+
z.object({
|
|
186
|
+
$case: z.literal('columnMask'),
|
|
187
|
+
columnMask: z.lazy(() => marshalColumnMaskOptionsSchema),
|
|
188
|
+
}),
|
|
189
|
+
])
|
|
190
|
+
.optional(),
|
|
191
|
+
matchColumns: z.array(z.lazy(() => marshalMatchColumnSchema)).optional(),
|
|
192
|
+
createdAt: z.bigint().optional(),
|
|
193
|
+
createdBy: z.string().optional(),
|
|
194
|
+
updatedAt: z.bigint().optional(),
|
|
195
|
+
updatedBy: z.string().optional(),
|
|
196
|
+
})
|
|
197
|
+
.transform(d => ({
|
|
198
|
+
id: d.id,
|
|
199
|
+
on_securable_type: d.onSecurableType,
|
|
200
|
+
on_securable_fullname: d.onSecurableFullname,
|
|
201
|
+
name: d.name,
|
|
202
|
+
comment: d.comment,
|
|
203
|
+
to_principals: d.toPrincipals,
|
|
204
|
+
except_principals: d.exceptPrincipals,
|
|
205
|
+
for_securable_type: d.forSecurableType,
|
|
206
|
+
when_condition: d.whenCondition,
|
|
207
|
+
policy_type: d.policyType,
|
|
208
|
+
...(d.options?.$case === 'rowFilter' && { row_filter: d.options.rowFilter }),
|
|
209
|
+
...(d.options?.$case === 'columnMask' && {
|
|
210
|
+
column_mask: d.options.columnMask,
|
|
211
|
+
}),
|
|
212
|
+
match_columns: d.matchColumns,
|
|
213
|
+
created_at: d.createdAt,
|
|
214
|
+
created_by: d.createdBy,
|
|
215
|
+
updated_at: d.updatedAt,
|
|
216
|
+
updated_by: d.updatedBy,
|
|
217
|
+
}));
|
|
218
|
+
export const marshalRowFilterOptionsSchema = z
|
|
219
|
+
.object({
|
|
220
|
+
functionName: z.string().optional(),
|
|
221
|
+
using: z.array(z.lazy(() => marshalFunctionArgumentSchema)).optional(),
|
|
222
|
+
})
|
|
223
|
+
.transform(d => ({
|
|
224
|
+
function_name: d.functionName,
|
|
225
|
+
using: d.using,
|
|
226
|
+
}));
|
|
227
|
+
const columnMaskOptionsFieldMaskSchema = {
|
|
228
|
+
functionName: { wire: 'function_name' },
|
|
229
|
+
onColumn: { wire: 'on_column' },
|
|
230
|
+
using: { wire: 'using' },
|
|
231
|
+
};
|
|
232
|
+
const policyInfoFieldMaskSchema = {
|
|
233
|
+
columnMask: {
|
|
234
|
+
wire: 'column_mask',
|
|
235
|
+
children: () => columnMaskOptionsFieldMaskSchema,
|
|
236
|
+
},
|
|
237
|
+
comment: { wire: 'comment' },
|
|
238
|
+
createdAt: { wire: 'created_at' },
|
|
239
|
+
createdBy: { wire: 'created_by' },
|
|
240
|
+
exceptPrincipals: { wire: 'except_principals' },
|
|
241
|
+
forSecurableType: { wire: 'for_securable_type' },
|
|
242
|
+
id: { wire: 'id' },
|
|
243
|
+
matchColumns: { wire: 'match_columns' },
|
|
244
|
+
name: { wire: 'name' },
|
|
245
|
+
onSecurableFullname: { wire: 'on_securable_fullname' },
|
|
246
|
+
onSecurableType: { wire: 'on_securable_type' },
|
|
247
|
+
policyType: { wire: 'policy_type' },
|
|
248
|
+
rowFilter: {
|
|
249
|
+
wire: 'row_filter',
|
|
250
|
+
children: () => rowFilterOptionsFieldMaskSchema,
|
|
251
|
+
},
|
|
252
|
+
toPrincipals: { wire: 'to_principals' },
|
|
253
|
+
updatedAt: { wire: 'updated_at' },
|
|
254
|
+
updatedBy: { wire: 'updated_by' },
|
|
255
|
+
whenCondition: { wire: 'when_condition' },
|
|
256
|
+
};
|
|
257
|
+
export function policyInfoFieldMask(...paths) {
|
|
258
|
+
return FieldMask.build(paths, policyInfoFieldMaskSchema);
|
|
259
|
+
}
|
|
260
|
+
const rowFilterOptionsFieldMaskSchema = {
|
|
261
|
+
functionName: { wire: 'function_name' },
|
|
262
|
+
using: { wire: 'using' },
|
|
263
|
+
};
|
|
264
|
+
//# 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,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,6DAA6D;IAC7D,iEAAmD,CAAA;IACnD,+DAAiD,CAAA;IACjD,iEAAmD,CAAA;AACrD,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAED,2CAA2C;AAC3C,MAAM,CAAN,IAAY,aAmBX;AAnBD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;IACjB,gCAAe,CAAA;IACf,0DAAyC,CAAA;IACzC,wDAAuC,CAAA;IACvC,sCAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;IACvB,0CAAyB,CAAA;IACzB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;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EAAC,IAAI,EAAE,SAAS,EAAC;IAC1B,SAAS,EAAE,EAAC,IAAI,EAAE,YAAY,EAAC;IAC/B,SAAS,EAAE,EAAC,IAAI,EAAE,YAAY,EAAC;IAC/B,gBAAgB,EAAE,EAAC,IAAI,EAAE,mBAAmB,EAAC;IAC7C,gBAAgB,EAAE,EAAC,IAAI,EAAE,oBAAoB,EAAC;IAC9C,EAAE,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC;IAChB,YAAY,EAAE,EAAC,IAAI,EAAE,eAAe,EAAC;IACrC,IAAI,EAAE,EAAC,IAAI,EAAE,MAAM,EAAC;IACpB,mBAAmB,EAAE,EAAC,IAAI,EAAE,uBAAuB,EAAC;IACpD,eAAe,EAAE,EAAC,IAAI,EAAE,mBAAmB,EAAC;IAC5C,UAAU,EAAE,EAAC,IAAI,EAAE,aAAa,EAAC;IACjC,SAAS,EAAE;QACT,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,GAAG,EAAE,CAAC,+BAA+B;KAChD;IACD,YAAY,EAAE,EAAC,IAAI,EAAE,eAAe,EAAC;IACrC,SAAS,EAAE,EAAC,IAAI,EAAE,YAAY,EAAC;IAC/B,SAAS,EAAE,EAAC,IAAI,EAAE,YAAY,EAAC;IAC/B,aAAa,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC;CACxC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,GAAG,KAAe;IACpD,OAAO,SAAS,CAAC,KAAK,CAAa,KAAK,EAAE,yBAAyB,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,+BAA+B,GAAoB;IACvD,YAAY,EAAE,EAAC,IAAI,EAAE,eAAe,EAAC;IACrC,KAAK,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HttpClient } from '@databricks/sdk-core/http';
|
|
2
|
+
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
|
+
/** Creates a new HTTP client with the given options. */
|
|
4
|
+
export declare function newHttpClient(options?: ClientOptions): HttpClient;
|
|
5
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAElE,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,UAAU,CAwBjE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
import { defaultCredentials } from '@databricks/sdk-auth/credentials';
|
|
3
|
+
import { newFetchHttpClient } from '@databricks/sdk-core/http';
|
|
4
|
+
/** Creates a new HTTP client with the given options. */
|
|
5
|
+
export function newHttpClient(options) {
|
|
6
|
+
const opts = options ?? {};
|
|
7
|
+
// If an HTTP client is provided, use it as-is. Throw if other options are
|
|
8
|
+
// also set, since they would be silently ignored.
|
|
9
|
+
if (opts.httpClient !== undefined) {
|
|
10
|
+
if (opts.credentials !== undefined || opts.timeout !== undefined) {
|
|
11
|
+
throw new Error('httpClient cannot be combined with credentials or timeout');
|
|
12
|
+
}
|
|
13
|
+
return opts.httpClient;
|
|
14
|
+
}
|
|
15
|
+
const credentials = opts.credentials ?? defaultCredentials();
|
|
16
|
+
const base = newFetchHttpClient();
|
|
17
|
+
let client = new AuthHttpClient(base, credentials);
|
|
18
|
+
if (opts.timeout !== undefined) {
|
|
19
|
+
client = new TimeoutHttpClient(client, opts.timeout);
|
|
20
|
+
}
|
|
21
|
+
return client;
|
|
22
|
+
}
|
|
23
|
+
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
24
|
+
class AuthHttpClient {
|
|
25
|
+
base;
|
|
26
|
+
credentials;
|
|
27
|
+
constructor(base, credentials) {
|
|
28
|
+
this.base = base;
|
|
29
|
+
this.credentials = credentials;
|
|
30
|
+
}
|
|
31
|
+
async send(request) {
|
|
32
|
+
const authHeaders = await this.credentials.authHeaders();
|
|
33
|
+
// Do not modify the original request.
|
|
34
|
+
const headers = new Headers(request.headers);
|
|
35
|
+
for (const h of authHeaders) {
|
|
36
|
+
headers.set(h.key, h.value);
|
|
37
|
+
}
|
|
38
|
+
return this.base.send({ ...request, headers });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
42
|
+
class TimeoutHttpClient {
|
|
43
|
+
base;
|
|
44
|
+
timeout;
|
|
45
|
+
constructor(base, timeout) {
|
|
46
|
+
this.base = base;
|
|
47
|
+
this.timeout = timeout;
|
|
48
|
+
}
|
|
49
|
+
async send(request) {
|
|
50
|
+
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
51
|
+
const signal = request.signal !== undefined
|
|
52
|
+
? AbortSignal.any([request.signal, timeoutSignal])
|
|
53
|
+
: timeoutSignal;
|
|
54
|
+
return this.base.send({ ...request, signal });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAMpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAG7D,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAAC,OAAuB;IACnD,MAAM,IAAI,GAAG,OAAO,IAAI,EAAE,CAAC;IAE3B,0EAA0E;IAC1E,kDAAkD;IAClD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,I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AAY;QAChB,YAAO,GAAP,OAAO,CAAQ;IAC/B,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxD,MAAM,MAAM,GACV,OAAO,CAAC,MAAM,KAAK,SAAS;YAC1B,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;YAClD,CAAC,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,GAAG,OAAO,EAAE,MAAM,EAAC,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { HttpClient, HttpRequest } from '@databricks/sdk-core/http';
|
|
2
|
+
import type { Logger } from '@databricks/sdk-core/logger';
|
|
3
|
+
import type { CallOptions } from '@databricks/sdk-options/call';
|
|
4
|
+
import type { z } from 'zod';
|
|
5
|
+
export interface HttpCallOptions {
|
|
6
|
+
readonly request: HttpRequest;
|
|
7
|
+
readonly httpClient: HttpClient;
|
|
8
|
+
readonly logger: Logger;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Translates public CallOptions to the internal Options shape accepted by
|
|
12
|
+
* execute(). Even though the shapes match today, this isolates the public
|
|
13
|
+
* API from the executor's internal type so they can diverge.
|
|
14
|
+
*/
|
|
15
|
+
export declare function executeCall(call: (signal?: AbortSignal) => Promise<void>, options?: CallOptions): Promise<void>;
|
|
16
|
+
export declare function executeHttpCall(opts: HttpCallOptions): Promise<Uint8Array>;
|
|
17
|
+
export declare function buildHttpRequest(method: string, url: string, headers: Headers, signal?: AbortSignal, body?: string | ReadableStream<Uint8Array>): HttpRequest;
|
|
18
|
+
export declare function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T;
|
|
19
|
+
export declare function marshalRequest(data: unknown, schema: z.ZodType): string;
|
|
20
|
+
export declare function flattenQueryParams(prefix: string, value: unknown, params: URLSearchParams): void;
|
|
21
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EAEZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AACxD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAO3B,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,EAC7C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,IAAI,CAAC,CASf;AA2BD,wBAAsB,eAAe,CACnC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,UAAU,CAAC,CA2BrB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,GACzC,WAAW,CASb;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAI1E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE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