@databricks/sdk-warehouses 0.54.3 → 0.54.4

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-warehouses";
3
- var version = "0.54.3";
3
+ var version = "0.54.4";
4
4
 
5
5
  //#endregion
6
6
  export { name, version };
@@ -7,7 +7,7 @@ import { LroOptions } from "@databricks/sdk-options/lro";
7
7
  declare class WarehousesClient {
8
8
  private readonly options;
9
9
  private readonly logger;
10
- private readonly userAgent;
10
+ private readonly clientInfo;
11
11
  private config;
12
12
  constructor(options: ClientOptions);
13
13
  private resolveConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/v1/client.ts"],"mappings":";;;;;;cA4Ea,gBAAA;EAAA,iBACM,OAAA;EAAA,iBACA,MAAA;EAAA,iBAIA,SAAA;EAAA,QAIT,MAAA;cAEI,OAAA,EAAS,aAAA;EAAA,QAUb,aAAA;EAWI;;;;EAFN,8BAAA,CACJ,GAAA,EAAK,qCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,wBAAA;EA8EA;EAAA,QAjCG,mBAAA;EA+CP;EAjBD,eAAA,CACJ,GAAA,EAAK,sBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,qBAAA;EAgBR;;;;;EAHG,8BAAA,CACJ,GAAA,EAAK,qCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA;EAiFS;EA7DN,eAAA,CACJ,GAAA,EAAK,sBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,uBAAA;EA2DR;EAAA,QAjCW,iBAAA;EAgDF;EAlBN,aAAA,CACJ,GAAA,EAAK,oBAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,mBAAA;EAgBR;;;;;EAHG,2BAAA,CACJ,GAAA,EAAK,kCAAA,EACL,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AA;EA3CJ;;;;EAuDD,8BAAA,CACJ,GAAA,EAAK,qCAAA,EACL,OAAA,GAAU,WAAA,GACT,OAAA,CAAQ,wBAAA;AAAA;AAAA,cA4CA,qBAAA;EAAA,iBAEQ,MAAA;EAAA,SACR,EAAA;cADQ,MAAA,EAAQ,gBAAA,EAChB,EAAA;EA/CA;;;;;EAuDL,IAAA,CAAK,OAAA,GAAU,UAAA,GAAa,OAAA,CAAQ,oBAAA;EAhlBzB;EAsnBX,IAAA,CAAK,OAAA,GAAU,WAAA,GAAc,OAAA;AAAA;AAAA,cAwBxB,mBAAA;EAAA,iBAEQ,MAAA;EAAA,SACR,EAAA;cADQ,MAAA,EAAQ,gBAAA,EAChB,EAAA;EAznBJ;;;;;EAioBD,IAAA,CAAK,OAAA,GAAU,UAAA,GAAa,OAAA,CAAQ,oBAAA;EAnlB5B;EAynBR,IAAA,CAAK,OAAA,GAAU,WAAA,GAAc,OAAA;AAAA;AAAA,cAwBxB,oBAAA;EAAA,iBAEQ,MAAA;EAAA,SACR,EAAA;cADQ,MAAA,EAAQ,gBAAA,EAChB,EAAA;EApnBA;;;;;EA4nBL,IAAA,CAAK,OAAA,GAAU,UAAA,GAAa,OAAA,CAAQ,oBAAA;EA5mBvC;EAkpBG,IAAA,CAAK,OAAA,GAAU,WAAA,GAAc,OAAA;AAAA;AAAA,cAwBxB,mBAAA;EAAA,iBAEQ,MAAA;EAAA,SACR,EAAA;cADQ,MAAA,EAAQ,gBAAA,EAChB,EAAA;EAvpBA;;;;;EA+pBL,IAAA,CAAK,OAAA,GAAU,UAAA,GAAa,OAAA,CAAQ,oBAAA;EAvmBxC;EAwoBI,IAAA,CAAK,OAAA,GAAU,WAAA,GAAc,OAAA;AAAA"}
package/dist/v1/client.js CHANGED
@@ -14,21 +14,18 @@ const PACKAGE_SEGMENT = {
14
14
  var WarehousesClient = 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
  /**
@@ -46,8 +43,7 @@ var WarehousesClient = class {
46
43
  let resp;
47
44
  const call = async (callSignal) => {
48
45
  const headers = new Headers({ "Content-Type": "application/json" });
49
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
50
- headers.set("User-Agent", this.userAgent);
46
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
51
47
  resp = parseResponse(await executeHttpCall({
52
48
  request: buildHttpRequest("POST", fullUrl, headers, callSignal, body),
53
49
  httpClient,
@@ -66,8 +62,7 @@ var WarehousesClient = class {
66
62
  let resp;
67
63
  const call = async (callSignal) => {
68
64
  const headers = new Headers({ "Content-Type": "application/json" });
69
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
70
- headers.set("User-Agent", this.userAgent);
65
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
71
66
  resp = parseResponse(await executeHttpCall({
72
67
  request: buildHttpRequest("POST", url, headers, callSignal, body),
73
68
  httpClient,
@@ -94,8 +89,7 @@ var WarehousesClient = class {
94
89
  const url = `${host}/api/warehouses/v1/${req.name ?? ""}`;
95
90
  const call = async (callSignal) => {
96
91
  const headers = new Headers();
97
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
98
- headers.set("User-Agent", this.userAgent);
92
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
99
93
  await executeHttpCall({
100
94
  request: buildHttpRequest("DELETE", url, headers, callSignal),
101
95
  httpClient,
@@ -111,8 +105,7 @@ var WarehousesClient = class {
111
105
  let resp;
112
106
  const call = async (callSignal) => {
113
107
  const headers = new Headers();
114
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
115
- headers.set("User-Agent", this.userAgent);
108
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
116
109
  resp = parseResponse(await executeHttpCall({
117
110
  request: buildHttpRequest("DELETE", url, headers, callSignal),
118
111
  httpClient,
@@ -131,8 +124,7 @@ var WarehousesClient = class {
131
124
  let resp;
132
125
  const call = async (callSignal) => {
133
126
  const headers = new Headers({ "Content-Type": "application/json" });
134
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
135
- headers.set("User-Agent", this.userAgent);
127
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
136
128
  resp = parseResponse(await executeHttpCall({
137
129
  request: buildHttpRequest("POST", url, headers, callSignal, body),
138
130
  httpClient,
@@ -160,8 +152,7 @@ var WarehousesClient = class {
160
152
  let resp;
161
153
  const call = async (callSignal) => {
162
154
  const headers = new Headers();
163
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
164
- headers.set("User-Agent", this.userAgent);
155
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
165
156
  resp = parseResponse(await executeHttpCall({
166
157
  request: buildHttpRequest("GET", url, headers, callSignal),
167
158
  httpClient,
@@ -179,8 +170,7 @@ var WarehousesClient = class {
179
170
  let resp;
180
171
  const call = async (callSignal) => {
181
172
  const headers = new Headers();
182
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
183
- headers.set("User-Agent", this.userAgent);
173
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
184
174
  resp = parseResponse(await executeHttpCall({
185
175
  request: buildHttpRequest("GET", url, headers, callSignal),
186
176
  httpClient,
@@ -198,8 +188,7 @@ var WarehousesClient = class {
198
188
  let resp;
199
189
  const call = async (callSignal) => {
200
190
  const headers = new Headers();
201
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
202
- headers.set("User-Agent", this.userAgent);
191
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
203
192
  resp = parseResponse(await executeHttpCall({
204
193
  request: buildHttpRequest("GET", url, headers, callSignal),
205
194
  httpClient,
@@ -225,8 +214,7 @@ var WarehousesClient = class {
225
214
  let resp;
226
215
  const call = async (callSignal) => {
227
216
  const headers = new Headers();
228
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
229
- headers.set("User-Agent", this.userAgent);
217
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
230
218
  resp = parseResponse(await executeHttpCall({
231
219
  request: buildHttpRequest("GET", fullUrl, headers, callSignal),
232
220
  httpClient,
@@ -259,8 +247,7 @@ var WarehousesClient = class {
259
247
  let resp;
260
248
  const call = async (callSignal) => {
261
249
  const headers = new Headers();
262
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
263
- headers.set("User-Agent", this.userAgent);
250
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
264
251
  resp = parseResponse(await executeHttpCall({
265
252
  request: buildHttpRequest("GET", fullUrl, headers, callSignal),
266
253
  httpClient,
@@ -288,8 +275,7 @@ var WarehousesClient = class {
288
275
  let resp;
289
276
  const call = async (callSignal) => {
290
277
  const headers = new Headers({ "Content-Type": "application/json" });
291
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
292
- headers.set("User-Agent", this.userAgent);
278
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
293
279
  resp = parseResponse(await executeHttpCall({
294
280
  request: buildHttpRequest("PUT", url, headers, callSignal, body),
295
281
  httpClient,
@@ -308,8 +294,7 @@ var WarehousesClient = class {
308
294
  let resp;
309
295
  const call = async (callSignal) => {
310
296
  const headers = new Headers({ "Content-Type": "application/json" });
311
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
312
- headers.set("User-Agent", this.userAgent);
297
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
313
298
  resp = parseResponse(await executeHttpCall({
314
299
  request: buildHttpRequest("POST", url, headers, callSignal, body),
315
300
  httpClient,
@@ -334,8 +319,7 @@ var WarehousesClient = class {
334
319
  let resp;
335
320
  const call = async (callSignal) => {
336
321
  const headers = new Headers({ "Content-Type": "application/json" });
337
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
338
- headers.set("User-Agent", this.userAgent);
322
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
339
323
  resp = parseResponse(await executeHttpCall({
340
324
  request: buildHttpRequest("POST", url, headers, callSignal, body),
341
325
  httpClient,
@@ -368,8 +352,7 @@ var WarehousesClient = class {
368
352
  let resp;
369
353
  const call = async (callSignal) => {
370
354
  const headers = new Headers({ "Content-Type": "application/json" });
371
- if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
372
- headers.set("User-Agent", this.userAgent);
355
+ if (workspaceId !== void 0 && workspaceId !== "") headers.set("X-Databricks-Workspace-Id", workspaceId);
373
356
  resp = parseResponse(await executeHttpCall({
374
357
  request: buildHttpRequest("PATCH", fullUrl, headers, callSignal, body),
375
358
  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 {LroOptions} from '@databricks/sdk-options/lro';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n executeWait,\n StillRunningError,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n CreateDefaultWarehouseOverrideRequest,\n CreateWarehouseRequest,\n CreateWarehouseResponse,\n DefaultWarehouseOverride,\n DeleteDefaultWarehouseOverrideRequest,\n DeleteWarehouseRequest,\n DeleteWarehouseResponse,\n EditWarehouseRequest,\n EditWarehouseResponse,\n EndpointInfo,\n GetDefaultWarehouseOverrideRequest,\n GetWarehouseRequest,\n GetWarehouseResponse,\n GetWorkspaceWarehouseConfigRequest,\n GetWorkspaceWarehouseConfigResponse,\n ListDefaultWarehouseOverridesRequest,\n ListDefaultWarehouseOverridesResponse,\n ListWarehousesRequest,\n ListWarehousesResponse,\n SetWorkspaceWarehouseConfigRequest,\n SetWorkspaceWarehouseConfigResponse,\n StartRequest,\n StartResponse,\n StopRequest,\n StopResponse,\n UpdateDefaultWarehouseOverrideRequest,\n} from './model';\nimport {\n EndpointState,\n marshalCreateWarehouseRequestSchema,\n marshalDefaultWarehouseOverrideSchema,\n marshalEditWarehouseRequestSchema,\n marshalSetWorkspaceWarehouseConfigRequestSchema,\n marshalStartRequestSchema,\n marshalStopRequestSchema,\n unmarshalCreateWarehouseResponseSchema,\n unmarshalDefaultWarehouseOverrideSchema,\n unmarshalDeleteWarehouseResponseSchema,\n unmarshalEditWarehouseResponseSchema,\n unmarshalGetWarehouseResponseSchema,\n unmarshalGetWorkspaceWarehouseConfigResponseSchema,\n unmarshalListDefaultWarehouseOverridesResponseSchema,\n unmarshalListWarehousesResponseSchema,\n unmarshalSetWorkspaceWarehouseConfigResponseSchema,\n unmarshalStartResponseSchema,\n unmarshalStopResponseSchema,\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 WarehousesClient {\n private readonly options: ClientOptions;\n private readonly logger: Logger;\n // User-Agent header value. Composed once at construction from\n // createDefault() merged with this package's identity and the active\n // credential's name.\n private readonly userAgent: string;\n // Memoized configuration. The profile is resolved once, lazily, on the first\n // request, then reused; host, workspaceId/accountId, and credentials are\n // filled from it when not set explicitly on the options.\n private config: Promise<ResolvedClientConfig> | undefined;\n\n constructor(options: ClientOptions) {\n this.options = options;\n this.logger = options.logger ?? new NoOpLogger();\n const info = createDefault()\n .with(PACKAGE_SEGMENT)\n .with({key: 'sdk-js-auth', value: AUTH_VERSION})\n .with({key: 'auth', value: options.credentials?.name() ?? 'default'});\n this.userAgent = info.toString();\n }\n\n private resolveConfig(): Promise<ResolvedClientConfig> {\n this.config ??= resolveClientConfig(this.options);\n return this.config;\n }\n\n /**\n * Creates a new default warehouse override for a user.\n * Users can create their own override. Admins can create overrides for any user.\n */\n async createDefaultWarehouseOverride(\n req: CreateDefaultWarehouseOverrideRequest,\n options?: CallOptions\n ): Promise<DefaultWarehouseOverride> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/default-warehouse-overrides`;\n const params = new URLSearchParams();\n if (req.defaultWarehouseOverrideId !== undefined) {\n params.append(\n 'default_warehouse_override_id',\n req.defaultWarehouseOverrideId\n );\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n const body = marshalRequest(\n req.defaultWarehouseOverride,\n marshalDefaultWarehouseOverrideSchema\n );\n let resp: DefaultWarehouseOverride | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest(\n 'POST',\n fullUrl,\n headers,\n callSignal,\n body\n );\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDefaultWarehouseOverrideSchema);\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 /** Creates a new SQL warehouse. */\n private async createWarehouseBase(\n req: CreateWarehouseRequest,\n options?: CallOptions\n ): Promise<CreateWarehouseResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses`;\n const body = marshalRequest(req, marshalCreateWarehouseRequestSchema);\n let resp: CreateWarehouseResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalCreateWarehouseResponseSchema);\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 /** Creates a new SQL warehouse. */\n async createWarehouse(\n req: CreateWarehouseRequest,\n options?: CallOptions\n ): Promise<CreateWarehouseWaiter> {\n const resp = await this.createWarehouseBase(req, options);\n if (resp.id === undefined) {\n throw new Error('response field id required for polling is missing');\n }\n return new CreateWarehouseWaiter(this, resp.id);\n }\n\n /**\n * Deletes the default warehouse override for a user.\n * Users can delete their own override. Admins can delete overrides for any user.\n * After deletion, the workspace default warehouse will be used.\n */\n async deleteDefaultWarehouseOverride(\n req: DeleteDefaultWarehouseOverrideRequest,\n options?: CallOptions\n ): Promise<void> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/${req.name ?? ''}`;\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('DELETE', url, headers, callSignal);\n await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n };\n await executeCall(call, options);\n }\n\n /** Deletes a SQL warehouse. */\n async deleteWarehouse(\n req: DeleteWarehouseRequest,\n options?: CallOptions\n ): Promise<DeleteWarehouseResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}`;\n let resp: DeleteWarehouseResponse | 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('DELETE', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDeleteWarehouseResponseSchema);\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 /** Updates the configuration for a SQL warehouse. */\n private async editWarehouseBase(\n req: EditWarehouseRequest,\n options?: CallOptions\n ): Promise<EditWarehouseResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}/edit`;\n const body = marshalRequest(req, marshalEditWarehouseRequestSchema);\n let resp: EditWarehouseResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalEditWarehouseResponseSchema);\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 /** Updates the configuration for a SQL warehouse. */\n async editWarehouse(\n req: EditWarehouseRequest,\n options?: CallOptions\n ): Promise<EditWarehouseWaiter> {\n await this.editWarehouseBase(req, options);\n if (req.id === undefined) {\n throw new Error('request field id required for polling is missing');\n }\n return new EditWarehouseWaiter(this, req.id);\n }\n\n /**\n * Returns the default warehouse override for a user.\n * Users can fetch their own override. Admins can fetch overrides for any user.\n * If no override exists, the UI will fallback to the workspace default warehouse.\n */\n async getDefaultWarehouseOverride(\n req: GetDefaultWarehouseOverrideRequest,\n options?: CallOptions\n ): Promise<DefaultWarehouseOverride> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/${req.name ?? ''}`;\n let resp: DefaultWarehouseOverride | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDefaultWarehouseOverrideSchema);\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 /** Gets the information for a single SQL warehouse. */\n async getWarehouse(\n req: GetWarehouseRequest,\n options?: CallOptions\n ): Promise<GetWarehouseResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}`;\n let resp: GetWarehouseResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalGetWarehouseResponseSchema);\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 /** Gets the workspace level configuration that is shared by all SQL warehouses in a workspace. */\n async getWorkspaceWarehouseConfig(\n _req: GetWorkspaceWarehouseConfigRequest,\n options?: CallOptions\n ): Promise<GetWorkspaceWarehouseConfigResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/config/warehouses`;\n let resp: GetWorkspaceWarehouseConfigResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers();\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('GET', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalGetWorkspaceWarehouseConfigResponseSchema\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 * Lists all default warehouse overrides in the workspace.\n * Only workspace administrators can list all overrides.\n */\n async listDefaultWarehouseOverrides(\n req: ListDefaultWarehouseOverridesRequest,\n options?: CallOptions\n ): Promise<ListDefaultWarehouseOverridesResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/default-warehouse-overrides`;\n const params = new URLSearchParams();\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: ListDefaultWarehouseOverridesResponse | 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 unmarshalListDefaultWarehouseOverridesResponseSchema\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 *listDefaultWarehouseOverridesIter(\n req: ListDefaultWarehouseOverridesRequest,\n options?: CallOptions\n ): AsyncGenerator<DefaultWarehouseOverride> {\n const pageReq: ListDefaultWarehouseOverridesRequest = {...req};\n for (;;) {\n const resp = await this.listDefaultWarehouseOverrides(pageReq, options);\n for (const item of resp.defaultWarehouseOverrides ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /** Lists all SQL warehouses that a user has access to. */\n async listWarehouses(\n req: ListWarehousesRequest,\n options?: CallOptions\n ): Promise<ListWarehousesResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses`;\n const params = new URLSearchParams();\n if (req.runAsUserId !== undefined) {\n params.append('run_as_user_id', String(req.runAsUserId));\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: ListWarehousesResponse | 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, unmarshalListWarehousesResponseSchema);\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 *listWarehousesIter(\n req: ListWarehousesRequest,\n options?: CallOptions\n ): AsyncGenerator<EndpointInfo> {\n const pageReq: ListWarehousesRequest = {...req};\n for (;;) {\n const resp = await this.listWarehouses(pageReq, options);\n for (const item of resp.warehouses ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /** Sets the workspace level configuration that is shared by all SQL warehouses in a workspace. */\n async setWorkspaceWarehouseConfig(\n req: SetWorkspaceWarehouseConfigRequest,\n options?: CallOptions\n ): Promise<SetWorkspaceWarehouseConfigResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/config/warehouses`;\n const body = marshalRequest(\n req,\n marshalSetWorkspaceWarehouseConfigRequestSchema\n );\n let resp: SetWorkspaceWarehouseConfigResponse | 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('PUT', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalSetWorkspaceWarehouseConfigResponseSchema\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 /** Starts a SQL warehouse. */\n private async startWarehouseBase(\n req: StartRequest,\n options?: CallOptions\n ): Promise<StartResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}/start`;\n const body = marshalRequest(req, marshalStartRequestSchema);\n let resp: StartResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalStartResponseSchema);\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 /** Starts a SQL warehouse. */\n async startWarehouse(\n req: StartRequest,\n options?: CallOptions\n ): Promise<StartWarehouseWaiter> {\n await this.startWarehouseBase(req, options);\n if (req.id === undefined) {\n throw new Error('request field id required for polling is missing');\n }\n return new StartWarehouseWaiter(this, req.id);\n }\n\n /** Stops a SQL warehouse. */\n private async stopWarehouseBase(\n req: StopRequest,\n options?: CallOptions\n ): Promise<StopResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}/stop`;\n const body = marshalRequest(req, marshalStopRequestSchema);\n let resp: StopResponse | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalStopResponseSchema);\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 /** Stops a SQL warehouse. */\n async stopWarehouse(\n req: StopRequest,\n options?: CallOptions\n ): Promise<StopWarehouseWaiter> {\n await this.stopWarehouseBase(req, options);\n if (req.id === undefined) {\n throw new Error('request field id required for polling is missing');\n }\n return new StopWarehouseWaiter(this, req.id);\n }\n\n /**\n * Updates an existing default warehouse override for a user.\n * Users can update their own override. Admins can update overrides for any user.\n */\n async updateDefaultWarehouseOverride(\n req: UpdateDefaultWarehouseOverrideRequest,\n options?: CallOptions\n ): Promise<DefaultWarehouseOverride> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/${req.defaultWarehouseOverride?.name ?? ''}`;\n const params = new URLSearchParams();\n if (req.updateMask !== undefined) {\n params.append('update_mask', req.updateMask.toString());\n }\n if (req.allowMissing !== undefined) {\n params.append('allow_missing', String(req.allowMissing));\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n const body = marshalRequest(\n req.defaultWarehouseOverride,\n marshalDefaultWarehouseOverrideSchema\n );\n let resp: DefaultWarehouseOverride | undefined;\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const headers = new Headers({'Content-Type': 'application/json'});\n if (workspaceId !== undefined) {\n headers.set('X-Databricks-Workspace-Id', workspaceId);\n }\n headers.set('User-Agent', this.userAgent);\n const httpReq = buildHttpRequest(\n 'PATCH',\n fullUrl,\n headers,\n callSignal,\n body\n );\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDefaultWarehouseOverrideSchema);\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\nexport class CreateWarehouseWaiter {\n constructor(\n private readonly client: WarehousesClient,\n readonly id: string\n ) {}\n\n /**\n * Polls until the operation reaches a terminal state.\n *\n * Throws if a failure state is reached.\n */\n async wait(options?: LroOptions): Promise<GetWarehouseResponse> {\n let result: GetWarehouseResponse | undefined;\n\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n callSignal !== undefined ? {signal: callSignal} : undefined\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n result = pollResp;\n return;\n case EndpointState.STOPPED:\n case EndpointState.DELETED: {\n const msg = pollResp.health?.summary ?? '(no message)';\n throw new Error(`terminal state ${status}: ${msg}`);\n }\n default:\n throw new StillRunningError();\n }\n };\n\n await executeWait(call, options);\n if (result === undefined) {\n throw new Error('operation completed without a result.');\n }\n return result;\n }\n\n /** Checks whether the operation has reached a terminal state. */\n async done(options?: CallOptions): Promise<boolean> {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n options\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n case EndpointState.STOPPED:\n case EndpointState.DELETED:\n return true;\n default:\n return false;\n }\n }\n}\n\nexport class EditWarehouseWaiter {\n constructor(\n private readonly client: WarehousesClient,\n readonly id: string\n ) {}\n\n /**\n * Polls until the operation reaches a terminal state.\n *\n * Throws if a failure state is reached.\n */\n async wait(options?: LroOptions): Promise<GetWarehouseResponse> {\n let result: GetWarehouseResponse | undefined;\n\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n callSignal !== undefined ? {signal: callSignal} : undefined\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n result = pollResp;\n return;\n case EndpointState.STOPPED:\n case EndpointState.DELETED: {\n const msg = pollResp.health?.summary ?? '(no message)';\n throw new Error(`terminal state ${status}: ${msg}`);\n }\n default:\n throw new StillRunningError();\n }\n };\n\n await executeWait(call, options);\n if (result === undefined) {\n throw new Error('operation completed without a result.');\n }\n return result;\n }\n\n /** Checks whether the operation has reached a terminal state. */\n async done(options?: CallOptions): Promise<boolean> {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n options\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n case EndpointState.STOPPED:\n case EndpointState.DELETED:\n return true;\n default:\n return false;\n }\n }\n}\n\nexport class StartWarehouseWaiter {\n constructor(\n private readonly client: WarehousesClient,\n readonly id: string\n ) {}\n\n /**\n * Polls until the operation reaches a terminal state.\n *\n * Throws if a failure state is reached.\n */\n async wait(options?: LroOptions): Promise<GetWarehouseResponse> {\n let result: GetWarehouseResponse | undefined;\n\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n callSignal !== undefined ? {signal: callSignal} : undefined\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n result = pollResp;\n return;\n case EndpointState.STOPPED:\n case EndpointState.DELETED: {\n const msg = pollResp.health?.summary ?? '(no message)';\n throw new Error(`terminal state ${status}: ${msg}`);\n }\n default:\n throw new StillRunningError();\n }\n };\n\n await executeWait(call, options);\n if (result === undefined) {\n throw new Error('operation completed without a result.');\n }\n return result;\n }\n\n /** Checks whether the operation has reached a terminal state. */\n async done(options?: CallOptions): Promise<boolean> {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n options\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n case EndpointState.STOPPED:\n case EndpointState.DELETED:\n return true;\n default:\n return false;\n }\n }\n}\n\nexport class StopWarehouseWaiter {\n constructor(\n private readonly client: WarehousesClient,\n readonly id: string\n ) {}\n\n /**\n * Polls until the operation reaches a terminal state.\n *\n * Throws if a failure state is reached.\n */\n async wait(options?: LroOptions): Promise<GetWarehouseResponse> {\n let result: GetWarehouseResponse | undefined;\n\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n callSignal !== undefined ? {signal: callSignal} : undefined\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.STOPPED:\n result = pollResp;\n return;\n default:\n throw new StillRunningError();\n }\n };\n\n await executeWait(call, options);\n if (result === undefined) {\n throw new Error('operation completed without a result.');\n }\n return result;\n }\n\n /** Checks whether the operation has reached a terminal state. */\n async done(options?: CallOptions): Promise<boolean> {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n options\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.STOPPED:\n return true;\n default:\n return false;\n }\n }\n}\n"],"mappings":";;;;;;;;;AAuEA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,mBAAb,MAA8B;CAC5B,AAAiB;CACjB,AAAiB;CAIjB,AAAiB;CAIjB,AAAQ;CAER,YAAY,SAAwB;AAClC,OAAK,UAAU;AACf,OAAK,SAAS,QAAQ,UAAU,IAAI,YAAY;AAKhD,OAAK,YAJQ,eAAe,CACzB,KAAK,gBAAgB,CACrB,KAAK;GAAC,KAAK;GAAe,OAAOC;GAAa,CAAC,CAC/C,KAAK;GAAC,KAAK;GAAQ,OAAO,QAAQ,aAAa,MAAM,IAAI;GAAU,CAAC,CACjD,UAAU;;CAGlC,AAAQ,gBAA+C;AACrD,OAAK,WAAW,oBAAoB,KAAK,QAAQ;AACjD,SAAO,KAAK;;;;;;CAOd,MAAM,+BACJ,KACA,SACmC;EACnC,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,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AAM,YAAY,MAAM,QAAQ;AAChC,MAAI,WAAW,OACb,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;;CAIT,MAAM,KAAK,SAAyC;EAQlD,MAAM,UAPW,MAAM,KAAK,OAAO,aACjC,EACE,IAAI,KAAK,IACV,EACD,QACD,EAEuB;AACxB,MAAI,WAAW,OACb,OAAM,IAAI,MAAM,yCAAyC;AAG3D,UAAQ,QAAR;GACE,KAAK,cAAc;GACnB,KAAK,cAAc;GACnB,KAAK,cAAc,QACjB,QAAO;GACT,QACE,QAAO;;;;AAKf,IAAa,sBAAb,MAAiC;CAC/B,YACE,AAAiB,QACjB,AAAS,IACT;EAFiB;EACR;;;;;;;CAQX,MAAM,KAAK,SAAqD;EAC9D,IAAI;EAEJ,MAAM,OAAO,OAAO,eAA4C;GAC9D,MAAM,WAAW,MAAM,KAAK,OAAO,aACjC,EACE,IAAI,KAAK,IACV,EACD,eAAe,SAAY,EAAC,QAAQ,YAAW,GAAG,OACnD;GAED,MAAM,SAAS,SAAS;AACxB,OAAI,WAAW,OACb,OAAM,IAAI,MAAM,yCAAyC;AAG3D,WAAQ,QAAR;IACE,KAAK,cAAc;AACjB,cAAS;AACT;IACF,QACE,OAAM,IAAI,mBAAmB;;;AAInC,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,WAAW,OACb,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;;CAIT,MAAM,KAAK,SAAyC;EAQlD,MAAM,UAPW,MAAM,KAAK,OAAO,aACjC,EACE,IAAI,KAAK,IACV,EACD,QACD,EAEuB;AACxB,MAAI,WAAW,OACb,OAAM,IAAI,MAAM,yCAAyC;AAG3D,UAAQ,QAAR;GACE,KAAK,cAAc,QACjB,QAAO;GACT,QACE,QAAO"}
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 {LroOptions} from '@databricks/sdk-options/lro';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n executeWait,\n StillRunningError,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n CreateDefaultWarehouseOverrideRequest,\n CreateWarehouseRequest,\n CreateWarehouseResponse,\n DefaultWarehouseOverride,\n DeleteDefaultWarehouseOverrideRequest,\n DeleteWarehouseRequest,\n DeleteWarehouseResponse,\n EditWarehouseRequest,\n EditWarehouseResponse,\n EndpointInfo,\n GetDefaultWarehouseOverrideRequest,\n GetWarehouseRequest,\n GetWarehouseResponse,\n GetWorkspaceWarehouseConfigRequest,\n GetWorkspaceWarehouseConfigResponse,\n ListDefaultWarehouseOverridesRequest,\n ListDefaultWarehouseOverridesResponse,\n ListWarehousesRequest,\n ListWarehousesResponse,\n SetWorkspaceWarehouseConfigRequest,\n SetWorkspaceWarehouseConfigResponse,\n StartRequest,\n StartResponse,\n StopRequest,\n StopResponse,\n UpdateDefaultWarehouseOverrideRequest,\n} from './model';\nimport {\n EndpointState,\n marshalCreateWarehouseRequestSchema,\n marshalDefaultWarehouseOverrideSchema,\n marshalEditWarehouseRequestSchema,\n marshalSetWorkspaceWarehouseConfigRequestSchema,\n marshalStartRequestSchema,\n marshalStopRequestSchema,\n unmarshalCreateWarehouseResponseSchema,\n unmarshalDefaultWarehouseOverrideSchema,\n unmarshalDeleteWarehouseResponseSchema,\n unmarshalEditWarehouseResponseSchema,\n unmarshalGetWarehouseResponseSchema,\n unmarshalGetWorkspaceWarehouseConfigResponseSchema,\n unmarshalListDefaultWarehouseOverridesResponseSchema,\n unmarshalListWarehousesResponseSchema,\n unmarshalSetWorkspaceWarehouseConfigResponseSchema,\n unmarshalStartResponseSchema,\n unmarshalStopResponseSchema,\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 WarehousesClient {\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 * Creates a new default warehouse override for a user.\n * Users can create their own override. Admins can create overrides for any user.\n */\n async createDefaultWarehouseOverride(\n req: CreateDefaultWarehouseOverrideRequest,\n options?: CallOptions\n ): Promise<DefaultWarehouseOverride> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/default-warehouse-overrides`;\n const params = new URLSearchParams();\n if (req.defaultWarehouseOverrideId !== undefined) {\n params.append(\n 'default_warehouse_override_id',\n req.defaultWarehouseOverrideId\n );\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n const body = marshalRequest(\n req.defaultWarehouseOverride,\n marshalDefaultWarehouseOverrideSchema\n );\n let resp: DefaultWarehouseOverride | 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(\n 'POST',\n fullUrl,\n headers,\n callSignal,\n body\n );\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDefaultWarehouseOverrideSchema);\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 /** Creates a new SQL warehouse. */\n private async createWarehouseBase(\n req: CreateWarehouseRequest,\n options?: CallOptions\n ): Promise<CreateWarehouseResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses`;\n const body = marshalRequest(req, marshalCreateWarehouseRequestSchema);\n let resp: CreateWarehouseResponse | 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('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalCreateWarehouseResponseSchema);\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 /** Creates a new SQL warehouse. */\n async createWarehouse(\n req: CreateWarehouseRequest,\n options?: CallOptions\n ): Promise<CreateWarehouseWaiter> {\n const resp = await this.createWarehouseBase(req, options);\n if (resp.id === undefined) {\n throw new Error('response field id required for polling is missing');\n }\n return new CreateWarehouseWaiter(this, resp.id);\n }\n\n /**\n * Deletes the default warehouse override for a user.\n * Users can delete their own override. Admins can delete overrides for any user.\n * After deletion, the workspace default warehouse will be used.\n */\n async deleteDefaultWarehouseOverride(\n req: DeleteDefaultWarehouseOverrideRequest,\n options?: CallOptions\n ): Promise<void> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/${req.name ?? ''}`;\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('DELETE', url, headers, callSignal);\n await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n };\n await executeCall(call, options);\n }\n\n /** Deletes a SQL warehouse. */\n async deleteWarehouse(\n req: DeleteWarehouseRequest,\n options?: CallOptions\n ): Promise<DeleteWarehouseResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}`;\n let resp: DeleteWarehouseResponse | 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('DELETE', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDeleteWarehouseResponseSchema);\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 /** Updates the configuration for a SQL warehouse. */\n private async editWarehouseBase(\n req: EditWarehouseRequest,\n options?: CallOptions\n ): Promise<EditWarehouseResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}/edit`;\n const body = marshalRequest(req, marshalEditWarehouseRequestSchema);\n let resp: EditWarehouseResponse | 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('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalEditWarehouseResponseSchema);\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 /** Updates the configuration for a SQL warehouse. */\n async editWarehouse(\n req: EditWarehouseRequest,\n options?: CallOptions\n ): Promise<EditWarehouseWaiter> {\n await this.editWarehouseBase(req, options);\n if (req.id === undefined) {\n throw new Error('request field id required for polling is missing');\n }\n return new EditWarehouseWaiter(this, req.id);\n }\n\n /**\n * Returns the default warehouse override for a user.\n * Users can fetch their own override. Admins can fetch overrides for any user.\n * If no override exists, the UI will fallback to the workspace default warehouse.\n */\n async getDefaultWarehouseOverride(\n req: GetDefaultWarehouseOverrideRequest,\n options?: CallOptions\n ): Promise<DefaultWarehouseOverride> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/${req.name ?? ''}`;\n let resp: DefaultWarehouseOverride | 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', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDefaultWarehouseOverrideSchema);\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 /** Gets the information for a single SQL warehouse. */\n async getWarehouse(\n req: GetWarehouseRequest,\n options?: CallOptions\n ): Promise<GetWarehouseResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}`;\n let resp: GetWarehouseResponse | 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', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalGetWarehouseResponseSchema);\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 /** Gets the workspace level configuration that is shared by all SQL warehouses in a workspace. */\n async getWorkspaceWarehouseConfig(\n _req: GetWorkspaceWarehouseConfigRequest,\n options?: CallOptions\n ): Promise<GetWorkspaceWarehouseConfigResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/config/warehouses`;\n let resp: GetWorkspaceWarehouseConfigResponse | 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', url, headers, callSignal);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalGetWorkspaceWarehouseConfigResponseSchema\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 * Lists all default warehouse overrides in the workspace.\n * Only workspace administrators can list all overrides.\n */\n async listDefaultWarehouseOverrides(\n req: ListDefaultWarehouseOverridesRequest,\n options?: CallOptions\n ): Promise<ListDefaultWarehouseOverridesResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/default-warehouse-overrides`;\n const params = new URLSearchParams();\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: ListDefaultWarehouseOverridesResponse | 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 unmarshalListDefaultWarehouseOverridesResponseSchema\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 *listDefaultWarehouseOverridesIter(\n req: ListDefaultWarehouseOverridesRequest,\n options?: CallOptions\n ): AsyncGenerator<DefaultWarehouseOverride> {\n const pageReq: ListDefaultWarehouseOverridesRequest = {...req};\n for (;;) {\n const resp = await this.listDefaultWarehouseOverrides(pageReq, options);\n for (const item of resp.defaultWarehouseOverrides ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /** Lists all SQL warehouses that a user has access to. */\n async listWarehouses(\n req: ListWarehousesRequest,\n options?: CallOptions\n ): Promise<ListWarehousesResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses`;\n const params = new URLSearchParams();\n if (req.runAsUserId !== undefined) {\n params.append('run_as_user_id', String(req.runAsUserId));\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: ListWarehousesResponse | 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, unmarshalListWarehousesResponseSchema);\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 *listWarehousesIter(\n req: ListWarehousesRequest,\n options?: CallOptions\n ): AsyncGenerator<EndpointInfo> {\n const pageReq: ListWarehousesRequest = {...req};\n for (;;) {\n const resp = await this.listWarehouses(pageReq, options);\n for (const item of resp.warehouses ?? []) {\n yield item;\n }\n if (resp.nextPageToken === undefined || resp.nextPageToken === '') {\n return;\n }\n pageReq.pageToken = resp.nextPageToken;\n }\n }\n\n /** Sets the workspace level configuration that is shared by all SQL warehouses in a workspace. */\n async setWorkspaceWarehouseConfig(\n req: SetWorkspaceWarehouseConfigRequest,\n options?: CallOptions\n ): Promise<SetWorkspaceWarehouseConfigResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/config/warehouses`;\n const body = marshalRequest(\n req,\n marshalSetWorkspaceWarehouseConfigRequestSchema\n );\n let resp: SetWorkspaceWarehouseConfigResponse | 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('PUT', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(\n respBody,\n unmarshalSetWorkspaceWarehouseConfigResponseSchema\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 /** Starts a SQL warehouse. */\n private async startWarehouseBase(\n req: StartRequest,\n options?: CallOptions\n ): Promise<StartResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}/start`;\n const body = marshalRequest(req, marshalStartRequestSchema);\n let resp: StartResponse | 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('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalStartResponseSchema);\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 /** Starts a SQL warehouse. */\n async startWarehouse(\n req: StartRequest,\n options?: CallOptions\n ): Promise<StartWarehouseWaiter> {\n await this.startWarehouseBase(req, options);\n if (req.id === undefined) {\n throw new Error('request field id required for polling is missing');\n }\n return new StartWarehouseWaiter(this, req.id);\n }\n\n /** Stops a SQL warehouse. */\n private async stopWarehouseBase(\n req: StopRequest,\n options?: CallOptions\n ): Promise<StopResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/warehouses/${req.id ?? ''}/stop`;\n const body = marshalRequest(req, marshalStopRequestSchema);\n let resp: StopResponse | 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('POST', url, headers, callSignal, body);\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalStopResponseSchema);\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 /** Stops a SQL warehouse. */\n async stopWarehouse(\n req: StopRequest,\n options?: CallOptions\n ): Promise<StopWarehouseWaiter> {\n await this.stopWarehouseBase(req, options);\n if (req.id === undefined) {\n throw new Error('request field id required for polling is missing');\n }\n return new StopWarehouseWaiter(this, req.id);\n }\n\n /**\n * Updates an existing default warehouse override for a user.\n * Users can update their own override. Admins can update overrides for any user.\n */\n async updateDefaultWarehouseOverride(\n req: UpdateDefaultWarehouseOverrideRequest,\n options?: CallOptions\n ): Promise<DefaultWarehouseOverride> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/warehouses/v1/${req.defaultWarehouseOverride?.name ?? ''}`;\n const params = new URLSearchParams();\n if (req.updateMask !== undefined) {\n params.append('update_mask', req.updateMask.toString());\n }\n if (req.allowMissing !== undefined) {\n params.append('allow_missing', String(req.allowMissing));\n }\n const query = params.toString();\n const fullUrl = query !== '' ? `${url}?${query}` : url;\n const body = marshalRequest(\n req.defaultWarehouseOverride,\n marshalDefaultWarehouseOverrideSchema\n );\n let resp: DefaultWarehouseOverride | 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(\n 'PATCH',\n fullUrl,\n headers,\n callSignal,\n body\n );\n const respBody = await executeHttpCall({\n request: httpReq,\n httpClient,\n logger: this.logger,\n });\n resp = parseResponse(respBody, unmarshalDefaultWarehouseOverrideSchema);\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\nexport class CreateWarehouseWaiter {\n constructor(\n private readonly client: WarehousesClient,\n readonly id: string\n ) {}\n\n /**\n * Polls until the operation reaches a terminal state.\n *\n * Throws if a failure state is reached.\n */\n async wait(options?: LroOptions): Promise<GetWarehouseResponse> {\n let result: GetWarehouseResponse | undefined;\n\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n callSignal !== undefined ? {signal: callSignal} : undefined\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n result = pollResp;\n return;\n case EndpointState.STOPPED:\n case EndpointState.DELETED: {\n const msg = pollResp.health?.summary ?? '(no message)';\n throw new Error(`terminal state ${status}: ${msg}`);\n }\n default:\n throw new StillRunningError();\n }\n };\n\n await executeWait(call, options);\n if (result === undefined) {\n throw new Error('operation completed without a result.');\n }\n return result;\n }\n\n /** Checks whether the operation has reached a terminal state. */\n async done(options?: CallOptions): Promise<boolean> {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n options\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n case EndpointState.STOPPED:\n case EndpointState.DELETED:\n return true;\n default:\n return false;\n }\n }\n}\n\nexport class EditWarehouseWaiter {\n constructor(\n private readonly client: WarehousesClient,\n readonly id: string\n ) {}\n\n /**\n * Polls until the operation reaches a terminal state.\n *\n * Throws if a failure state is reached.\n */\n async wait(options?: LroOptions): Promise<GetWarehouseResponse> {\n let result: GetWarehouseResponse | undefined;\n\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n callSignal !== undefined ? {signal: callSignal} : undefined\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n result = pollResp;\n return;\n case EndpointState.STOPPED:\n case EndpointState.DELETED: {\n const msg = pollResp.health?.summary ?? '(no message)';\n throw new Error(`terminal state ${status}: ${msg}`);\n }\n default:\n throw new StillRunningError();\n }\n };\n\n await executeWait(call, options);\n if (result === undefined) {\n throw new Error('operation completed without a result.');\n }\n return result;\n }\n\n /** Checks whether the operation has reached a terminal state. */\n async done(options?: CallOptions): Promise<boolean> {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n options\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n case EndpointState.STOPPED:\n case EndpointState.DELETED:\n return true;\n default:\n return false;\n }\n }\n}\n\nexport class StartWarehouseWaiter {\n constructor(\n private readonly client: WarehousesClient,\n readonly id: string\n ) {}\n\n /**\n * Polls until the operation reaches a terminal state.\n *\n * Throws if a failure state is reached.\n */\n async wait(options?: LroOptions): Promise<GetWarehouseResponse> {\n let result: GetWarehouseResponse | undefined;\n\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n callSignal !== undefined ? {signal: callSignal} : undefined\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n result = pollResp;\n return;\n case EndpointState.STOPPED:\n case EndpointState.DELETED: {\n const msg = pollResp.health?.summary ?? '(no message)';\n throw new Error(`terminal state ${status}: ${msg}`);\n }\n default:\n throw new StillRunningError();\n }\n };\n\n await executeWait(call, options);\n if (result === undefined) {\n throw new Error('operation completed without a result.');\n }\n return result;\n }\n\n /** Checks whether the operation has reached a terminal state. */\n async done(options?: CallOptions): Promise<boolean> {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n options\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.RUNNING:\n case EndpointState.STOPPED:\n case EndpointState.DELETED:\n return true;\n default:\n return false;\n }\n }\n}\n\nexport class StopWarehouseWaiter {\n constructor(\n private readonly client: WarehousesClient,\n readonly id: string\n ) {}\n\n /**\n * Polls until the operation reaches a terminal state.\n *\n * Throws if a failure state is reached.\n */\n async wait(options?: LroOptions): Promise<GetWarehouseResponse> {\n let result: GetWarehouseResponse | undefined;\n\n const call = async (callSignal?: AbortSignal): Promise<void> => {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n callSignal !== undefined ? {signal: callSignal} : undefined\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.STOPPED:\n result = pollResp;\n return;\n default:\n throw new StillRunningError();\n }\n };\n\n await executeWait(call, options);\n if (result === undefined) {\n throw new Error('operation completed without a result.');\n }\n return result;\n }\n\n /** Checks whether the operation has reached a terminal state. */\n async done(options?: CallOptions): Promise<boolean> {\n const pollResp = await this.client.getWarehouse(\n {\n id: this.id,\n },\n options\n );\n\n const status = pollResp.state;\n if (status === undefined) {\n throw new Error('response missing required status field');\n }\n\n switch (status) {\n case EndpointState.STOPPED:\n return true;\n default:\n return false;\n }\n }\n}\n"],"mappings":";;;;;;;;;AAwEA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,mBAAb,MAA8B;CAC5B,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;;;;;;CAOd,MAAM,+BACJ,KACA,SACmC;EACnC,MAAM,EAAC,MAAM,aAAa,eAAc,MAAM,KAAK,eAAe;EAClE,MAAM,MAAM,GAAG,KAAK;EACpB,MAAM,SAAS,IAAI,iBAAiB;AACpC,MAAI,IAAI,+BAA+B,OACrC,QAAO,OACL,iCACA,IAAI,2BACL;EAEH,MAAM,QAAQ,OAAO,UAAU;EAC/B,MAAM,UAAU,UAAU,KAAK,GAAG,IAAI,GAAG,UAAU;EACnD,MAAM,OAAO,eACX,IAAI,0BACJ,sCACD;EACD,IAAI;EACJ,MAAM,OAAO,OAAO,eAA4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YAAW,GAAG,OACnD;GAED,MAAM,SAAS,SAAS;AACxB,OAAI,WAAW,OACb,OAAM,IAAI,MAAM,yCAAyC;AAG3D,WAAQ,QAAR;IACE,KAAK,cAAc;AACjB,cAAS;AACT;IACF,QACE,OAAM,IAAI,mBAAmB;;;AAInC,QAAM,YAAY,MAAM,QAAQ;AAChC,MAAI,WAAW,OACb,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO;;;CAIT,MAAM,KAAK,SAAyC;EAQlD,MAAM,UAPW,MAAM,KAAK,OAAO,aACjC,EACE,IAAI,KAAK,IACV,EACD,QACD,EAEuB;AACxB,MAAI,WAAW,OACb,OAAM,IAAI,MAAM,yCAAyC;AAG3D,UAAQ,QAAR;GACE,KAAK,cAAc,QACjB,QAAO;GACT,QACE,QAAO"}
@@ -1,3 +1,4 @@
1
+ import { ClientInfo } from "@databricks/sdk-core/clientinfo";
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,SAAS;EAAC,GAAG;EAAS;EAAK,EAAC,CAAC,EAIxE,WACD;AACD,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;;;;;;AAOpC,IAAM,iBAAN,MAA2C;CACzC,YACE,AAAiB,MACjB,AAAiB,aACjB,AAAiB,YACjB;EAHiB;EACA;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;EAI7B,MAAM,OAAO,KAAK,WAAW,KAAK;GAChC,KAAK;GACL,OAAO,KAAK,YAAY,MAAM;GAC/B,CAAC;AACF,UAAQ,IAAI,cAAc,KAAK,UAAU,CAAC;AAC1C,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databricks/sdk-warehouses",
3
- "version": "0.54.3",
3
+ "version": "0.54.4",
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"