@databricks/sdk-uc-grants 0.52.0 → 0.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region package.json
2
2
  var name = "@databricks/sdk-uc-grants";
3
- var version = "0.52.0";
3
+ var version = "0.52.1";
4
4
 
5
5
  //#endregion
6
6
  export { name, version };
@@ -6,7 +6,7 @@ import { ClientOptions } from "@databricks/sdk-options/client";
6
6
  declare class GrantsClient {
7
7
  private readonly options;
8
8
  private readonly logger;
9
- private readonly userAgent;
9
+ private readonly clientInfo;
10
10
  private config;
11
11
  constructor(options: ClientOptions);
12
12
  private resolveConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;cA+Ca,YAAA;EAAA,iBACM,OAAA;EAAA,iBACA,MAAA;EAAA,iBAIA,SAAA;EAAA,QAIT,MAAA;cAEI,OAAA,EAAS,aAAA;EAAA,QAUb,aAAA;EAeI;;;;;;;;EAFN,uBAAA,CACJ,GAAA,EAAK,8BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,+BAAA;EA+FA;;;;;;;;EA/CL,cAAA,CACJ,GAAA,EAAK,qBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,sBAAA;EA+GR;;;;EAtEG,iCAAA,CACJ,GAAA,EAAK,wCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,yCAAA;EAwCJ,qCAAA,CACL,GAAA,EAAK,wCAAA,EACL,OAAA,GAAU,WAAA,GACT,cAAA,CAAe,4BAAA;EAoFN;;;;EA/DN,wBAAA,CACJ,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,gCAAA;EAwCJ,4BAAA,CACL,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,cAAA,CAAe,mBAAA;EAjPD;EAgQX,iBAAA,CACJ,GAAA,EAAK,wBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,yBAAA;AAAA"}
1
+ {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;cAgDa,YAAA;EAAA,iBACM,OAAA;EAAA,iBACA,MAAA;EAAA,iBAIA,UAAA;EAAA,QAIT,MAAA;cAEI,OAAA,EAAS,aAAA;EAAA,QAQb,aAAA;EAeI;;;;;;;;EAFN,uBAAA,CACJ,GAAA,EAAK,8BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,+BAAA;EA6FA;;;;;;;;EA9CL,cAAA,CACJ,GAAA,EAAK,qBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,sBAAA;EA6GR;;;;EArEG,iCAAA,CACJ,GAAA,EAAK,wCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,yCAAA;EAuCJ,qCAAA,CACL,GAAA,EAAK,wCAAA,EACL,OAAA,GAAU,WAAA,GACT,cAAA,CAAe,4BAAA;EAmFN;;;;EA9DN,wBAAA,CACJ,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,gCAAA;EAuCJ,4BAAA,CACL,GAAA,EAAK,+BAAA,EACL,OAAA,GAAU,WAAA,GACT,cAAA,CAAe,mBAAA;EA3OD;EA0PX,iBAAA,CACJ,GAAA,EAAK,wBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,yBAAA;AAAA"}
package/dist/v1/client.js CHANGED
@@ -14,21 +14,18 @@ const PACKAGE_SEGMENT = {
14
14
  var GrantsClient = class {
15
15
  options;
16
16
  logger;
17
- userAgent;
17
+ clientInfo;
18
18
  config;
19
19
  constructor(options) {
20
20
  this.options = options;
21
21
  this.logger = options.logger ?? new NoOpLogger();
22
- this.userAgent = createDefault().with(PACKAGE_SEGMENT).with({
22
+ this.clientInfo = createDefault().with(PACKAGE_SEGMENT).with({
23
23
  key: "sdk-js-auth",
24
24
  value: VERSION
25
- }).with({
26
- key: "auth",
27
- value: options.credentials?.name() ?? "default"
28
- }).toString();
25
+ });
29
26
  }
30
27
  resolveConfig() {
31
- this.config ??= resolveClientConfig(this.options);
28
+ this.config ??= resolveClientConfig(this.options, this.clientInfo);
32
29
  return this.config;
33
30
  }
34
31
  /**
@@ -51,8 +48,7 @@ var GrantsClient = class {
51
48
  let resp;
52
49
  const call = async (callSignal) => {
53
50
  const headers = new Headers();
54
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
55
- headers.set("User-Agent", this.userAgent);
51
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
56
52
  resp = parseResponse(await executeHttpCall({
57
53
  request: buildHttpRequest("GET", fullUrl, headers, callSignal),
58
54
  httpClient,
@@ -83,8 +79,7 @@ var GrantsClient = class {
83
79
  let resp;
84
80
  const call = async (callSignal) => {
85
81
  const headers = new Headers();
86
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
87
- headers.set("User-Agent", this.userAgent);
82
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
88
83
  resp = parseResponse(await executeHttpCall({
89
84
  request: buildHttpRequest("GET", fullUrl, headers, callSignal),
90
85
  httpClient,
@@ -111,8 +106,7 @@ var GrantsClient = class {
111
106
  let resp;
112
107
  const call = async (callSignal) => {
113
108
  const headers = new Headers();
114
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
115
- headers.set("User-Agent", this.userAgent);
109
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
116
110
  resp = parseResponse(await executeHttpCall({
117
111
  request: buildHttpRequest("GET", fullUrl, headers, callSignal),
118
112
  httpClient,
@@ -148,8 +142,7 @@ var GrantsClient = class {
148
142
  let resp;
149
143
  const call = async (callSignal) => {
150
144
  const headers = new Headers();
151
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
152
- headers.set("User-Agent", this.userAgent);
145
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
153
146
  resp = parseResponse(await executeHttpCall({
154
147
  request: buildHttpRequest("GET", fullUrl, headers, callSignal),
155
148
  httpClient,
@@ -177,8 +170,7 @@ var GrantsClient = class {
177
170
  let resp;
178
171
  const call = async (callSignal) => {
179
172
  const headers = new Headers({ "Content-Type": "application/json" });
180
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
181
- headers.set("User-Agent", this.userAgent);
173
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
182
174
  resp = parseResponse(await executeHttpCall({
183
175
  request: buildHttpRequest("PATCH", url, headers, callSignal, body),
184
176
  httpClient,
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n EffectivePrivilegeAssignment,\n GetEffectivePermissionsRequest,\n GetEffectivePermissionsResponse,\n GetPermissionsRequest,\n GetPermissionsResponse,\n ListEffectivePrivilegeAssignmentsRequest,\n ListEffectivePrivilegeAssignmentsResponse,\n ListPrivilegeAssignmentsRequest,\n ListPrivilegeAssignmentsResponse,\n PrivilegeAssignment,\n UpdatePermissionsRequest,\n UpdatePermissionsResponse,\n} from './model';\nimport {\n marshalUpdatePermissionsRequestSchema,\n unmarshalGetEffectivePermissionsResponseSchema,\n unmarshalGetPermissionsResponseSchema,\n unmarshalListEffectivePrivilegeAssignmentsResponseSchema,\n unmarshalListPrivilegeAssignmentsResponseSchema,\n unmarshalUpdatePermissionsResponseSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class GrantsClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent header value. Composed once at construction from\n // createDefault() merged with this package's identity and the active\n // credential's name.\n private readonly userAgent: string;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n const info = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION})\n .with({key: 'auth', value: options.credentials?.name() ?? 'default'});\n this.userAgent = info.toString();\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options);\n return this.config;\n }\n\n /**\n * Gets the effective permissions for a securable. Includes inherited permissions from any parent securables.\n *\n * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.\n *\n * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async getEffectivePermissions(\n req: GetEffectivePermissionsRequest,\n options?: CallOptions\n ): Promise<GetEffectivePermissionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/effective-permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: GetEffectivePermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalGetEffectivePermissionsResponseSchema\n );\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Gets the permissions for a securable. Does not include inherited permissions.\n *\n * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.\n *\n * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async getPermissions(\n req: GetPermissionsRequest,\n options?: CallOptions\n ): Promise<GetPermissionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: GetPermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalGetPermissionsResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Lists the effective privilege assignments for a securable. Includes inherited privileges.\n * Paginated version of Get Effective Permissions API.\n */\n async listEffectivePrivilegeAssignments(\n req: ListEffectivePrivilegeAssignmentsRequest,\n options?: CallOptions\n ): Promise<ListEffectivePrivilegeAssignmentsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/effective-privilege-assignments/${req.securableType ?? ''}/${req.fullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListEffectivePrivilegeAssignmentsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalListEffectivePrivilegeAssignmentsResponseSchema\n );\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listEffectivePrivilegeAssignmentsIter(\n req: ListEffectivePrivilegeAssignmentsRequest,\n options?: CallOptions\n ): AsyncGenerator<EffectivePrivilegeAssignment> {\n const pageReq: ListEffectivePrivilegeAssignmentsRequest = {...req};\n for (;;) {\n const resp = await this.listEffectivePrivilegeAssignments(\n pageReq,\n options\n );\n for (const item of resp.effectivePrivilegeAssignments ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /**\n * Lists the privilege assignments for a securable. Does not include inherited privileges.\n * Paginated version of Get Permissions API.\n */\n async listPrivilegeAssignments(\n req: ListPrivilegeAssignmentsRequest,\n options?: CallOptions\n ): Promise<ListPrivilegeAssignmentsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/privilege-assignments/${req.securableType ?? ''}/${req.fullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListPrivilegeAssignmentsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalListPrivilegeAssignmentsResponseSchema\n );\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listPrivilegeAssignmentsIter(\n req: ListPrivilegeAssignmentsRequest,\n options?: CallOptions\n ): AsyncGenerator<PrivilegeAssignment> {\n const pageReq: ListPrivilegeAssignmentsRequest = {...req};\n for (;;) {\n const resp = await this.listPrivilegeAssignments(pageReq, options);\n for (const item of resp.privilegeAssignments ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /** Updates the permissions for a securable. */\n async updatePermissions(\n req: UpdatePermissionsRequest,\n options?: CallOptions\n ): Promise<UpdatePermissionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;\n const body = marshalRequest(req, marshalUpdatePermissionsRequestSchema);\n let resp: UpdatePermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalUpdatePermissionsResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n}\n"],"mappings":";;;;;;;;;AA0CA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,eAAb,MAA0B;CACxB,AAAiB;CACjB,AAAiB;CAIjB,AAAiB;CAIjB,AAAQ;CAER,YAAY,SAAwB;AAClC,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,IAAI,YAAY;AAKhD,OAAK,YAJQ,eAAe,CACzB,KAAK,gBAAgB,CACrB,KAAK;GAAC,KAAK;GAAe,OAAOC;GAAa,CAAC,CAC/C,KAAK;GAAC,KAAK;GAAQ,OAAO,QAAQ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MAAM,gBAAgB;IACrC,SAFc,iBAAiB,OAAO,SAAS,SAAS,WAAW;IAGnE;IACA,QAAQ,KAAK;IACd,CAAC,EAGA,gDACD;;AAEH,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;CAGT,OAAO,6BACL,KACA,SACqC;EACrC,MAAM,UAA2C,EAAC,GAAG,KAAI;AACzD,WAAS;GACP,MAAM,OAAO,MAAM,KAAK,yBAAyB,SAAS,QAAQ;AAClE,QAAK,MAAM,QAAQ,KAAK,wBAAwB,EAAE,CAChD,OAAM;AAER,OAAI,KAAK,kBAAkB,UAAa,KAAK,kBAAkB,GAC7D;AAEF,WAAQ,YAAY,KAAK;;;;CAK7B,MAAM,kBACJ,KACA,SACoC;EACpC,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK,qCAAqC,IAAI,iBAAiB,GAAG,GAAG,IAAI,qBAAqB;EAC7G,MAAM,OAAO,eAAe,KAAK,sCAAsC;EACvE,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,QAAQ,EAAC,gBAAgB,oBAAmB,CAAC;AACjE,OAAI,gBAAgB,OAClB,SAAQ,IAAI,6BAA6B,YAAY;AAEvD,WAAQ,IAAI,cAAc,KAAK,UAAU;AAOzC,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,SAAS,KAAK,SAAS,YAAY,KAAK;IAGvE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,yCAAyC;;AAE1E,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
1
+ {"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport type {ClientInfo} from '@databricks/sdk-core/clientinfo';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n EffectivePrivilegeAssignment,\n GetEffectivePermissionsRequest,\n GetEffectivePermissionsResponse,\n GetPermissionsRequest,\n GetPermissionsResponse,\n ListEffectivePrivilegeAssignmentsRequest,\n ListEffectivePrivilegeAssignmentsResponse,\n ListPrivilegeAssignmentsRequest,\n ListPrivilegeAssignmentsResponse,\n PrivilegeAssignment,\n UpdatePermissionsRequest,\n UpdatePermissionsResponse,\n} from './model';\nimport {\n marshalUpdatePermissionsRequestSchema,\n unmarshalGetEffectivePermissionsResponseSchema,\n unmarshalGetPermissionsResponseSchema,\n unmarshalListEffectivePrivilegeAssignmentsResponseSchema,\n unmarshalListPrivilegeAssignmentsResponseSchema,\n unmarshalUpdatePermissionsResponseSchema,\n} from './model';\n\n// Package identity segment for this client to be used in the User-Agent header.\nconst PACKAGE_SEGMENT = {\n key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\\/sdk-/, ''),\n value: pkgJson.version,\n};\n\nexport class GrantsClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent segments, composed once at construction from createDefault()\n // merged with this package's identity. Each request adds the auth method,\n // which default credentials choose only when they first sign a request.\n private readonly clientInfo: ClientInfo;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n this.clientInfo = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION});\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options, this.clientInfo);\n return this.config;\n }\n\n /**\n * Gets the effective permissions for a securable. Includes inherited permissions from any parent securables.\n *\n * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.\n *\n * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async getEffectivePermissions(\n req: GetEffectivePermissionsRequest,\n options?: CallOptions\n ): Promise<GetEffectivePermissionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/effective-permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: GetEffectivePermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalGetEffectivePermissionsResponseSchema\n );\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Gets the permissions for a securable. Does not include inherited permissions.\n *\n * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.\n *\n * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.\n * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.\n */\n async getPermissions(\n req: GetPermissionsRequest,\n options?: CallOptions\n ): Promise<GetPermissionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.maxResults !== undefined) {\n params.append('max_results', String(req.maxResults));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: GetPermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalGetPermissionsResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n /**\n * Lists the effective privilege assignments for a securable. Includes inherited privileges.\n * Paginated version of Get Effective Permissions API.\n */\n async listEffectivePrivilegeAssignments(\n req: ListEffectivePrivilegeAssignmentsRequest,\n options?: CallOptions\n ): Promise<ListEffectivePrivilegeAssignmentsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/effective-privilege-assignments/${req.securableType ?? ''}/${req.fullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListEffectivePrivilegeAssignmentsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalListEffectivePrivilegeAssignmentsResponseSchema\n );\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listEffectivePrivilegeAssignmentsIter(\n req: ListEffectivePrivilegeAssignmentsRequest,\n options?: CallOptions\n ): AsyncGenerator<EffectivePrivilegeAssignment> {\n const pageReq: ListEffectivePrivilegeAssignmentsRequest = {...req};\n for (;;) {\n const resp = await this.listEffectivePrivilegeAssignments(\n pageReq,\n options\n );\n for (const item of resp.effectivePrivilegeAssignments ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /**\n * Lists the privilege assignments for a securable. Does not include inherited privileges.\n * Paginated version of Get Permissions API.\n */\n async listPrivilegeAssignments(\n req: ListPrivilegeAssignmentsRequest,\n options?: CallOptions\n ): Promise<ListPrivilegeAssignmentsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/privilege-assignments/${req.securableType ?? ''}/${req.fullName ?? ''}`;\n const params = new URLSearchParams();\n if (req.principal !== undefined) {\n params.append('principal', req.principal);\n }\n if (req.pageSize !== undefined) {\n params.append('page_size', String(req.pageSize));\n }\n if (req.pageToken !== undefined) {\n params.append('page_token', req.pageToken);\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n let resp: ListPrivilegeAssignmentsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalListPrivilegeAssignmentsResponseSchema\n );\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n\n async *listPrivilegeAssignmentsIter(\n req: ListPrivilegeAssignmentsRequest,\n options?: CallOptions\n ): AsyncGenerator<PrivilegeAssignment> {\n const pageReq: ListPrivilegeAssignmentsRequest = {...req};\n for (;;) {\n const resp = await this.listPrivilegeAssignments(pageReq, options);\n for (const item of resp.privilegeAssignments ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /** Updates the permissions for a securable. */\n async updatePermissions(\n req: UpdatePermissionsRequest,\n options?: CallOptions\n ): Promise<UpdatePermissionsResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.1/unity-catalog/permissions/${req.securableType ?? ''}/${req.securableFullName ?? ''}`;\n const body = marshalRequest(req, marshalUpdatePermissionsRequestSchema);\n let resp: UpdatePermissionsResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined && workspaceId !== '') {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalUpdatePermissionsResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n}\n"],"mappings":";;;;;;;;;AA2CA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,eAAb,MAA0B;CACxB,AAAiB;CACjB,AAAiB;CAIjB,AAAiB;CAIjB,AAAQ;CAER,YAAY,SAAwB;AAClC,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,IAAI,YAAY;AAChD,OAAK,aAAa,eAAe,CAC9B,KAAK,gBAAgB,CACrB,KAAK;GAAC,KAAK;GAAe,OAAOC;GAAa,CAAC;;CAGpD,AAAQ,gBAA+C;AACrD,OAAK,WAAW,oBAAoB,KAAK,SAAS,KAAK,WAAW;AAClE,SAAO,KAAK;;;;;;;;;;CAWd,MAAM,wBACJ,KACA,SAC0C;EAC1C,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK,+CAA+C,IAAI,iBAAiB,GAAG,GAAG,IAAI,qBAAqB;EACvH,MAAM,SAAS,IAAI,iBAAiB;AACpC,MAAI,IAAI,cAAc,OACpB,QAAO,OAAO,aAAa,IAAI,UAAU;AAE3C,MAAI,IAAI,eAAe,OACrB,QAAO,OAAO,eAAe,OAAO,IAAI,WAAW,CAAC;AAEtD,MAAI,IAAI,cAAc,OACpB,QAAO,OAAO,cAAc,IAAI,UAAU;EAE5C,MAAM,QAAQ,OAAO,UAAU;EAC/B,MAAM,UAAU,UAAU,KAAK,GAAG,IAAI,GAAG,UAAU;EACnD,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,UAAU,IAAI,SAAS;AAC7B,OAAI,gBAAgB,UAAa,gBAAgB,GAC/C,SAAQ,IAAI,6BAA6B,YAAY;AAQvD,UAAO,cALU,MAAM,gBAAgB;IACrC,SAFc,iBAAiB,OAAO,SAAS,SAAS,W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,KAAK;IAGvE;IACA,QAAQ,KAAK;IACd,CAAC,EAC6B,yCAAyC;;AAE1E,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
@@ -55,9 +55,12 @@ interface GetEffectivePermissionsResponse {
55
55
  privilegeAssignments?: EffectivePrivilegeAssignment[] | undefined;
56
56
  }
57
57
  interface GetPermissionsRequest {
58
- /** Type of securable. */
58
+ /** Type of the securable, such as `catalog`, `schema`, `table` or `volume`. The value is case-insensitive. */
59
59
  securableType?: string | undefined;
60
- /** Full name of securable. */
60
+ /**
61
+ * Full name of the securable. Tables, views, volumes and functions use the three-level name
62
+ * `catalog.schema.object`; a metastore uses its metastore ID.
63
+ */
61
64
  securableFullName?: string | undefined;
62
65
  /** If provided, only the permissions for the specified principal (user or group) are returned. */
63
66
  principal?: string | undefined;
@@ -153,10 +156,7 @@ interface ListPrivilegeAssignmentsResponse {
153
156
  nextPageToken?: string | undefined;
154
157
  }
155
158
  interface PermissionsChange {
156
- /**
157
- * The principal whose privileges we are changing.
158
- * Only one of principal or principal_id should be specified, never both at the same time.
159
- */
159
+ /** The principal whose privileges we are changing. */
160
160
  principal?: string | undefined;
161
161
  /** The set of privileges to add. */
162
162
  add?: string[] | undefined;
@@ -164,20 +164,23 @@ interface PermissionsChange {
164
164
  remove?: string[] | undefined;
165
165
  }
166
166
  interface PrivilegeAssignment {
167
- /**
168
- * The principal (user email address or group name).
169
- * For deleted principals, `principal` is empty while `principal_id` is populated.
170
- */
167
+ /** The principal (user email address or group name). */
171
168
  principal?: string | undefined;
172
169
  /** The privileges assigned to the principal. */
173
170
  privileges?: string[] | undefined;
174
171
  }
175
172
  interface UpdatePermissionsRequest {
176
- /** Type of securable. */
173
+ /** Type of the securable, such as `catalog`, `schema`, `table` or `volume`. The value is case-insensitive. */
177
174
  securableType?: string | undefined;
178
- /** Full name of securable. */
175
+ /**
176
+ * Full name of the securable. Tables, views, volumes and functions use the three-level name
177
+ * `catalog.schema.object`; a metastore uses its metastore ID.
178
+ */
179
179
  securableFullName?: string | undefined;
180
- /** Optional, default false. Specifies whether all the permissions should be returned in the response. */
180
+ /**
181
+ * Whether to omit the privilege assignments from the response. When false, the response lists all direct privilege
182
+ * assignments on the securable after the update.
183
+ */
181
184
  omitPermissionsInResponse?: boolean | undefined;
182
185
  /** Array of permissions change objects. */
183
186
  changes?: PermissionsChange[] | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","names":[],"sources":["../../src/v1/model.ts"],"mappings":";;;UAIiB,kBAAA;;EAEf,SAAA;EAFiC;;;;EAOjC,iBAAA;EAKA;;;AAGF;EAHE,iBAAA;AAAA;AAAA,UAGe,4BAAA;EAEf;EAAA,SAAA;EAEa;EAAb,UAAA,GAAa,kBAAA;AAAA;AAAA,UAGE,8BAAA;EAA8B;EAE7C,aAAA;EAF6C;EAI7C,iBAAA;EAAA;EAEA,SAAA;EAcA;;;;AAKF;;;;;;;;;EALE,UAAA;EAeoC;EAbpC,SAAA;AAAA;AAAA,UAGe,+BAAA;EAcf;;;;EATA,aAAA;EA2BS;EAzBT,oBAAA,GAAuB,4BAAA;AAAA;AAAA,UAGR,qBAAA;EAgC2B;EA9B1C,aAAA;EA8BA;EA5BA,iBAAA;EA4B0C;EA1B1C,SAAA;EA6Be;;;;;;;;;;;AAyBjB;;EAxCE,UAAA;EA0C4D;EAxC5D,SAAA;AAAA;AAAA,UAGe,sBAAA;EA0CF;;AAGf;;EAxCE,aAAA;EAwC8C;EAtC9C,oBAAA,GAAuB,mBAAA;AAAA;AAAA,UAGR,wCAAA;EAuDf;EArDA,aAAA;EAuDS;EArDT,QAAA;EAwDe;EAtDf,SAAA;;;;;;;;AA+DF;;;;;;EAjDE,QAAA;EA0DM;EAxDN,SAAA;AAAA;AAAA,UAGe,yCAAA;;EAEf,6BAAA,GAAgC,4BAAA;EA6DtB;AAGZ;;;EA3DE,aAAA;AAAA;AAAA,UAGe,+BAAA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0E+D;EAxE9E,aAAA;EAwEuE;;;;EAnEvE,iBAAA;EA2FK;;;;EAtFL,yBAAA;EA2EsE;EAzEtE,OAAA,GAAU,iBAAA;AAAA;AAAA,UAGK,yBAAA;EA4FV;EA1FL,oBAAA,GAAuB,mBAAA;AAAA;AAAA,cAGZ,iCAAA,EAAmC,CAAA,CAAE,OAAA,CAAQ,kBAAA;AAAA,cAa7C,2CAAA,EAA6C,CAAA,CAAE,OAAA,CAAQ,4BAAA;AAAA,cAavD,8CAAA,EAAgD,CAAA,CAAE,OAAA,CAAQ,+BAAA;AAAA,cAa1D,qCAAA,EAAuC,CAAA,CAAE,OAAA,CAAQ,sBAAA;AAAA,cAajD,wDAAA,EAA0D,CAAA,CAAE,OAAA,CAAQ,yCAAA;AAAA,cAapE,+CAAA,EAAiD,CAAA,CAAE,OAAA,CAAQ,gCAAA;AAAA,cAa3D,kCAAA,EAAoC,CAAA,CAAE,OAAA,CAAQ,mBAAA;AAAA,cAW9C,wCAAA,EAA0C,CAAA,CAAE,OAAA,CAAQ,yBAAA;AAAA,cAWpD,8BAAA,EAAgC,CAAA,CAAE,OAAA;AAAA,cAYlC,qCAAA,EAAuC,CAAA,CAAE,OAAA"}
@@ -1 +1 @@
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,EAAE,WAAW,kCAAkC,CAAC,CACtD,UAAU;CACd,CAAC,CACD,WAAU,OAAM;CACf,WAAW,EAAE;CACb,YAAY,EAAE;CACf,EAAE;AAEP,MAAa,iDACX,EACG,OAAO;CACN,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,uBAAuB,EACpB,MAAM,EAAE,WAAW,4CAA4C,CAAC,CAChE,UAAU;CACd,CAAC,CACD,WAAU,OAAM;CACf,eAAe,EAAE;CACjB,sBAAsB,EAAE;CACzB,EAAE;AAEP,MAAa,wCACX,EACG,OAAO;CACN,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC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,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"}
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 the securable, such as `catalog`, `schema`, `table` or `volume`. The value is case-insensitive. */\n securableType?: string | undefined;\n /**\n * Full name of the securable. Tables, views, volumes and functions use the three-level name\n * `catalog.schema.object`; a metastore uses its metastore ID.\n */\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 /** The principal whose privileges we are changing. */\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 /** The principal (user email address or group name). */\n principal?: string | undefined;\n /** The privileges assigned to the principal. */\n privileges?: string[] | undefined;\n}\n\nexport interface UpdatePermissionsRequest {\n /** Type of the securable, such as `catalog`, `schema`, `table` or `volume`. The value is case-insensitive. */\n securableType?: string | undefined;\n /**\n * Full name of the securable. Tables, views, volumes and functions use the three-level name\n * `catalog.schema.object`; a metastore uses its metastore ID.\n */\n securableFullName?: string | undefined;\n /**\n * Whether to omit the privilege assignments from the response. When false, the response lists all direct privilege\n * assignments on the securable after the update.\n */\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":";;;AA8MA,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,EAAE,WAAW,kCAAkC,CAAC,CACtD,UAAU;CACd,CAAC,CACD,WAAU,OAAM;CACf,WAAW,EAAE;CACb,YAAY,EAAE;CACf,EAAE;AAEP,MAAa,iDACX,EACG,OAAO;CACN,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,uBAAuB,EACpB,MAAM,EAAE,WAAW,4CAA4C,CAAC,CAChE,UAAU;CACd,CAAC,CACD,WAAU,OAAM;CACf,eAAe,EAAE;CACjB,sBAAsB,EAAE;CACzB,EAAE;AAEP,MAAa,wCACX,EACG,OAAO;CACN,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,uBAAuB,EACpB,MAAM,EAAE,WAAW,mCAAmC,CAAC,CACvD,UAAU;CACd,CAAC,CACD,WAAU,OAAM;CACf,eAAe,EAAE;CACjB,sBAAsB,EAAE;CACzB,EAAE;AAEP,MAAa,2DACX,EACG,OAAO;CACN,iCAAiC,EAC9B,MAAM,EAAE,WAAW,4CAA4C,CAAC,CAChE,UAAU;CACb,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACvC,CAAC,CACD,WAAU,OAAM;CACf,+BAA+B,EAAE;CACjC,eAAe,E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info";
1
2
  import { HttpClient } from "@databricks/sdk-core/http";
2
3
  import { ClientOptions } from "@databricks/sdk-options/client";
3
4
 
@@ -27,11 +28,12 @@ interface ResolvedClientConfig {
27
28
  * A configuration profile is always resolved from the config file and
28
29
  * environment variables (per options.profileOptions); it supplies host,
29
30
  * accountId, workspaceId, and credentials wherever the caller did not set them
30
- * explicitly. Explicit options always take precedence.
31
+ * explicitly. Explicit options always take precedence. Each request's
32
+ * User-Agent is clientInfo with the auth method of the credentials.
31
33
  *
32
34
  * @throws if host is neither provided nor present in the resolved profile.
33
35
  */
34
- declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
36
+ declare function resolveClientConfig(options: ClientOptions, clientInfo: ClientInfo): Promise<ResolvedClientConfig>;
35
37
  //#endregion
36
38
  export { ResolvedClientConfig, resolveClientConfig };
37
39
  //# sourceMappingURL=transport.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"transport.d.ts","names":[],"sources":["../../src/v1/transport.ts"],"mappings":";;;;;;;AAmBA;;UAAiB,oBAAA;EAgBO;EAdtB,IAAA;EAMA;;;;EAAA,SAAA;EAQsB;AAcxB;;EAjBE,WAAA;EAkBS;EAfT,UAAA,EAAY,UAAA;AAAA;;;;;;;;;;;;iBAcQ,mBAAA,CACpB,OAAA,EAAS,aAAA,EACT,UAAA,EAAY,UAAA,GACX,OAAA,CAAQ,oBAAA"}
@@ -9,18 +9,19 @@ import { resolve } from "@databricks/sdk-core/profiles";
9
9
  * A configuration profile is always resolved from the config file and
10
10
  * environment variables (per options.profileOptions); it supplies host,
11
11
  * accountId, workspaceId, and credentials wherever the caller did not set them
12
- * explicitly. Explicit options always take precedence.
12
+ * explicitly. Explicit options always take precedence. Each request's
13
+ * User-Agent is clientInfo with the auth method of the credentials.
13
14
  *
14
15
  * @throws if host is neither provided nor present in the resolved profile.
15
16
  */
16
- async function resolveClientConfig(options) {
17
+ async function resolveClientConfig(options, clientInfo) {
17
18
  const profile = await resolve(options.profileOptions);
18
19
  const host = normalizeHost(options.host ?? profile.host);
19
20
  if (host === void 0) throw new Error("Host is required.");
20
21
  let httpClient = new AuthHttpClient(options.httpClient ?? newFetchHttpClient(), options.credentials ?? defaultCredentials({ profile: {
21
22
  ...profile,
22
23
  host
23
- } }));
24
+ } }), clientInfo);
24
25
  if (options.timeout !== void 0) httpClient = new TimeoutHttpClient(httpClient, options.timeout);
25
26
  const accountId = options.accountId ?? profile.accountId;
26
27
  const workspaceId = options.workspaceId ?? profile.workspaceId;
@@ -36,16 +37,25 @@ function normalizeHost(host) {
36
37
  if (trimmed === void 0 || trimmed === "") return;
37
38
  return (/^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`).replace(/\/$/, "");
38
39
  }
39
- /** Wraps an HttpClient and adds authentication headers to requests. */
40
+ /**
41
+ * Wraps an HttpClient and adds authentication headers and the User-Agent to
42
+ * requests.
43
+ */
40
44
  var AuthHttpClient = class {
41
- constructor(base, credentials) {
45
+ constructor(base, credentials, clientInfo) {
42
46
  this.base = base;
43
47
  this.credentials = credentials;
48
+ this.clientInfo = clientInfo;
44
49
  }
45
50
  async send(request) {
46
51
  const authHeaders = await this.credentials.authHeaders();
47
52
  const headers = new Headers(request.headers);
48
53
  for (const h of authHeaders) headers.set(h.key, h.value);
54
+ const info = this.clientInfo.with({
55
+ key: "auth",
56
+ value: this.credentials.name()
57
+ });
58
+ headers.set("User-Agent", info.toString());
49
59
  return this.base.send({
50
60
  ...request,
51
61
  headers
@@ -1 +1 @@
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 = normalizeHost(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 =\n options.credentials ?? defaultCredentials({profile: {...profile, host}});\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,\n httpClient,\n ...(accountId !== undefined && {accountId}),\n ...(workspaceId !== undefined && {workspaceId}),\n };\n}\n\nfunction normalizeHost(host: string | undefined): string | undefined {\n const trimmed = host?.trim();\n if (trimmed === undefined || trimmed === '') {\n return undefined;\n }\n const absolute = /^https?:\\/\\//i.test(trimmed)\n ? trimmed\n : `https://${trimmed}`;\n return absolute.replace(/\\/$/, '');\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,cAAc,QAAQ,QAAQ,QAAQ,KAAK;AACxD,KAAI,SAAS,OACX,OAAM,IAAI,MAAM,oBAAoB;CAUtC,IAAI,aAAyB,IAAI,eAHpB,QAAQ,cAAc,oBAAoB,EAErD,QAAQ,eAAe,mBAAmB,EAAC,SAAS;EAAC,GAAG;EAAS;EAAK,EAAC,CAAC,CACR;AAClE,KAAI,QAAQ,YAAY,OACtB,cAAa,IAAI,kBAAkB,YAAY,QAAQ,QAAQ;CAGjE,MAAM,YAAY,QAAQ,aAAa,QAAQ;CAC/C,MAAM,cAAc,QAAQ,eAAe,QAAQ;AAEnD,QAAO;EACL;EACA;EACA,GAAI,cAAc,UAAa,EAAC,WAAU;EAC1C,GAAI,gBAAgB,UAAa,EAAC,aAAY;EAC/C;;AAGH,SAAS,cAAc,MAA8C;CACnE,MAAM,UAAU,MAAM,MAAM;AAC5B,KAAI,YAAY,UAAa,YAAY,GACvC;AAKF,SAHiB,gBAAgB,KAAK,QAAQ,GAC1C,UACA,WAAW,WACC,QAAQ,OAAO,GAAG;;;AAIpC,IAAM,iBAAN,MAA2C;CACzC,YACE,AAAiB,MACjB,AAAiB,aACjB;EAFiB;EACA;;CAGnB,MAAM,KAAK,SAA6C;EACtD,MAAM,cAAc,MAAM,KAAK,YAAY,aAAa;EAExD,MAAM,UAAU,IAAI,QAAQ,QAAQ,QAAQ;AAC5C,OAAK,MAAM,KAAK,YACd,SAAQ,IAAI,EAAE,KAAK,EAAE,MAAM;AAE7B,SAAO,KAAK,KAAK,KAAK;GAAC,GAAG;GAAS;GAAQ,CAAC;;;;AAKhD,IAAM,oBAAN,MAA8C;CAC5C,YACE,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;;CAGnB,MAAM,KAAK,SAA6C;EACtD,MAAM,gBAAgB,YAAY,QAAQ,KAAK,QAAQ;EACvD,MAAM,SACJ,QAAQ,WAAW,SACf,YAAY,IAAI,CAAC,QAAQ,QAAQ,cAAc,CAAC,GAChD;AACN,SAAO,KAAK,KAAK,KAAK;GAAC,GAAG;GAAS;GAAO,CAAC"}
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 {ClientInfo} from '@databricks/sdk-core/clientinfo';\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. Each request's\n * User-Agent is clientInfo with the auth method of the credentials.\n *\n * @throws if host is neither provided nor present in the resolved profile.\n */\nexport async function resolveClientConfig(\n options: ClientOptions,\n clientInfo: ClientInfo\n): Promise<ResolvedClientConfig> {\n const profile: Profile = await resolve(options.profileOptions);\n\n const host = normalizeHost(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 =\n options.credentials ?? defaultCredentials({profile: {...profile, host}});\n let httpClient: HttpClient = new AuthHttpClient(\n base,\n credentials,\n clientInfo\n );\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,\n httpClient,\n ...(accountId !== undefined && {accountId}),\n ...(workspaceId !== undefined && {workspaceId}),\n };\n}\n\nfunction normalizeHost(host: string | undefined): string | undefined {\n const trimmed = host?.trim();\n if (trimmed === undefined || trimmed === '') {\n return undefined;\n }\n const absolute = /^https?:\\/\\//i.test(trimmed)\n ? trimmed\n : `https://${trimmed}`;\n return absolute.replace(/\\/$/, '');\n}\n\n/**\n * Wraps an HttpClient and adds authentication headers and the User-Agent to\n * requests.\n */\nclass AuthHttpClient implements HttpClient {\n constructor(\n private readonly base: HttpClient,\n private readonly credentials: Credentials,\n private readonly clientInfo: ClientInfo\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 // Default credentials choose their auth method when they first sign a\n // request, so the method is read after signing.\n const info = this.clientInfo.with({\n key: 'auth',\n value: this.credentials.name(),\n });\n headers.set('User-Agent', info.toString());\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":";;;;;;;;;;;;;;;;AAiDA,eAAsB,oBACpB,SACA,YAC+B;CAC/B,MAAM,UAAmB,MAAM,QAAQ,QAAQ,eAAe;CAE9D,MAAM,OAAO,cAAc,QAAQ,QAAQ,QAAQ,KAAK;AACxD,KAAI,SAAS,OACX,OAAM,IAAI,MAAM,oBAAoB;CAUtC,IAAI,aAAyB,IAAI,eAHpB,QAAQ,cAAc,oBAAoB,EAErD,QAAQ,eAAe,mBAAmB,EAAC,SAA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C,GAAG;GAAS;GAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databricks/sdk-uc-grants",
3
- "version": "0.52.0",
3
+ "version": "0.52.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@databricks/sdk-auth": ">=0.56.0 <1.0.0",
37
37
  "@databricks/sdk-core": ">=0.52.0 <1.0.0",
38
- "@databricks/sdk-options": ">=0.52.0 <1.0.0",
38
+ "@databricks/sdk-options": ">=0.52.1 <1.0.0",
39
39
  "@js-temporal/polyfill": "^0.5.0",
40
40
  "json-bigint": "^1.0.0",
41
41
  "zod": "^4.3.6"