@databricks/sdk-uc-grants 0.52.1 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,20 @@
1
1
  import { defaultCredentials } from "@databricks/sdk-auth/credentials";
2
2
  import { newFetchHttpClient } from "@databricks/sdk-core/http";
3
3
  import { resolve } from "@databricks/sdk-core/profiles";
4
+ import { ClientOptionsError } from "@databricks/sdk-options/client";
4
5
 
5
6
  //#region src/v1/transport.ts
6
7
  /**
8
+ * Throws a {@link ClientOptionsError} if host, accountId, or workspaceId is
9
+ * empty. No host, account, or workspace is empty, so the value is a mistake,
10
+ * while an unset option is resolved from the profile.
11
+ */
12
+ function checkClientOptions(options) {
13
+ if (options.host === "") throw new ClientOptionsError("EMPTY_HOST", "empty host");
14
+ if (options.accountId === "") throw new ClientOptionsError("EMPTY_ACCOUNT_ID", "empty accountId");
15
+ if (options.workspaceId === "") throw new ClientOptionsError("EMPTY_WORKSPACE_ID", "empty workspaceId");
16
+ }
17
+ /**
7
18
  * Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
8
19
  *
9
20
  * A configuration profile is always resolved from the config file and
@@ -18,18 +29,18 @@ async function resolveClientConfig(options, clientInfo) {
18
29
  const profile = await resolve(options.profileOptions);
19
30
  const host = normalizeHost(options.host ?? profile.host);
20
31
  if (host === void 0) throw new Error("Host is required.");
21
- let httpClient = new AuthHttpClient(options.httpClient ?? newFetchHttpClient(), options.credentials ?? defaultCredentials({ profile: {
32
+ const httpClient = new AuthHttpClient(options.httpClient ?? newFetchHttpClient(), options.credentials ?? defaultCredentials({ profile: {
22
33
  ...profile,
23
34
  host
24
35
  } }), clientInfo);
25
- if (options.timeout !== void 0) httpClient = new TimeoutHttpClient(httpClient, options.timeout);
26
36
  const accountId = options.accountId ?? profile.accountId;
27
37
  const workspaceId = options.workspaceId ?? profile.workspaceId;
28
38
  return {
29
39
  host,
30
40
  httpClient,
31
41
  ...accountId !== void 0 && { accountId },
32
- ...workspaceId !== void 0 && { workspaceId }
42
+ ...workspaceId !== void 0 && { workspaceId },
43
+ ...options.timeout !== void 0 && { timeout: options.timeout }
33
44
  };
34
45
  }
35
46
  function normalizeHost(host) {
@@ -48,7 +59,7 @@ var AuthHttpClient = class {
48
59
  this.clientInfo = clientInfo;
49
60
  }
50
61
  async send(request) {
51
- const authHeaders = await this.credentials.authHeaders();
62
+ const authHeaders = await untilAborted(() => this.credentials.authHeaders(), request.signal);
52
63
  const headers = new Headers(request.headers);
53
64
  for (const h of authHeaders) headers.set(h.key, h.value);
54
65
  const info = this.clientInfo.with({
@@ -56,28 +67,34 @@ var AuthHttpClient = class {
56
67
  value: this.credentials.name()
57
68
  });
58
69
  headers.set("User-Agent", info.toString());
70
+ request.signal?.throwIfAborted();
59
71
  return this.base.send({
60
72
  ...request,
61
73
  headers
62
74
  });
63
75
  }
64
76
  };
65
- /** Wraps an HttpClient and applies a default timeout to requests. */
66
- var TimeoutHttpClient = class {
67
- constructor(base, timeout) {
68
- this.base = base;
69
- this.timeout = timeout;
70
- }
71
- async send(request) {
72
- const timeoutSignal = AbortSignal.timeout(this.timeout);
73
- const signal = request.signal !== void 0 ? AbortSignal.any([request.signal, timeoutSignal]) : timeoutSignal;
74
- return this.base.send({
75
- ...request,
76
- signal
77
- });
77
+ /**
78
+ * Runs wait, and rejects with the reason of signal once it aborts. Credentials
79
+ * take no signal, and getting them counts against the call's deadline.
80
+ */
81
+ async function untilAborted(wait, signal) {
82
+ if (signal === void 0) return wait();
83
+ signal.throwIfAborted();
84
+ let onAbort = () => void 0;
85
+ const aborted = new Promise((_, reject) => {
86
+ onAbort = () => {
87
+ reject(signal.reason instanceof Error ? signal.reason : new Error(String(signal.reason)));
88
+ };
89
+ });
90
+ signal.addEventListener("abort", onAbort, { once: true });
91
+ try {
92
+ return await Promise.race([wait(), aborted]);
93
+ } finally {
94
+ signal.removeEventListener("abort", onAbort);
78
95
  }
79
- };
96
+ }
80
97
 
81
98
  //#endregion
82
- export { resolveClientConfig };
99
+ export { checkClientOptions, resolveClientConfig };
83
100
  //# sourceMappingURL=transport.js.map
@@ -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 {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 }\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;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';\nimport {ClientOptionsError} 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, and an empty one throws.\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 applied. */\n httpClient: HttpClient;\n\n /**\n * Timeout, in milliseconds, that the client sets. A call that sets no\n * timeout of its own takes it as its deadline.\n */\n timeout?: number;\n}\n\n/**\n * Throws a {@link ClientOptionsError} if host, accountId, or workspaceId is\n * empty. No host, account, or workspace is empty, so the value is a mistake,\n * while an unset option is resolved from the profile.\n */\nexport function checkClientOptions(options: ClientOptions): void {\n if (options.host === '') {\n throw new ClientOptionsError('EMPTY_HOST', 'empty host');\n }\n if (options.accountId === '') {\n throw new ClientOptionsError('EMPTY_ACCOUNT_ID', 'empty accountId');\n }\n if (options.workspaceId === '') {\n throw new ClientOptionsError('EMPTY_WORKSPACE_ID', 'empty workspaceId');\n }\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 is layered on top of it. The default credential chain\n // reuses the profile resolved above so that the same profileOptions govern\n // host and authentication alike.\n const base = options.httpClient ?? newFetchHttpClient();\n const credentials =\n options.credentials ?? defaultCredentials({profile: {...profile, host}});\n const httpClient: HttpClient = new AuthHttpClient(\n base,\n credentials,\n clientInfo\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 ...(options.timeout !== undefined && {timeout: options.timeout}),\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 untilAborted(\n () => this.credentials.authHeaders(),\n request.signal\n );\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 // The signal can abort after the credentials arrive, and no request goes\n // out after the call's deadline.\n request.signal?.throwIfAborted();\n return this.base.send({...request, headers});\n }\n}\n\n/**\n * Runs wait, and rejects with the reason of signal once it aborts. Credentials\n * take no signal, and getting them counts against the call's deadline.\n */\nasync function untilAborted<T>(\n wait: () => Promise<T>,\n signal: AbortSignal | undefined\n): Promise<T> {\n if (signal === undefined) {\n return wait();\n }\n signal.throwIfAborted();\n let onAbort = (): void => undefined;\n const aborted = new Promise<never>((_, reject) => {\n onAbort = (): void => {\n reject(\n signal.reason instanceof Error\n ? signal.reason\n : new Error(String(signal.reason))\n );\n };\n });\n signal.addEventListener('abort', onAbort, {once: true});\n try {\n return await Promise.race([wait(), aborted]);\n } finally {\n signal.removeEventListener('abort', onAbort);\n }\n}\n"],"mappings":";;;;;;;;;;;AAkDA,SAAgB,mBAAmB,SAA8B;AAC/D,KAAI,QAAQ,SAAS,GACnB,OAAM,IAAI,mBAAmB,cAAc,aAAa;AAE1D,KAAI,QAAQ,cAAc,GACxB,OAAM,IAAI,mBAAmB,oBAAoB,kBAAkB;AAErE,KAAI,QAAQ,gBAAgB,GAC1B,OAAM,IAAI,mBAAmB,sBAAsB,oBAAoB;;;;;;;;;;;;;AAe3E,eAAsB,oBACpB,SACA,YAC+B;CAC/B,MAAM,UAAmB,MAAM,QAAQ,QAAQ,eAAe;CAE9D,MAAM,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,QAAO,MAAM;AAEf,QAAO,gBAAgB;CACvB,IAAI,gBAAsB;CAC1B,MAAM,UAAU,IAAI,SAAgB,GAAG,WAAW;AAChD,kBAAsB;AACpB,UACE,OAAO,kBAAkB,QACrB,OAAO,SACP,IAAI,MAAM,OAAO,OAAO,OAAO,CAAC,CACrC;;GAEH;AACF,QAAO,iBAAiB,SAAS,SAAS,EAAC,MAAM,MAAK,CAAC;AACvD,KAAI;AACF,SAAO,MAAM,QAAQ,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC;WACpC;AACR,SAAO,oBAAoB,SAAS,QAAQ"}
@@ -10,16 +10,22 @@ interface HttpCallOptions {
10
10
  readonly logger: Logger;
11
11
  }
12
12
  /**
13
- * Translates public CallOptions to the internal Options shape accepted by
14
- * execute(). Even though the shapes match today, this isolates the public
15
- * API from the executor's internal type so they can diverge.
13
+ * Runs a call with the public CallOptions. The call has one deadline, which
14
+ * bounds all its attempts and the waits between them: the call's timeout,
15
+ * else the client's, else the default. A timeout of 0 turns it off.
16
16
  */
17
- declare function executeCall(call: (signal?: AbortSignal) => Promise<void>, options?: CallOptions): Promise<void>;
17
+ declare function executeCall(call: (signal?: AbortSignal) => Promise<void>, options: CallOptions | undefined, clientTimeout: number | undefined): Promise<void>;
18
18
  declare function executeHttpCall(opts: HttpCallOptions): Promise<Uint8Array>;
19
19
  declare function buildHttpRequest(method: string, url: string, headers: Headers, signal?: AbortSignal, body?: string | ReadableStream<Uint8Array>): HttpRequest;
20
20
  declare function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T;
21
21
  declare function marshalRequest(data: unknown, schema: z.ZodType): string;
22
22
  declare function flattenQueryParams(prefix: string, value: unknown, params: URLSearchParams): void;
23
+ /**
24
+ * Encodes a single-segment path variable for use in a URL. "/" stays a path
25
+ * separator, unreserved characters and !$&'()*+,;=:@ stay unchanged, and every
26
+ * other character is percent-encoded as UTF-8 with upper-case hex digits.
27
+ */
28
+ declare function encodePathVariable(value: string | number): string;
23
29
  //#endregion
24
- export { HttpCallOptions, buildHttpRequest, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
30
+ export { HttpCallOptions, buildHttpRequest, encodePathVariable, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
25
31
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/v1/utils.ts"],"mappings":";;;;;;UAyDiB,eAAA;EAAA,SACN,OAAA,EAAS,WAAA;EAAA,SACT,UAAA,EAAY,UAAA;EAAA,SACZ,MAAA,EAAQ,MAAA;AAAA;;;;;;iBAYG,WAAA,CACpB,IAAA,GAAO,MAAA,GAAS,WAAA,KAAgB,OAAA,QAChC,OAAA,EAAS,WAAA,cACT,aAAA,uBACC,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;;;AAtGV;;;iBAqIgB,kBAAA,CAAmB,KAAA"}
package/dist/v1/utils.js CHANGED
@@ -4,16 +4,34 @@ import JSONBig from "json-bigint";
4
4
 
5
5
  //#region src/v1/utils.ts
6
6
  const jsonBigint = JSONBig({ useNativeBigInt: true });
7
+ const jsonNumberText = JSONBig({ storeAsString: true });
8
+ function parseJson(text) {
9
+ const value = JSON.parse(text);
10
+ return /\d{16}/.test(text) ? withExactIntegers(value, jsonNumberText.parse(text)) : value;
11
+ }
12
+ function withExactIntegers(value, numberText) {
13
+ if (typeof value === "number") return !Number.isSafeInteger(value) && typeof numberText === "string" && /^-?\d+$/.test(numberText) ? BigInt(numberText) : value;
14
+ if (Array.isArray(value)) {
15
+ const items = numberText;
16
+ return value.map((item, i) => withExactIntegers(item, items[i]));
17
+ }
18
+ if (typeof value === "object" && value !== null) {
19
+ const fields = numberText;
20
+ return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, withExactIntegers(item, fields[key])]));
21
+ }
22
+ return value;
23
+ }
24
+ const DEFAULT_CALL_TIMEOUT_MS = 300 * 1e3;
7
25
  /**
8
- * Translates public CallOptions to the internal Options shape accepted by
9
- * execute(). Even though the shapes match today, this isolates the public
10
- * API from the executor's internal type so they can diverge.
26
+ * Runs a call with the public CallOptions. The call has one deadline, which
27
+ * bounds all its attempts and the waits between them: the call's timeout,
28
+ * else the client's, else the default. A timeout of 0 turns it off.
11
29
  */
12
- async function executeCall(call, options) {
30
+ async function executeCall(call, options, clientTimeout) {
13
31
  const opts = {
14
32
  ...options?.retrier !== void 0 && { retrier: options.retrier },
15
33
  ...options?.rateLimiter !== void 0 && { rateLimiter: options.rateLimiter },
16
- ...options?.timeout !== void 0 && { timeout: options.timeout }
34
+ timeout: options?.timeout ?? clientTimeout ?? DEFAULT_CALL_TIMEOUT_MS
17
35
  };
18
36
  return execute(options?.signal, call, opts);
19
37
  }
@@ -68,7 +86,7 @@ function buildHttpRequest(method, url, headers, signal, body) {
68
86
  }
69
87
  function parseResponse(body, schema) {
70
88
  const text = new TextDecoder().decode(body);
71
- const parsed = text === "" ? {} : jsonBigint.parse(text);
89
+ const parsed = text === "" ? {} : parseJson(text);
72
90
  return schema.parse(parsed);
73
91
  }
74
92
  function marshalRequest(data, schema) {
@@ -81,7 +99,15 @@ function flattenQueryParams(prefix, value, params) {
81
99
  else if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") params.append(prefix, String(value));
82
100
  else throw new Error(`Unsupported query parameter type: ${typeof value}`);
83
101
  }
102
+ /**
103
+ * Encodes a single-segment path variable for use in a URL. "/" stays a path
104
+ * separator, unreserved characters and !$&'()*+,;=:@ stay unchanged, and every
105
+ * other character is percent-encoded as UTF-8 with upper-case hex digits.
106
+ */
107
+ function encodePathVariable(value) {
108
+ return String(value).toWellFormed().split("/").map((segment) => encodeURIComponent(segment).replace(/%(?:24|26|2B|2C|3A|3B|3D|40)/g, (encoded) => decodeURIComponent(encoded))).join("/");
109
+ }
84
110
 
85
111
  //#endregion
86
- export { buildHttpRequest, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
112
+ export { buildHttpRequest, encodePathVariable, executeCall, executeHttpCall, flattenQueryParams, marshalRequest, parseResponse };
87
113
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":[],"sources":["../../src/v1/utils.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {Options} from '@databricks/sdk-core/ops';\nimport {execute} from '@databricks/sdk-core/ops';\nimport {ApiError} from '@databricks/sdk-core/apierror';\nimport type {\n HttpClient,\n HttpRequest,\n HttpResponse,\n} from '@databricks/sdk-core/http';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport JSONBig from 'json-bigint';\nimport type {z} from 'zod';\n\n// JSON codec that preserves int64 precision. On the way in, large integer\n// literals come back as bigint instead of being rounded to JS Number. On the\n// way out, bigint values are emitted as raw JSON number digits.\nconst jsonBigint = JSONBig({useNativeBigInt: true});\n\nexport interface HttpCallOptions {\n readonly request: HttpRequest;\n readonly httpClient: HttpClient;\n readonly logger: Logger;\n}\n\n/**\n * Translates public CallOptions to the internal Options shape accepted by\n * execute(). Even though the shapes match today, this isolates the public\n * API from the executor's internal type so they can diverge.\n */\nexport async function executeCall(\n call: (signal?: AbortSignal) => Promise<void>,\n options?: CallOptions\n): Promise<void> {\n const opts: Options = {\n ...(options?.retrier !== undefined && {retrier: options.retrier}),\n ...(options?.rateLimiter !== undefined && {\n rateLimiter: options.rateLimiter,\n }),\n ...(options?.timeout !== undefined && {timeout: options.timeout}),\n };\n return execute(options?.signal, call, opts);\n}\n\nasync function readAll(\n body: ReadableStream<Uint8Array> | null\n): Promise<Uint8Array> {\n if (body === null) {\n return new Uint8Array(0);\n }\n const reader = body.getReader();\n const chunks: Uint8Array[] = [];\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n chunks.push(value);\n }\n const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n}\n\nexport async function executeHttpCall(\n opts: HttpCallOptions\n): Promise<Uint8Array> {\n opts.logger.debug('HTTP request', {\n method: opts.request.method,\n url: opts.request.url,\n });\n\n let resp: HttpResponse;\n try {\n resp = await opts.httpClient.send(opts.request);\n } catch (e: unknown) {\n opts.logger.debug('HTTP request failed');\n throw e;\n }\n\n const body = await readAll(resp.body);\n\n opts.logger.debug('HTTP response', {\n statusCode: resp.statusCode,\n body: new TextDecoder().decode(body),\n });\n\n const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);\n if (apiErr !== undefined) {\n throw apiErr;\n }\n\n return body;\n}\n\nexport function buildHttpRequest(\n method: string,\n url: string,\n headers: Headers,\n signal?: AbortSignal,\n body?: string | ReadableStream<Uint8Array>\n): HttpRequest {\n const req: HttpRequest = {url, method, headers};\n if (body !== undefined) {\n req.body = body;\n }\n if (signal !== undefined) {\n req.signal = signal;\n }\n return req;\n}\n\nexport function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {\n const text = new TextDecoder().decode(body);\n // 204 responses return an empty body; treat as `{}`.\n const parsed: unknown = text === '' ? {} : jsonBigint.parse(text);\n return schema.parse(parsed);\n}\n\nexport function marshalRequest(data: unknown, schema: z.ZodType): string {\n return jsonBigint.stringify(schema.parse(data));\n}\n\nexport function flattenQueryParams(\n prefix: string,\n value: unknown,\n params: URLSearchParams\n): void {\n if (value === null || value === undefined) {\n return;\n }\n if (Array.isArray(value)) {\n // arrays of objects are not yet supported\n for (const item of value) {\n params.append(prefix, String(item));\n }\n } else if (typeof value === 'object') {\n for (const [key, val] of Object.entries(value as Record<string, unknown>)) {\n flattenQueryParams(`${prefix}.${key}`, val, params);\n }\n } else if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'bigint'\n ) {\n params.append(prefix, String(value));\n } else {\n throw new Error(`Unsupported query parameter type: ${typeof value}`);\n }\n}\n"],"mappings":";;;;;AAkBA,MAAM,aAAa,QAAQ,EAAC,iBAAiB,MAAK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;;AAGT,SAAgB,iBACd,QACA,KACA,SACA,QACA,MACa;CACb,MAAM,MAAmB;EAAC;EAAK;EAAQ;EAAQ;AAC/C,KAAI,SAAS,OACX,KAAI,OAAO;AAEb,KAAI,WAAW,OACb,KAAI,SAAS;AAEf,QAAO;;AAGT,SAAgB,cAAiB,MAAkB,QAAyB;CAC1E,MAAM,OAAO,IAAI,aAAa,CAAC,OAAO,KAAK;CAE3C,MAAM,SAAkB,SAAS,KAAK,EAAE,GAAG,WAAW,MAAM,KAAK;AACjE,QAAO,OAAO,MAAM,OAAO;;AAG7B,SAAgB,eAAe,MAAe,QAA2B;AACvE,QAAO,WAAW,UAAU,OAAO,MAAM,KAAK,CAAC;;AAGjD,SAAgB,mBACd,QACA,OACA,QACM;AACN,KAAI,UAAU,QAAQ,UAAU,OAC9B;AAEF,KAAI,MAAM,QAAQ,MAAM,CAEtB,MAAK,MAAM,QAAQ,MACjB,QAAO,OAAO,QAAQ,OAAO,KAAK,CAAC;UAE5B,OAAO,UAAU,SAC1B,MAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,MAAiC,CACvE,oBAAmB,GAAG,OAAO,GAAG,OAAO,KAAK,OAAO;UAGrD,OAAO,UAAU,YACjB,OAAO,UAAU,YACjB,OAAO,UAAU,aACjB,OAAO,UAAU,SAEjB,QAAO,OAAO,QAAQ,OAAO,MAAM,CAAC;KAEpC,OAAM,IAAI,MAAM,qCAAqC,OAAO,QAAQ"}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../src/v1/utils.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {Options} from '@databricks/sdk-core/ops';\nimport {execute} from '@databricks/sdk-core/ops';\nimport {ApiError} from '@databricks/sdk-core/apierror';\nimport type {\n HttpClient,\n HttpRequest,\n HttpResponse,\n} from '@databricks/sdk-core/http';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport JSONBig from 'json-bigint';\nimport type {z} from 'zod';\n\n// JSON codec that writes a bigint as the digits of a JSON number.\nconst jsonBigint = JSONBig({useNativeBigInt: true});\n\n// JSON codec that reads a number of more than 15 characters as its text.\nconst jsonNumberText = JSONBig({storeAsString: true});\n\n// Reads JSON as JSON.parse does, except that it reads an integer that a double cannot hold\n// exactly as the bigint of its digits, which an int64 field reads exactly. Only text with\n// 16 digits in a row can hold such an integer.\nfunction parseJson(text: string): unknown {\n const value: unknown = JSON.parse(text);\n return /\\d{16}/.test(text)\n ? withExactIntegers(value, jsonNumberText.parse(text) as unknown)\n : value;\n}\n\n// Replaces each integer in value that a double cannot hold exactly by the bigint of its\n// digits in numberText, the same JSON as jsonNumberText reads it.\nfunction withExactIntegers(value: unknown, numberText: unknown): unknown {\n if (typeof value === 'number') {\n return !Number.isSafeInteger(value) &&\n typeof numberText === 'string' &&\n /^-?\\d+$/.test(numberText)\n ? BigInt(numberText)\n : value;\n }\n if (Array.isArray(value)) {\n const items = numberText as unknown[];\n return value.map((item: unknown, i) => withExactIntegers(item, items[i]));\n }\n if (typeof value === 'object' && value !== null) {\n const fields = numberText as Record<string, unknown>;\n return Object.fromEntries(\n Object.entries(value).map(([key, item]: [string, unknown]) => [\n key,\n withExactIntegers(item, fields[key]),\n ])\n );\n }\n return value;\n}\n\nexport interface HttpCallOptions {\n readonly request: HttpRequest;\n readonly httpClient: HttpClient;\n readonly logger: Logger;\n}\n\n// The timeout, in milliseconds, of a call that neither the call nor its\n// client sets.\nconst DEFAULT_CALL_TIMEOUT_MS = 5 * 60 * 1000;\n\n/**\n * Runs a call with the public CallOptions. The call has one deadline, which\n * bounds all its attempts and the waits between them: the call's timeout,\n * else the client's, else the default. A timeout of 0 turns it off.\n */\nexport async function executeCall(\n call: (signal?: AbortSignal) => Promise<void>,\n options: CallOptions | undefined,\n clientTimeout: number | undefined\n): Promise<void> {\n const opts: Options = {\n ...(options?.retrier !== undefined && {retrier: options.retrier}),\n ...(options?.rateLimiter !== undefined && {\n rateLimiter: options.rateLimiter,\n }),\n timeout: options?.timeout ?? clientTimeout ?? DEFAULT_CALL_TIMEOUT_MS,\n };\n return execute(options?.signal, call, opts);\n}\n\nasync function readAll(\n body: ReadableStream<Uint8Array> | null\n): Promise<Uint8Array> {\n if (body === null) {\n return new Uint8Array(0);\n }\n const reader = body.getReader();\n const chunks: Uint8Array[] = [];\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n chunks.push(value);\n }\n const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n}\n\nexport async function executeHttpCall(\n opts: HttpCallOptions\n): Promise<Uint8Array> {\n opts.logger.debug('HTTP request', {\n method: opts.request.method,\n url: opts.request.url,\n });\n\n let resp: HttpResponse;\n try {\n resp = await opts.httpClient.send(opts.request);\n } catch (e: unknown) {\n opts.logger.debug('HTTP request failed');\n throw e;\n }\n\n const body = await readAll(resp.body);\n\n opts.logger.debug('HTTP response', {\n statusCode: resp.statusCode,\n body: new TextDecoder().decode(body),\n });\n\n const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);\n if (apiErr !== undefined) {\n throw apiErr;\n }\n\n return body;\n}\n\nexport function buildHttpRequest(\n method: string,\n url: string,\n headers: Headers,\n signal?: AbortSignal,\n body?: string | ReadableStream<Uint8Array>\n): HttpRequest {\n const req: HttpRequest = {url, method, headers};\n if (body !== undefined) {\n req.body = body;\n }\n if (signal !== undefined) {\n req.signal = signal;\n }\n return req;\n}\n\nexport function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {\n const text = new TextDecoder().decode(body);\n // 204 responses return an empty body; treat as `{}`.\n const parsed: unknown = text === '' ? {} : parseJson(text);\n return schema.parse(parsed);\n}\n\nexport function marshalRequest(data: unknown, schema: z.ZodType): string {\n return jsonBigint.stringify(schema.parse(data));\n}\n\nexport function flattenQueryParams(\n prefix: string,\n value: unknown,\n params: URLSearchParams\n): void {\n if (value === null || value === undefined) {\n return;\n }\n if (Array.isArray(value)) {\n // arrays of objects are not yet supported\n for (const item of value) {\n params.append(prefix, String(item));\n }\n } else if (typeof value === 'object') {\n for (const [key, val] of Object.entries(value as Record<string, unknown>)) {\n flattenQueryParams(`${prefix}.${key}`, val, params);\n }\n } else if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'bigint'\n ) {\n params.append(prefix, String(value));\n } else {\n throw new Error(`Unsupported query parameter type: ${typeof value}`);\n }\n}\n\n/**\n * Encodes a single-segment path variable for use in a URL. \"/\" stays a path\n * separator, unreserved characters and !$&'()*+,;=:@ stay unchanged, and every\n * other character is percent-encoded as UTF-8 with upper-case hex digits.\n */\nexport function encodePathVariable(value: string | number): string {\n // A number is accepted because an untyped caller could pass one to the\n // template interpolation this helper replaced. encodeURIComponent rejects a\n // lone surrogate, so toWellFormed() replaces it with U+FFFD, as the URL\n // parser does.\n return String(value)\n .toWellFormed()\n .split('/')\n .map(segment =>\n encodeURIComponent(segment).replace(\n /%(?:24|26|2B|2C|3A|3B|3D|40)/g,\n encoded => decodeURIComponent(encoded)\n )\n )\n .join('/');\n}\n"],"mappings":";;;;;AAgBA,MAAM,aAAa,QAAQ,EAAC,iBAAiB,MAAK,CAAC;AAGnD,MAAM,iBAAiB,QAAQ,EAAC,eAAe,MAAK,CAAC;AAKrD,SAAS,UAAU,MAAuB;CACxC,MAAM,QAAiB,KAAK,MAAM,KAAK;AACvC,QAAO,SAAS,KAAK,KAAK,GACtB,kBAAkB,OAAO,eAAe,MAAM,KAAK,CAAY,GAC/D;;AAKN,SAAS,kBAAkB,OAAgB,YAA8B;AACvE,KAAI,OAAO,UAAU,SACnB,QAAO,CAAC,OAAO,cAAc,MAAM,IACjC,OAAO,eAAe,YACtB,UAAU,KAAK,WAAW,GACxB,OAAO,WAAW,GAClB;AAEN,KAAI,MAAM,QAAQ,MAAM,EA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;AAKjE,QAAO,OAAO,MAAM,CACjB,cAAc,CACd,MAAM,IAAI,CACV,KAAI,YACH,mBAAmB,QAAQ,CAAC,QAC1B,kCACA,YAAW,mBAAmB,QAAQ,CACvC,CACF,CACA,KAAK,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databricks/sdk-uc-grants",
3
- "version": "0.52.1",
3
+ "version": "0.53.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -33,9 +33,9 @@
33
33
  "directory": "packages/uc/grants"
34
34
  },
35
35
  "dependencies": {
36
- "@databricks/sdk-auth": ">=0.56.0 <1.0.0",
37
- "@databricks/sdk-core": ">=0.52.0 <1.0.0",
38
- "@databricks/sdk-options": ">=0.52.1 <1.0.0",
36
+ "@databricks/sdk-auth": ">=0.56.1 <1.0.0",
37
+ "@databricks/sdk-core": ">=0.53.0 <1.0.0",
38
+ "@databricks/sdk-options": ">=0.53.0 <1.0.0",
39
39
  "@js-temporal/polyfill": "^0.5.0",
40
40
  "json-bigint": "^1.0.0",
41
41
  "zod": "^4.3.6"