@databricks/sdk-uc-grants 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 +46 -42
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +193 -256
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/index.d.ts +3 -6
- package/dist/v1/index.js +3 -6
- package/dist/v1/model.d.ts +186 -182
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +69 -101
- 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/v1/model.js
CHANGED
|
@@ -1,111 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
inheritedFromName: d.inherited_from_name,
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/v1/model.ts
|
|
4
|
+
const unmarshalEffectivePrivilegeSchema = z.object({
|
|
5
|
+
privilege: z.string().optional(),
|
|
6
|
+
inherited_from_type: z.string().optional(),
|
|
7
|
+
inherited_from_name: z.string().optional()
|
|
8
|
+
}).transform((d) => ({
|
|
9
|
+
privilege: d.privilege,
|
|
10
|
+
inheritedFromType: d.inherited_from_type,
|
|
11
|
+
inheritedFromName: d.inherited_from_name
|
|
13
12
|
}));
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
21
|
-
.transform(d => ({
|
|
22
|
-
principal: d.principal,
|
|
23
|
-
privileges: d.privileges,
|
|
13
|
+
const unmarshalEffectivePrivilegeAssignmentSchema = z.object({
|
|
14
|
+
principal: z.string().optional(),
|
|
15
|
+
privileges: z.array(z.lazy(() => unmarshalEffectivePrivilegeSchema)).optional()
|
|
16
|
+
}).transform((d) => ({
|
|
17
|
+
principal: d.principal,
|
|
18
|
+
privileges: d.privileges
|
|
24
19
|
}));
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
32
|
-
.transform(d => ({
|
|
33
|
-
nextPageToken: d.next_page_token,
|
|
34
|
-
privilegeAssignments: d.privilege_assignments,
|
|
20
|
+
const unmarshalGetEffectivePermissionsResponseSchema = z.object({
|
|
21
|
+
next_page_token: z.string().optional(),
|
|
22
|
+
privilege_assignments: z.array(z.lazy(() => unmarshalEffectivePrivilegeAssignmentSchema)).optional()
|
|
23
|
+
}).transform((d) => ({
|
|
24
|
+
nextPageToken: d.next_page_token,
|
|
25
|
+
privilegeAssignments: d.privilege_assignments
|
|
35
26
|
}));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
.transform(d => ({
|
|
44
|
-
nextPageToken: d.next_page_token,
|
|
45
|
-
privilegeAssignments: d.privilege_assignments,
|
|
27
|
+
const unmarshalGetPermissionsResponseSchema = z.object({
|
|
28
|
+
next_page_token: z.string().optional(),
|
|
29
|
+
privilege_assignments: z.array(z.lazy(() => unmarshalPrivilegeAssignmentSchema)).optional()
|
|
30
|
+
}).transform((d) => ({
|
|
31
|
+
nextPageToken: d.next_page_token,
|
|
32
|
+
privilegeAssignments: d.privilege_assignments
|
|
46
33
|
}));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
})
|
|
54
|
-
.transform(d => ({
|
|
55
|
-
effectivePrivilegeAssignments: d.effective_privilege_assignments,
|
|
56
|
-
nextPageToken: d.next_page_token,
|
|
34
|
+
const unmarshalListEffectivePrivilegeAssignmentsResponseSchema = z.object({
|
|
35
|
+
effective_privilege_assignments: z.array(z.lazy(() => unmarshalEffectivePrivilegeAssignmentSchema)).optional(),
|
|
36
|
+
next_page_token: z.string().optional()
|
|
37
|
+
}).transform((d) => ({
|
|
38
|
+
effectivePrivilegeAssignments: d.effective_privilege_assignments,
|
|
39
|
+
nextPageToken: d.next_page_token
|
|
57
40
|
}));
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
})
|
|
65
|
-
.transform(d => ({
|
|
66
|
-
privilegeAssignments: d.privilege_assignments,
|
|
67
|
-
nextPageToken: d.next_page_token,
|
|
41
|
+
const unmarshalListPrivilegeAssignmentsResponseSchema = z.object({
|
|
42
|
+
privilege_assignments: z.array(z.lazy(() => unmarshalPrivilegeAssignmentSchema)).optional(),
|
|
43
|
+
next_page_token: z.string().optional()
|
|
44
|
+
}).transform((d) => ({
|
|
45
|
+
privilegeAssignments: d.privilege_assignments,
|
|
46
|
+
nextPageToken: d.next_page_token
|
|
68
47
|
}));
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
principal: d.principal,
|
|
76
|
-
privileges: d.privileges,
|
|
48
|
+
const unmarshalPrivilegeAssignmentSchema = z.object({
|
|
49
|
+
principal: z.string().optional(),
|
|
50
|
+
privileges: z.array(z.string()).optional()
|
|
51
|
+
}).transform((d) => ({
|
|
52
|
+
principal: d.principal,
|
|
53
|
+
privileges: d.privileges
|
|
77
54
|
}));
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
|
|
55
|
+
const unmarshalUpdatePermissionsResponseSchema = z.object({ privilege_assignments: z.array(z.lazy(() => unmarshalPrivilegeAssignmentSchema)).optional() }).transform((d) => ({ privilegeAssignments: d.privilege_assignments }));
|
|
56
|
+
const marshalPermissionsChangeSchema = z.object({
|
|
57
|
+
principal: z.string().optional(),
|
|
58
|
+
add: z.array(z.string()).optional(),
|
|
59
|
+
remove: z.array(z.string()).optional()
|
|
60
|
+
}).transform((d) => ({
|
|
61
|
+
principal: d.principal,
|
|
62
|
+
add: d.add,
|
|
63
|
+
remove: d.remove
|
|
86
64
|
}));
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}));
|
|
98
|
-
export const marshalUpdatePermissionsRequestSchema = z
|
|
99
|
-
.object({
|
|
100
|
-
securableType: z.string().optional(),
|
|
101
|
-
securableFullName: z.string().optional(),
|
|
102
|
-
omitPermissionsInResponse: z.boolean().optional(),
|
|
103
|
-
changes: z.array(z.lazy(() => marshalPermissionsChangeSchema)).optional(),
|
|
104
|
-
})
|
|
105
|
-
.transform(d => ({
|
|
106
|
-
securable_type: d.securableType,
|
|
107
|
-
securable_full_name: d.securableFullName,
|
|
108
|
-
omit_permissions_in_response: d.omitPermissionsInResponse,
|
|
109
|
-
changes: d.changes,
|
|
65
|
+
const marshalUpdatePermissionsRequestSchema = z.object({
|
|
66
|
+
securableType: z.string().optional(),
|
|
67
|
+
securableFullName: z.string().optional(),
|
|
68
|
+
omitPermissionsInResponse: z.boolean().optional(),
|
|
69
|
+
changes: z.array(z.lazy(() => marshalPermissionsChangeSchema)).optional()
|
|
70
|
+
}).transform((d) => ({
|
|
71
|
+
securable_type: d.securableType,
|
|
72
|
+
securable_full_name: d.securableFullName,
|
|
73
|
+
omit_permissions_in_response: d.omitPermissionsInResponse,
|
|
74
|
+
changes: d.changes
|
|
110
75
|
}));
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { marshalPermissionsChangeSchema, marshalUpdatePermissionsRequestSchema, unmarshalEffectivePrivilegeAssignmentSchema, unmarshalEffectivePrivilegeSchema, unmarshalGetEffectivePermissionsResponseSchema, unmarshalGetPermissionsResponseSchema, unmarshalListEffectivePrivilegeAssignmentsResponseSchema, unmarshalListPrivilegeAssignmentsResponseSchema, unmarshalPrivilegeAssignmentSchema, unmarshalUpdatePermissionsResponseSchema };
|
|
111
79
|
//# sourceMappingURL=model.js.map
|
package/dist/v1/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAyMtB,MAAM,CAAC,MAAM,iCAAiC,GAC5C,CAAC;KACE,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC;KACD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,SAAS,EAAE,CAAC,CAAC,SAAS;IACtB,iBAAiB,EAAE,CAAC,CAAC,mBAAmB;IACxC,iBAAiB,EAAE,CAAC,CAAC,mBAAmB;CACzC,CAAC,CAAC,CAAC;AAER,MAAM,CAAC,MAAM,2CAA2C,GACtD,CAAC;KACE,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,CAAC;SACV,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAA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C,qBAAqB;CAC9C,CAAC,CAAC,CAAC;AAER,MAAM,CAAC,MAAM,8BAA8B,GAAc,CAAC;KACvD,MAAM,CAAC;IACN,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACnC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC;KACD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,SAAS,EAAE,CAAC,CAAC,SAAS;IACtB,GAAG,EAAE,CAAC,CAAC,GAAG;IACV,MAAM,EAAE,CAAC,CAAC,MAAM;CACjB,CAAC,CAAC,CAAC;AAEN,MAAM,CAAC,MAAM,qCAAqC,GAAc,CAAC;KAC9D,MAAM,CAAC;IACN,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,yBAAyB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,8BAA8B,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC1E,CAAC;KACD,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACf,cAAc,EAAE,CAAC,CAAC,aAAa;IAC/B,mBAAmB,EAAE,CAAC,CAAC,iBAAiB;IACxC,4BAA4B,EAAE,CAAC,CAAC,yBAAyB;IACzD,OAAO,EAAE,CAAC,CAAC,OAAO;CACnB,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../src/v1/model.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {z} from 'zod';\n\nexport interface EffectivePrivilege {\n /** The privilege assigned to the principal. */\n privilege?: string | undefined;\n /**\n * The type of the object that conveys this privilege via inheritance.\n * This field is omitted when privilege is not inherited (it's assigned to the securable itself).\n */\n inheritedFromType?: string | undefined;\n /**\n * The full name of the object that conveys this privilege via inheritance.\n * This field is omitted when privilege is not inherited (it's assigned to the securable itself).\n */\n inheritedFromName?: string | undefined;\n}\n\nexport interface EffectivePrivilegeAssignment {\n /** The principal (user email address or group name). */\n principal?: string | undefined;\n /** The privileges conveyed to the principal (either directly or via inheritance). */\n privileges?: EffectivePrivilege[] | undefined;\n}\n\nexport interface GetEffectivePermissionsRequest {\n /** Type of securable. */\n securableType?: string | undefined;\n /** Full name of securable. */\n securableFullName?: string | undefined;\n /** If provided, only the effective permissions for the specified principal (user or group) are returned. */\n principal?: string | undefined;\n /**\n * Specifies the maximum number of privileges to return (page length).\n * Every EffectivePrivilegeAssignment present in a single page response is guaranteed to contain all the effective\n * privileges granted on (or inherited by) the requested Securable for the respective principal.\n *\n * If not set, all the effective permissions are returned.\n * If set to\n * - lesser than 0: invalid parameter error\n * - 0: page length is set to a server configured value\n * - lesser than 150 but greater than 0: invalid parameter error (this is to ensure that server is able to return at\n * least one complete EffectivePrivilegeAssignment in a single page response)\n * - greater than (or equal to) 150: page length is the minimum of this value and a server configured value\n */\n maxResults?: number | undefined;\n /** Opaque token for the next page of results (pagination). */\n pageToken?: string | undefined;\n}\n\nexport interface GetEffectivePermissionsResponse {\n /**\n * Opaque token to retrieve the next page of results. Absent if there are no more pages.\n * __page_token__ should be set to this value for the next request (for the next page of results).\n */\n nextPageToken?: string | undefined;\n /** The privileges conveyed to each principal (either directly or via inheritance) */\n privilegeAssignments?: EffectivePrivilegeAssignment[] | undefined;\n}\n\nexport interface GetPermissionsRequest {\n /** Type of securable. */\n securableType?: string | undefined;\n /** Full name of securable. */\n securableFullName?: string | undefined;\n /** If provided, only the permissions for the specified principal (user or group) are returned. */\n principal?: string | undefined;\n /**\n * Specifies the maximum number of privileges to return (page length).\n * Every PrivilegeAssignment present in a single page response is guaranteed to contain all the privileges granted on\n * the requested Securable for the respective principal.\n *\n * If not set, all the permissions are returned.\n * If set to\n * - lesser than 0: invalid parameter error\n * - 0: page length is set to a server configured value\n * - lesser than 150 but greater than 0: invalid parameter error (this is to ensure that server is able to return at\n * least one complete PrivilegeAssignment in a single page response)\n * - greater than (or equal to) 150: page length is the minimum of this value and a server configured value\n */\n maxResults?: number | undefined;\n /** Opaque pagination token to go to next page based on previous query. */\n pageToken?: string | undefined;\n}\n\nexport interface GetPermissionsResponse {\n /**\n * Opaque token to retrieve the next page of results. Absent if there are no more pages.\n * __page_token__ should be set to this value for the next request (for the next page of results).\n */\n nextPageToken?: string | undefined;\n /** The privileges assigned to each principal */\n privilegeAssignments?: PrivilegeAssignment[] | undefined;\n}\n\nexport interface ListEffectivePrivilegeAssignmentsRequest {\n /** Type of securable. */\n securableType?: string | undefined;\n /** Full name of securable. */\n fullName?: string | undefined;\n /** If provided, only the effective permissions for the specified principal (user or group) are returned. */\n principal?: string | undefined;\n /**\n * Specifies the maximum number of privilege assignments to return (page length).\n * Every EffectivePrivilegeAssignment present in a single page response is guaranteed to contain all the effective\n * privileges granted on (or inherited by) the requested Securable for the respective principal.\n *\n * If not set, a server-configured default is used.\n * If set to\n * - lesser than 0: invalid parameter error\n * - 0: page length is set to a server configured value\n * - lesser than 150 but greater than 0: invalid parameter error (this is to ensure that server is able to return at\n * least one complete EffectivePrivilegeAssignment in a single page response)\n * - greater than (or equal to) 150: page length is the minimum of this value and a server configured value\n */\n pageSize?: number | undefined;\n /** Opaque pagination token to go to next page based on previous query. */\n pageToken?: string | undefined;\n}\n\nexport interface ListEffectivePrivilegeAssignmentsResponse {\n /** The effective privilege assignments for the securable (and optional principal). */\n effectivePrivilegeAssignments?: EffectivePrivilegeAssignment[] | undefined;\n /**\n * Opaque token to retrieve the next page of results. Absent if there are no more pages.\n * __page_token__ should be set to this value for the next request (for the next page of results).\n */\n nextPageToken?: string | undefined;\n}\n\nexport interface ListPrivilegeAssignmentsRequest {\n /** Type of securable. */\n securableType?: string | undefined;\n /** Full name of securable. */\n fullName?: string | undefined;\n /** If provided, only the permissions for the specified principal (user or group) are returned. */\n principal?: string | undefined;\n /**\n * Specifies the maximum number of privilege assignments to return (page length).\n * Every PrivilegeAssignment present in a single page response is guaranteed to contain all the privileges granted on\n * the requested Securable for the respective principal.\n *\n * If not set, page length is the server configured value.\n * If set to\n * - lesser than 0: invalid parameter error\n * - 0: page length is set to a server configured value\n * - lesser than 150 but greater than 0: invalid parameter error (this is to ensure that server is able to return at\n * least one complete PrivilegeAssignment in a single page response)\n * - greater than (or equal to) 150: page length is the minimum of this value and a server configured value\n */\n pageSize?: number | undefined;\n /** Opaque pagination token to go to next page based on previous query. */\n pageToken?: string | undefined;\n}\n\nexport interface ListPrivilegeAssignmentsResponse {\n privilegeAssignments?: PrivilegeAssignment[] | undefined;\n /**\n * Opaque token to retrieve the next page of results. Absent if there are no more pages.\n * __page_token__ should be set to this value for the next request (for the next page of results).\n */\n nextPageToken?: string | undefined;\n}\n\nexport interface PermissionsChange {\n /**\n * The principal whose privileges we are changing.\n * Only one of principal or principal_id should be specified, never both at the same time.\n */\n principal?: string | undefined;\n /** The set of privileges to add. */\n add?: string[] | undefined;\n /** The set of privileges to remove. */\n remove?: string[] | undefined;\n}\n\nexport interface PrivilegeAssignment {\n /**\n * The principal (user email address or group name).\n * For deleted principals, `principal` is empty while `principal_id` is populated.\n */\n principal?: string | undefined;\n /** The privileges assigned to the principal. */\n privileges?: string[] | undefined;\n}\n\nexport interface UpdatePermissionsRequest {\n /** Type of securable. */\n securableType?: string | undefined;\n /** Full name of securable. */\n securableFullName?: string | undefined;\n /** Optional, default false. Specifies whether all the permissions should be returned in the response. */\n omitPermissionsInResponse?: boolean | undefined;\n /** Array of permissions change objects. */\n changes?: PermissionsChange[] | undefined;\n}\n\nexport interface UpdatePermissionsResponse {\n /** The privileges assigned to each principal */\n privilegeAssignments?: PrivilegeAssignment[] | undefined;\n}\n\nexport const unmarshalEffectivePrivilegeSchema: z.ZodType<EffectivePrivilege> =\n z\n .object({\n privilege: z.string().optional(),\n inherited_from_type: z.string().optional(),\n inherited_from_name: z.string().optional(),\n })\n .transform(d => ({\n privilege: d.privilege,\n inheritedFromType: d.inherited_from_type,\n inheritedFromName: d.inherited_from_name,\n }));\n\nexport const unmarshalEffectivePrivilegeAssignmentSchema: z.ZodType<EffectivePrivilegeAssignment> =\n z\n .object({\n principal: z.string().optional(),\n privileges: z\n .array(z.lazy(() => unmarshalEffectivePrivilegeSchema))\n .optional(),\n })\n .transform(d => ({\n principal: d.principal,\n privileges: d.privileges,\n }));\n\nexport const unmarshalGetEffectivePermissionsResponseSchema: z.ZodType<GetEffectivePermissionsResponse> =\n z\n .object({\n next_page_token: z.string().optional(),\n privilege_assignments: z\n .array(z.lazy(() => unmarshalEffectivePrivilegeAssignmentSchema))\n .optional(),\n })\n .transform(d => ({\n nextPageToken: d.next_page_token,\n privilegeAssignments: d.privilege_assignments,\n }));\n\nexport const unmarshalGetPermissionsResponseSchema: z.ZodType<GetPermissionsResponse> =\n z\n .object({\n next_page_token: z.string().optional(),\n privilege_assignments: z\n .array(z.lazy(() => unmarshalPrivilegeAssignmentSchema))\n .optional(),\n })\n .transform(d => ({\n nextPageToken: d.next_page_token,\n privilegeAssignments: d.privilege_assignments,\n }));\n\nexport const unmarshalListEffectivePrivilegeAssignmentsResponseSchema: z.ZodType<ListEffectivePrivilegeAssignmentsResponse> =\n z\n .object({\n effective_privilege_assignments: z\n .array(z.lazy(() => unmarshalEffectivePrivilegeAssignmentSchema))\n .optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n effectivePrivilegeAssignments: d.effective_privilege_assignments,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalListPrivilegeAssignmentsResponseSchema: z.ZodType<ListPrivilegeAssignmentsResponse> =\n z\n .object({\n privilege_assignments: z\n .array(z.lazy(() => unmarshalPrivilegeAssignmentSchema))\n .optional(),\n next_page_token: z.string().optional(),\n })\n .transform(d => ({\n privilegeAssignments: d.privilege_assignments,\n nextPageToken: d.next_page_token,\n }));\n\nexport const unmarshalPrivilegeAssignmentSchema: z.ZodType<PrivilegeAssignment> =\n z\n .object({\n principal: z.string().optional(),\n privileges: z.array(z.string()).optional(),\n })\n .transform(d => ({\n principal: d.principal,\n privileges: d.privileges,\n }));\n\nexport const unmarshalUpdatePermissionsResponseSchema: z.ZodType<UpdatePermissionsResponse> =\n z\n .object({\n privilege_assignments: z\n .array(z.lazy(() => unmarshalPrivilegeAssignmentSchema))\n .optional(),\n })\n .transform(d => ({\n privilegeAssignments: d.privilege_assignments,\n }));\n\nexport const marshalPermissionsChangeSchema: z.ZodType = z\n .object({\n principal: z.string().optional(),\n add: z.array(z.string()).optional(),\n remove: z.array(z.string()).optional(),\n })\n .transform(d => ({\n principal: d.principal,\n add: d.add,\n remove: d.remove,\n }));\n\nexport const marshalUpdatePermissionsRequestSchema: z.ZodType = z\n .object({\n securableType: z.string().optional(),\n securableFullName: z.string().optional(),\n omitPermissionsInResponse: z.boolean().optional(),\n changes: z.array(z.lazy(() => marshalPermissionsChangeSchema)).optional(),\n })\n .transform(d => ({\n securable_type: d.securableType,\n securable_full_name: d.securableFullName,\n omit_permissions_in_response: d.omitPermissionsInResponse,\n changes: d.changes,\n }));\n"],"mappings":";;;AA2MA,MAAa,oCACX,EACG,OAAO;CACN,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,qBAAqB,EAAE,QAAQ,CAAC,UAAU;CAC1C,qBAAqB,EAAE,QAAQ,CAAC,UAAU;CAC3C,CAAC,CACD,WAAU,OAAM;CACf,WAAW,EAAE;CACb,mBAAmB,EAAE;CACrB,mBAAmB,EAAE;CACtB,EAAE;AAEP,MAAa,8CACX,EACG,OAAO;CACN,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,YAAY,EACT,MAAM,E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AU,EACd,CAAC,CACD,WAAU,OAAM,EACf,sBAAsB,EAAE,uBACzB,EAAE;AAEP,MAAa,iCAA4C,EACtD,OAAO;CACN,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;CACnC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;CACvC,CAAC,CACD,WAAU,OAAM;CACf,WAAW,EAAE;CACb,KAAK,EAAE;CACP,QAAQ,EAAE;CACX,EAAE;AAEL,MAAa,wCAAmD,EAC7D,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,mBAAmB,EAAE,QAAQ,CAAC,UAAU;CACxC,2BAA2B,EAAE,SAAS,CAAC,UAAU;CACjD,SAAS,EAAE,MAAM,EAAE,WAAW,+BAA+B,CAAC,CAAC,UAAU;CAC1E,CAAC,CACD,WAAU,OAAM;CACf,gBAAgB,EAAE;CAClB,qBAAqB,EAAE;CACvB,8BAA8B,EAAE;CAChC,SAAS,EAAE;CACZ,EAAE"}
|
package/dist/v1/transport.d.ts
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { HttpClient } from "@databricks/sdk-core/http";
|
|
2
|
+
import { ClientOptions } from "@databricks/sdk-options/client";
|
|
3
|
+
|
|
4
|
+
//#region src/v1/transport.d.ts
|
|
3
5
|
/**
|
|
4
6
|
* The configuration a client needs to issue requests, resolved from
|
|
5
7
|
* {@link ClientOptions} and a configuration profile.
|
|
6
8
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
interface ResolvedClientConfig {
|
|
10
|
+
/** Host with any trailing slash removed. */
|
|
11
|
+
host: string;
|
|
12
|
+
/**
|
|
13
|
+
* Default account ID for account-level paths that contain an account_id
|
|
14
|
+
* segment. A request's own accountId still wins.
|
|
15
|
+
*/
|
|
16
|
+
accountId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
19
|
+
*/
|
|
20
|
+
workspaceId?: string;
|
|
21
|
+
/** HTTP client with authentication, and any configured timeout, applied. */
|
|
22
|
+
httpClient: HttpClient;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
@@ -29,5 +31,7 @@ export interface ResolvedClientConfig {
|
|
|
29
31
|
*
|
|
30
32
|
* @throws if host is neither provided nor present in the resolved profile.
|
|
31
33
|
*/
|
|
32
|
-
|
|
34
|
+
declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ResolvedClientConfig, resolveClientConfig };
|
|
33
37
|
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","
|
|
1
|
+
{"version":3,"file":"transport.d.ts","names":[],"sources":["../../src/v1/transport.ts"],"mappings":";;;;;;AAkBA;;UAAiB,oBAAA;EAgBO;EAdtB,IAAA;EAMA;;;;EAAA,SAAA;EAQsB;AAaxB;;EAhBE,WAAA;EAiBS;EAdT,UAAA,EAAY,UAAA;AAAA;;;;;;;;;;;iBAaQ,mBAAA,CACpB,OAAA,EAAS,aAAA,GACR,OAAA,CAAQ,oBAAA"}
|
package/dist/v1/transport.js
CHANGED
|
@@ -1,74 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defaultCredentials } from "@databricks/sdk-auth/credentials";
|
|
2
|
+
import { newFetchHttpClient } from "@databricks/sdk-core/http";
|
|
3
|
+
import { resolve } from "@databricks/sdk-core/profiles";
|
|
4
|
+
|
|
5
|
+
//#region src/v1/transport.ts
|
|
5
6
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
httpClient = new TimeoutHttpClient(httpClient, options.timeout);
|
|
30
|
-
}
|
|
31
|
-
const accountId = options.accountId ?? profile.accountId;
|
|
32
|
-
const workspaceId = options.workspaceId ?? profile.workspaceId;
|
|
33
|
-
return {
|
|
34
|
-
host: host.replace(/\/$/, ''),
|
|
35
|
-
httpClient,
|
|
36
|
-
...(accountId !== undefined && { accountId }),
|
|
37
|
-
...(workspaceId !== undefined && { workspaceId }),
|
|
38
|
-
};
|
|
7
|
+
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
8
|
+
*
|
|
9
|
+
* A configuration profile is always resolved from the config file and
|
|
10
|
+
* environment variables (per options.profileOptions); it supplies host,
|
|
11
|
+
* accountId, workspaceId, and credentials wherever the caller did not set them
|
|
12
|
+
* explicitly. Explicit options always take precedence.
|
|
13
|
+
*
|
|
14
|
+
* @throws if host is neither provided nor present in the resolved profile.
|
|
15
|
+
*/
|
|
16
|
+
async function resolveClientConfig(options) {
|
|
17
|
+
const profile = await resolve(options.profileOptions);
|
|
18
|
+
const host = options.host ?? profile.host;
|
|
19
|
+
if (host === void 0) throw new Error("Host is required.");
|
|
20
|
+
let httpClient = new AuthHttpClient(options.httpClient ?? newFetchHttpClient(), options.credentials ?? defaultCredentials({ profile }));
|
|
21
|
+
if (options.timeout !== void 0) httpClient = new TimeoutHttpClient(httpClient, options.timeout);
|
|
22
|
+
const accountId = options.accountId ?? profile.accountId;
|
|
23
|
+
const workspaceId = options.workspaceId ?? profile.workspaceId;
|
|
24
|
+
return {
|
|
25
|
+
host: host.replace(/\/$/, ""),
|
|
26
|
+
httpClient,
|
|
27
|
+
...accountId !== void 0 && { accountId },
|
|
28
|
+
...workspaceId !== void 0 && { workspaceId }
|
|
29
|
+
};
|
|
39
30
|
}
|
|
40
31
|
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
}
|
|
32
|
+
var AuthHttpClient = class {
|
|
33
|
+
constructor(base, credentials) {
|
|
34
|
+
this.base = base;
|
|
35
|
+
this.credentials = credentials;
|
|
36
|
+
}
|
|
37
|
+
async send(request) {
|
|
38
|
+
const authHeaders = await this.credentials.authHeaders();
|
|
39
|
+
const headers = new Headers(request.headers);
|
|
40
|
+
for (const h of authHeaders) headers.set(h.key, h.value);
|
|
41
|
+
return this.base.send({
|
|
42
|
+
...request,
|
|
43
|
+
headers
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
58
47
|
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
48
|
+
var TimeoutHttpClient = class {
|
|
49
|
+
constructor(base, timeout) {
|
|
50
|
+
this.base = base;
|
|
51
|
+
this.timeout = timeout;
|
|
52
|
+
}
|
|
53
|
+
async send(request) {
|
|
54
|
+
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
55
|
+
const signal = request.signal !== void 0 ? AbortSignal.any([request.signal, timeoutSignal]) : timeoutSignal;
|
|
56
|
+
return this.base.send({
|
|
57
|
+
...request,
|
|
58
|
+
signal
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { resolveClientConfig };
|
|
74
65
|
//# sourceMappingURL=transport.js.map
|
package/dist/v1/transport.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","
|
|
1
|
+
{"version":3,"file":"transport.js","names":[],"sources":["../../src/v1/transport.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {Credentials} from '@databricks/sdk-auth';\nimport {defaultCredentials} from '@databricks/sdk-auth/credentials';\nimport type {\n HttpClient,\n HttpRequest,\n HttpResponse,\n} from '@databricks/sdk-core/http';\nimport {newFetchHttpClient} from '@databricks/sdk-core/http';\nimport type {Profile} from '@databricks/sdk-core/profiles';\nimport {resolve} from '@databricks/sdk-core/profiles';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\n\n/**\n * The configuration a client needs to issue requests, resolved from\n * {@link ClientOptions} and a configuration profile.\n */\nexport interface ResolvedClientConfig {\n /** Host with any trailing slash removed. */\n host: string;\n\n /**\n * Default account ID for account-level paths that contain an account_id\n * segment. A request's own accountId still wins.\n */\n accountId?: string;\n\n /**\n * Workspace ID used to route workspace-level calls on unified hosts (SPOG).\n */\n workspaceId?: string;\n\n /** HTTP client with authentication, and any configured timeout, applied. */\n httpClient: HttpClient;\n}\n\n/**\n * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.\n *\n * A configuration profile is always resolved from the config file and\n * environment variables (per options.profileOptions); it supplies host,\n * accountId, workspaceId, and credentials wherever the caller did not set them\n * explicitly. Explicit options always take precedence.\n *\n * @throws if host is neither provided nor present in the resolved profile.\n */\nexport async function resolveClientConfig(\n options: ClientOptions\n): Promise<ResolvedClientConfig> {\n const profile: Profile = await resolve(options.profileOptions);\n\n const host = options.host ?? profile.host;\n if (host === undefined) {\n throw new Error('Host is required.');\n }\n\n // The provided httpClient (or the default fetch client) is the base wire;\n // authentication and the optional timeout are layered on top of it. The\n // default credential chain reuses the profile resolved above so that the\n // same profileOptions govern host and authentication alike.\n const base = options.httpClient ?? newFetchHttpClient();\n const credentials = options.credentials ?? defaultCredentials({profile});\n let httpClient: HttpClient = new AuthHttpClient(base, credentials);\n if (options.timeout !== undefined) {\n httpClient = new TimeoutHttpClient(httpClient, options.timeout);\n }\n\n const accountId = options.accountId ?? profile.accountId;\n const workspaceId = options.workspaceId ?? profile.workspaceId;\n\n return {\n host: host.replace(/\\/$/, ''),\n httpClient,\n ...(accountId !== undefined && {accountId}),\n ...(workspaceId !== undefined && {workspaceId}),\n };\n}\n\n/** Wraps an HttpClient and adds authentication headers to requests. */\nclass AuthHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly credentials: Credentials\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const authHeaders = await this.credentials.authHeaders();\n // Do not modify the original request.\n const headers = new Headers(request.headers);\n for (const h of authHeaders) {\n headers.set(h.key, h.value);\n }\n return this.base.send({...request, headers});\n }\n}\n\n/** Wraps an HttpClient and applies a default timeout to requests. */\nclass TimeoutHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly timeout: number\n ) {}\n\n async send(request: HttpRequest): Promise<HttpResponse> {\n const timeoutSignal = AbortSignal.timeout(this.timeout);\n const signal =\n request.signal !== undefined\n ? AbortSignal.any([request.signal, timeoutSignal])\n : timeoutSignal;\n return this.base.send({...request, signal});\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+CA,eAAsB,oBACpB,SAC+B;CAC/B,MAAM,UAAmB,MAAM,QAAQ,QAAQ,eAAe;CAE9D,MAAM,OAAO,QAAQ,QAAQ,QAAQ;AACrC,KAAI,SAAS,OACX,OAAM,IAAI,MAAM,oBAAoB;CAStC,IAAI,aAAy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equest } from "@databricks/sdk-core/http";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { CallOptions } from "@databricks/sdk-options/call";
|
|
5
|
+
|
|
6
|
+
//#region src/v1/utils.d.ts
|
|
7
|
+
interface HttpCallOptions {
|
|
8
|
+
readonly request: HttpRequest;
|
|
9
|
+
readonly httpClient: HttpClient;
|
|
10
|
+
readonly logger: Logger;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Translates public CallOptions to the internal Options shape accepted by
|
|
12
14
|
* execute(). Even though the shapes match today, this isolates the public
|
|
13
15
|
* API from the executor's internal type so they can diverge.
|
|
14
16
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
declare function executeCall(call: (signal?: AbortSignal) => Promise<void>, options?: CallOptions): Promise<void>;
|
|
18
|
+
declare function executeHttpCall(opts: HttpCallOptions): Promise<Uint8Array>;
|
|
19
|
+
declare function buildHttpRequest(method: string, url: string, headers: Headers, signal?: AbortSignal, body?: string | ReadableStream<Uint8Array>): HttpRequest;
|
|
20
|
+
declare function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T;
|
|
21
|
+
declare function marshalRequest(data: unknown, schema: z.ZodType): string;
|
|
22
|
+
declare function flattenQueryParams(prefix: string, value: unknown, params: URLSearchParams): void;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { HttpCallOptions, buildHttpRequest, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
|
|
21
25
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/v1/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/v1/utils.ts"],"mappings":";;;;;;UAoBiB,eAAA;EAAA,SACN,OAAA,EAAS,WAAA;EAAA,SACT,UAAA,EAAY,UAAA;EAAA,SACZ,MAAA,EAAQ,MAAA;AAAA;;;;;;iBAQG,WAAA,CACpB,IAAA,GAAO,MAAA,GAAS,WAAA,KAAgB,OAAA,QAChC,OAAA,GAAU,WAAA,GACT,OAAA;AAAA,iBAoCmB,eAAA,CACpB,IAAA,EAAM,eAAA,GACL,OAAA,CAAQ,UAAA;AAAA,iBA6BK,gBAAA,CACd,MAAA,UACA,GAAA,UACA,OAAA,EAAS,OAAA,EACT,MAAA,GAAS,WAAA,EACT,IAAA,YAAgB,cAAA,CAAe,UAAA,IAC9B,WAAA;AAAA,iBAWa,aAAA,GAAA,CAAiB,IAAA,EAAM,UAAA,EAAY,MAAA,EAAQ,CAAA,CAAE,OAAA,CAAQ,CAAA,IAAK,CAAA;AAAA,iBAO1D,cAAA,CAAe,IAAA,WAAe,MAAA,EAAQ,CAAA,CAAE,OAAA;AAAA,iBAIxC,kBAAA,CACd,MAAA,UACA,KAAA,WACA,MAAA,EAAQ,eAAA"}
|