@databricks/appkit-ui 0.88.1 → 0.89.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.
Files changed (136) hide show
  1. package/CLAUDE.md +7 -2
  2. package/dist/cli/commands/doctor/checks-existence.js +16 -16
  3. package/dist/cli/commands/doctor/checks-existence.js.map +1 -1
  4. package/dist/cli/commands/doctor/checks.js +15 -18
  5. package/dist/cli/commands/doctor/checks.js.map +1 -1
  6. package/dist/cli/commands/doctor/databricks-client.js +8 -6
  7. package/dist/cli/commands/doctor/databricks-client.js.map +1 -1
  8. package/dist/cli/commands/registry/workspace-picker.js +34 -24
  9. package/dist/cli/commands/registry/workspace-picker.js.map +1 -1
  10. package/dist/react/genie/genie-chart-inference.js.map +1 -1
  11. package/dist/react/genie/genie-query-transform.d.ts +5 -2
  12. package/dist/react/genie/genie-query-transform.d.ts.map +1 -1
  13. package/dist/react/genie/genie-query-transform.js +14 -8
  14. package/dist/react/genie/genie-query-transform.js.map +1 -1
  15. package/dist/shared/src/genie.d.ts +9 -3
  16. package/dist/shared/src/genie.d.ts.map +1 -1
  17. package/dist/shared/src/workspace-client/factory.d.ts +0 -1
  18. package/dist/shared/src/workspace-client/index.d.ts +1 -2
  19. package/dist/shared/src/workspace-client/modular.d.ts +19 -0
  20. package/dist/shared/src/workspace-client/types.d.ts +1 -2
  21. package/dist/workspace-client/client.js +81 -23
  22. package/dist/workspace-client/client.js.map +1 -1
  23. package/dist/workspace-client/errors.d.ts +14 -2
  24. package/dist/workspace-client/errors.d.ts.map +1 -0
  25. package/dist/workspace-client/errors.js +45 -2
  26. package/dist/workspace-client/errors.js.map +1 -0
  27. package/dist/workspace-client/factory.d.ts +1 -1
  28. package/dist/workspace-client/factory.js.map +1 -1
  29. package/dist/workspace-client/index.d.ts +4 -3
  30. package/dist/workspace-client/index.js +2 -2
  31. package/dist/workspace-client/modular.d.ts +109 -0
  32. package/dist/workspace-client/modular.d.ts.map +1 -0
  33. package/dist/workspace-client/modular.js +447 -0
  34. package/dist/workspace-client/modular.js.map +1 -0
  35. package/dist/workspace-client/options.d.ts +29 -0
  36. package/dist/workspace-client/options.d.ts.map +1 -0
  37. package/dist/workspace-client/types.d.ts +35 -38
  38. package/dist/workspace-client/types.d.ts.map +1 -1
  39. package/docs/api/appkit/Class.ApiError.md +110 -0
  40. package/docs/api/appkit/Class.DatabricksAdapter.md +2 -2
  41. package/docs/api/appkit/Class.SupervisorApiAdapter.md +1 -1
  42. package/docs/api/appkit/Function.generateDatabaseCredential.md +2 -2
  43. package/docs/api/appkit/Function.getWorkspaceClient.md +2 -2
  44. package/docs/api/appkit/Interface.DirectoryEntry.md +62 -0
  45. package/docs/api/appkit/Interface.DownloadResponse.md +45 -0
  46. package/docs/api/appkit/Interface.JobAPI.md +20 -12
  47. package/docs/api/appkit/Interface.LakebasePoolConfig.md +1 -1
  48. package/docs/api/appkit/Interface.WorkspaceClient.md +168 -26
  49. package/docs/api/appkit/Interface.WorkspaceClientOptions.md +1 -14
  50. package/docs/api/appkit/TypeAlias.FilesDirectoryEntry.md +8 -0
  51. package/docs/api/appkit/TypeAlias.FilesDownloadResponse.md +8 -0
  52. package/docs/api/appkit/TypeAlias.JobsExport.md +1 -1
  53. package/docs/api/appkit/TypeAlias.WorkspaceClientLike.md +16 -0
  54. package/docs/api/appkit.md +7 -2
  55. package/docs/plugins/files.md +20 -3
  56. package/docs/plugins/jobs.md +9 -9
  57. package/docs/plugins/testing.md +10 -8
  58. package/llms.txt +7 -2
  59. package/node_modules/@databricks/sdk-genie/LICENSE +203 -0
  60. package/node_modules/@databricks/sdk-genie/README.md +23 -0
  61. package/node_modules/@databricks/sdk-genie/dist/package.js +7 -0
  62. package/node_modules/@databricks/sdk-genie/dist/package.js.map +1 -0
  63. package/node_modules/@databricks/sdk-genie/dist/v1/client.d.ts +175 -0
  64. package/node_modules/@databricks/sdk-genie/dist/v1/client.d.ts.map +1 -0
  65. package/node_modules/@databricks/sdk-genie/dist/v1/client.js +829 -0
  66. package/node_modules/@databricks/sdk-genie/dist/v1/client.js.map +1 -0
  67. package/node_modules/@databricks/sdk-genie/dist/v1/index.d.ts +3 -0
  68. package/node_modules/@databricks/sdk-genie/dist/v1/index.js +4 -0
  69. package/node_modules/@databricks/sdk-genie/dist/v1/model.d.ts +1799 -0
  70. package/node_modules/@databricks/sdk-genie/dist/v1/model.d.ts.map +1 -0
  71. package/node_modules/@databricks/sdk-genie/dist/v1/model.js +1097 -0
  72. package/node_modules/@databricks/sdk-genie/dist/v1/model.js.map +1 -0
  73. package/node_modules/@databricks/sdk-genie/dist/v1/transport.d.ts +37 -0
  74. package/node_modules/@databricks/sdk-genie/dist/v1/transport.d.ts.map +1 -0
  75. package/node_modules/@databricks/sdk-genie/dist/v1/transport.js +73 -0
  76. package/node_modules/@databricks/sdk-genie/dist/v1/transport.js.map +1 -0
  77. package/node_modules/@databricks/sdk-genie/dist/v1/utils.d.ts +43 -0
  78. package/node_modules/@databricks/sdk-genie/dist/v1/utils.d.ts.map +1 -0
  79. package/node_modules/@databricks/sdk-genie/dist/v1/utils.js +130 -0
  80. package/node_modules/@databricks/sdk-genie/dist/v1/utils.js.map +1 -0
  81. package/node_modules/@databricks/sdk-genie/package.json +46 -0
  82. package/node_modules/@databricks/sdk-statementexecution/LICENSE +203 -0
  83. package/node_modules/@databricks/sdk-statementexecution/README.md +23 -0
  84. package/node_modules/@databricks/sdk-statementexecution/dist/package.js +7 -0
  85. package/node_modules/@databricks/sdk-statementexecution/dist/package.js.map +1 -0
  86. package/node_modules/@databricks/sdk-statementexecution/dist/v1/client.d.ts +91 -0
  87. package/node_modules/@databricks/sdk-statementexecution/dist/v1/client.d.ts.map +1 -0
  88. package/node_modules/@databricks/sdk-statementexecution/dist/v1/client.js +183 -0
  89. package/node_modules/@databricks/sdk-statementexecution/dist/v1/client.js.map +1 -0
  90. package/node_modules/@databricks/sdk-statementexecution/dist/v1/index.d.ts +3 -0
  91. package/node_modules/@databricks/sdk-statementexecution/dist/v1/index.js +4 -0
  92. package/node_modules/@databricks/sdk-statementexecution/dist/v1/model.d.ts +506 -0
  93. package/node_modules/@databricks/sdk-statementexecution/dist/v1/model.d.ts.map +1 -0
  94. package/node_modules/@databricks/sdk-statementexecution/dist/v1/model.js +302 -0
  95. package/node_modules/@databricks/sdk-statementexecution/dist/v1/model.js.map +1 -0
  96. package/node_modules/@databricks/sdk-statementexecution/dist/v1/transport.d.ts +37 -0
  97. package/node_modules/@databricks/sdk-statementexecution/dist/v1/transport.d.ts.map +1 -0
  98. package/node_modules/@databricks/sdk-statementexecution/dist/v1/transport.js +73 -0
  99. package/node_modules/@databricks/sdk-statementexecution/dist/v1/transport.js.map +1 -0
  100. package/node_modules/@databricks/sdk-statementexecution/dist/v1/utils.d.ts +25 -0
  101. package/node_modules/@databricks/sdk-statementexecution/dist/v1/utils.d.ts.map +1 -0
  102. package/node_modules/@databricks/sdk-statementexecution/dist/v1/utils.js +87 -0
  103. package/node_modules/@databricks/sdk-statementexecution/dist/v1/utils.js.map +1 -0
  104. package/node_modules/@databricks/sdk-statementexecution/package.json +46 -0
  105. package/node_modules/@databricks/sdk-vectorsearch/LICENSE +203 -0
  106. package/node_modules/@databricks/sdk-vectorsearch/README.md +23 -0
  107. package/node_modules/@databricks/sdk-vectorsearch/dist/package.js +7 -0
  108. package/node_modules/@databricks/sdk-vectorsearch/dist/package.js.map +1 -0
  109. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/client.d.ts +70 -0
  110. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/client.d.ts.map +1 -0
  111. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/client.js +474 -0
  112. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/client.js.map +1 -0
  113. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/index.d.ts +3 -0
  114. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/index.js +4 -0
  115. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/model.d.ts +704 -0
  116. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/model.d.ts.map +1 -0
  117. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/model.js +635 -0
  118. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/model.js.map +1 -0
  119. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/transport.d.ts +37 -0
  120. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/transport.d.ts.map +1 -0
  121. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/transport.js +73 -0
  122. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/transport.js.map +1 -0
  123. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/utils.d.ts +37 -0
  124. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/utils.d.ts.map +1 -0
  125. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/utils.js +104 -0
  126. package/node_modules/@databricks/sdk-vectorsearch/dist/v1/utils.js.map +1 -0
  127. package/node_modules/@databricks/sdk-vectorsearch/package.json +46 -0
  128. package/package.json +29 -4
  129. package/sbom.cdx.json +1 -1
  130. package/dist/shared/src/workspace-client/errors.d.ts +0 -1
  131. package/dist/shared/src/workspace-client/legacy.d.ts +0 -3
  132. package/dist/workspace-client/legacy.d.ts +0 -34
  133. package/dist/workspace-client/legacy.d.ts.map +0 -1
  134. package/dist/workspace-client/legacy.js +0 -23
  135. package/dist/workspace-client/legacy.js.map +0 -1
  136. package/docs/api/appkit/Interface.WorkspaceClientLike.md +0 -67
@@ -0,0 +1,109 @@
1
+ import { WorkspaceClientOptions } from "./options.js";
2
+ import { ApiError as ModularApiError } from "@databricks/sdk-core/apierror";
3
+ import { HttpRequest } from "@databricks/sdk-core/http";
4
+ import { resolve as resolveProfile } from "@databricks/sdk-core/profiles";
5
+ import { ScimClient, ScimClient as ScimClient$1 } from "@databricks/sdk-scim/v1";
6
+ import { ColumnInfo, Disposition, ExecuteStatementRequest, ExternalLink, Format, ResultData, ResultManifest, Schema, ServiceError, StatementExecutionClient, StatementExecutionClient as StatementExecutionClient$1, StatementParameter, StatementResponse, StatementStatus, StatementStatus_State } from "@databricks/sdk-statementexecution/v1";
7
+ import { EndpointHealth, EndpointInfo, EndpointState, GetWarehouseResponse, WarehousesClient, WarehousesClient as WarehousesClient$1 } from "@databricks/sdk-warehouses/v1";
8
+ import { App, AppsClient, AppsClient as AppsClient$1, ListAppsRequest, ListAppsResponse } from "@databricks/sdk-apps/v1";
9
+ import { DatabaseClient, DatabaseClient as DatabaseClient$1, DatabaseCredential, DatabaseInstance, GenerateDatabaseCredentialRequest, ListDatabaseInstancesRequest, ListDatabaseInstancesResponse } from "@databricks/sdk-database/v1";
10
+ import { Experiment, ExperimentsClient, ExperimentsClient as ExperimentsClient$1, ListExperimentsRequest, ListExperimentsResponse } from "@databricks/sdk-experiments/v1";
11
+ import { DirectoryEntry as FilesDirectoryEntry, DownloadFileResponse as FilesDownloadResponse, FilesClient, FilesClient as FilesClient$1 } from "@databricks/sdk-files/v2";
12
+ import { GenieClient, GenieClient as GenieClient$1, GenieGetMessageQueryResultResponse, GenieMessage } from "@databricks/sdk-genie/v1";
13
+ import { BaseRun, CancelRunRequest, GetJobRequest, GetJobResponse, GetRunOutputRequest, GetRunOutputResponse, GetRunRequest, GetRunResponse, JobsClient, JobsClient as JobsClient$1, ListRunsRequest, RunNowRequest, RunNowResponse, SubmitRunRequest, SubmitRunResponse } from "@databricks/sdk-jobs/v2";
14
+ import { GetInferenceEndpointRequest, InferenceEndpoint, InferenceEndpointDetailed, ListInferenceEndpointsRequest, ListInferenceEndpointsResponse, ModelServingClient, ModelServingClient as ModelServingClient$1 } from "@databricks/sdk-modelserving/v1";
15
+ import { PostgresClient, PostgresClient as PostgresClient$1 } from "@databricks/sdk-postgres/v1";
16
+ import { ConnectionInfo, ConnectionsClient, ConnectionsClient as ConnectionsClient$1, GetConnectionRequest, ListConnectionsRequest, ListConnectionsResponse } from "@databricks/sdk-uc-connections/v1";
17
+ import { FunctionInfo, FunctionsClient, FunctionsClient as FunctionsClient$1, GetFunctionRequest } from "@databricks/sdk-uc-functions/v1";
18
+ import { TablesClient, TablesClient as TablesClient$1 } from "@databricks/sdk-uc-tables/v1";
19
+ import { GetVolumeRequest, VolumeInfo, VolumesClient, VolumesClient as VolumesClient$1 } from "@databricks/sdk-uc-volumes/v1";
20
+ import { QueryVectorIndexRequest, QueryVectorIndexResponse, VectorSearchClient, VectorSearchClient as VectorSearchClient$1 } from "@databricks/sdk-vectorsearch/v1";
21
+
22
+ //#region src/workspace-client/modular.d.ts
23
+ /** Auth could not be configured (missing or unsupported credentials). */
24
+ declare class AuthConfigError extends Error {
25
+ name: string;
26
+ }
27
+ /** Whether `e` means auth isn't set up, from AppKit or the modular SDK. */
28
+ declare function isAuthConfigError(e: unknown): e is Error;
29
+ /** A raw REST call against the workspace host. */
30
+ interface WorkspaceRequest {
31
+ method: string;
32
+ /** Path on the workspace host, e.g. `/api/2.0/preview/scim/v2/Me`. */
33
+ path: string;
34
+ query?: Record<string, string>;
35
+ headers?: Headers;
36
+ body?: HttpRequest["body"];
37
+ signal?: AbortSignal;
38
+ }
39
+ /** Host, auth headers, and raw requests resolved exactly like the modular clients. */
40
+ interface WorkspaceAuth {
41
+ /** Scheme-normalized workspace host, without a trailing slash. */
42
+ getHost(): Promise<string>;
43
+ /** Set the auth header(s) (e.g. `Authorization`) on `headers`. */
44
+ authenticate(headers: Headers): Promise<void>;
45
+ /**
46
+ * Send a request through the modular transport (AppKit User-Agent + auth).
47
+ * Returns the raw `Response` (body unread, so it can stream); throws
48
+ * {@link ApiError} on a non-2xx status.
49
+ */
50
+ request(req: WorkspaceRequest): Promise<Response>;
51
+ }
52
+ /**
53
+ * Build host/credential resolution from {@link mapToClientOptions}, mirroring
54
+ * the modular SDK's `resolveClientConfig` (sdk-warehouses `dist/v1/transport.js`):
55
+ * resolve the profile from config file + env, explicit options win, and fall
56
+ * back to `defaultCredentials` over the resolved profile. Resolved once, lazily;
57
+ * a failed resolution is retried on the next call.
58
+ */
59
+ declare function buildWorkspaceAuth(opts: WorkspaceClientOptions): WorkspaceAuth;
60
+ /** Build a modular Warehouses client from wrapper options. */
61
+ declare function buildWarehousesClient(opts: WorkspaceClientOptions): WarehousesClient;
62
+ /** Build a modular Statement Execution client from wrapper options. */
63
+ declare function buildStatementExecutionClient(opts: WorkspaceClientOptions): StatementExecutionClient;
64
+ /**
65
+ * Build a modular SCIM client from wrapper options. Backs the facade's
66
+ * `currentUser` accessor: legacy `currentUser.me()` is `ScimClient.me({})`.
67
+ */
68
+ declare function buildScimClient(opts: WorkspaceClientOptions): ScimClient;
69
+ /** Build a modular Apps client from wrapper options. */
70
+ declare function buildAppsClient(opts: WorkspaceClientOptions): AppsClient;
71
+ /** Build a modular Genie client from wrapper options. */
72
+ declare function buildGenieClient(opts: WorkspaceClientOptions): GenieClient;
73
+ /** Build a modular Jobs (API 2.2) client from wrapper options. */
74
+ declare function buildJobsClient(opts: WorkspaceClientOptions): JobsClient;
75
+ /**
76
+ * Build a modular Files client from wrapper options. `getFileMetadata` is not
77
+ * used: its generated HEAD call parses the (empty) body and drops the response
78
+ * headers that carry the metadata, so the connector issues that HEAD through
79
+ * {@link WorkspaceAuth.request} instead.
80
+ */
81
+ declare function buildFilesClient(opts: WorkspaceClientOptions): FilesClient;
82
+ /**
83
+ * Build a modular Vector Search client from wrapper options. Query calls rely
84
+ * on the sdk-vectorsearch pnpm patch (`debugLevel` / `debugInfo`, `bigint` rows).
85
+ */
86
+ declare function buildVectorSearchClient(opts: WorkspaceClientOptions): VectorSearchClient;
87
+ /** Build a modular Model Serving (serving endpoints) client from wrapper options. */
88
+ declare function buildModelServingClient(opts: WorkspaceClientOptions): ModelServingClient;
89
+ /** Build a modular MLflow Experiments client from wrapper options. */
90
+ declare function buildExperimentsClient(opts: WorkspaceClientOptions): ExperimentsClient;
91
+ /** Build a modular Unity Catalog Tables client from wrapper options. */
92
+ declare function buildTablesClient(opts: WorkspaceClientOptions): TablesClient;
93
+ /** Build a modular Unity Catalog Volumes client from wrapper options. */
94
+ declare function buildVolumesClient(opts: WorkspaceClientOptions): VolumesClient;
95
+ /** Build a modular Unity Catalog Functions client from wrapper options. */
96
+ declare function buildFunctionsClient(opts: WorkspaceClientOptions): FunctionsClient;
97
+ /** Build a modular Unity Catalog Connections client from wrapper options. */
98
+ declare function buildConnectionsClient(opts: WorkspaceClientOptions): ConnectionsClient;
99
+ /** Build a modular Lakebase (provisioned) Database client from wrapper options. */
100
+ declare function buildDatabaseClient(opts: WorkspaceClientOptions): DatabaseClient;
101
+ /**
102
+ * Build a modular Lakebase Postgres (autoscaling: projects, branches,
103
+ * endpoints) client from wrapper options. Distinct from the provisioned
104
+ * `/api/2.0/database` instance API.
105
+ */
106
+ declare function buildPostgresClient(opts: WorkspaceClientOptions): PostgresClient;
107
+ //#endregion
108
+ export { type App, type AppsClient$1 as AppsClient, AuthConfigError, type BaseRun, type CancelRunRequest, type ColumnInfo, type ConnectionInfo, type ConnectionsClient$1 as ConnectionsClient, type DatabaseClient$1 as DatabaseClient, type DatabaseCredential, type DatabaseInstance, type Disposition, type EndpointHealth, type EndpointInfo, type EndpointState, type ExecuteStatementRequest, type Experiment, type ExperimentsClient$1 as ExperimentsClient, type ExternalLink, type FilesClient$1 as FilesClient, type FilesDirectoryEntry, type FilesDownloadResponse, type Format, type FunctionInfo, type FunctionsClient$1 as FunctionsClient, type GenerateDatabaseCredentialRequest, type GenieClient$1 as GenieClient, type GenieGetMessageQueryResultResponse, type GenieMessage, type GetConnectionRequest, type GetFunctionRequest, type GetInferenceEndpointRequest, type GetJobRequest, type GetJobResponse, type GetRunOutputRequest, type GetRunOutputResponse, type GetRunRequest, type GetRunResponse, type GetVolumeRequest, type GetWarehouseResponse, type InferenceEndpoint, type InferenceEndpointDetailed, type JobsClient$1 as JobsClient, type ListAppsRequest, type ListAppsResponse, type ListConnectionsRequest, type ListConnectionsResponse, type ListDatabaseInstancesRequest, type ListDatabaseInstancesResponse, type ListExperimentsRequest, type ListExperimentsResponse, type ListInferenceEndpointsRequest, type ListInferenceEndpointsResponse, type ListRunsRequest, type ModelServingClient$1 as ModelServingClient, ModularApiError, type PostgresClient$1 as PostgresClient, type QueryVectorIndexRequest, type QueryVectorIndexResponse, type ResultData, type ResultManifest, type RunNowRequest, type RunNowResponse, type Schema, type ScimClient$1 as ScimClient, type ServiceError, type StatementExecutionClient$1 as StatementExecutionClient, type StatementParameter, type StatementResponse, type StatementStatus, type StatementStatus_State, type SubmitRunRequest, type SubmitRunResponse, type TablesClient$1 as TablesClient, type VectorSearchClient$1 as VectorSearchClient, type VolumeInfo, type VolumesClient$1 as VolumesClient, type WarehousesClient$1 as WarehousesClient, WorkspaceAuth, WorkspaceRequest, buildAppsClient, buildConnectionsClient, buildDatabaseClient, buildExperimentsClient, buildFilesClient, buildFunctionsClient, buildGenieClient, buildJobsClient, buildModelServingClient, buildPostgresClient, buildScimClient, buildStatementExecutionClient, buildTablesClient, buildVectorSearchClient, buildVolumesClient, buildWarehousesClient, buildWorkspaceAuth, isAuthConfigError, resolveProfile };
109
+ //# sourceMappingURL=modular.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modular.d.ts","names":[],"sources":["../../src/workspace-client/modular.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;cA6La,eAAA,SAAwB,KAAA;EAC1B,IAAA;AAAA;AADX;AAAA,iBAKgB,iBAAA,CAAkB,CAAA,YAAa,CAAA,IAAK,KAAA;;UAuNnC,gBAAA;EACf,MAAA;EAxNc;EA0Nd,IAAA;EACA,KAAA,GAAQ,MAAA;EACR,OAAA,GAAU,OAAA;EACV,IAAA,GAAO,WAAA;EACP,MAAA,GAAS,WAAA;AAAA;;UAIM,aAAA;EAXA;EAaf,OAAA,IAAW,OAAA;;EAEX,YAAA,CAAa,OAAA,EAAS,OAAA,GAAU,OAAA;EAVtB;;;;;EAgBV,OAAA,CAAQ,GAAA,EAAK,gBAAA,GAAmB,OAAA,CAAQ,QAAA;AAAA;;;;;;;;iBAU1B,kBAAA,CACd,IAAA,EAAM,sBAAA,GACL,aAAA;;iBAsGa,qBAAA,CACd,IAAA,EAAM,sBAAA,GACL,gBAAA;AA9HH;AAAA,iBAmIgB,6BAAA,CACd,IAAA,EAAM,sBAAA,GACL,wBAAA;;;;;iBAYa,eAAA,CAAgB,IAAA,EAAM,sBAAA,GAAyB,UAAA;;iBAK/C,eAAA,CAAgB,IAAA,EAAM,sBAAA,GAAyB,UAAA;;iBAsC/C,gBAAA,CAAiB,IAAA,EAAM,sBAAA,GAAyB,WAAA;;iBAQhD,eAAA,CAAgB,IAAA,EAAM,sBAAA,GAAyB,UAAA;;;;;;;iBAa/C,gBAAA,CAAiB,IAAA,EAAM,sBAAA,GAAyB,WAAA;;;;AA7LhE;iBAwMgB,uBAAA,CACd,IAAA,EAAM,sBAAA,GACL,kBAAA;;iBAWa,uBAAA,CACd,IAAA,EAAM,sBAAA,GACL,kBAAA;;iBAWa,sBAAA,CACd,IAAA,EAAM,sBAAA,GACL,iBAAA;;iBASa,iBAAA,CAAkB,IAAA,EAAM,sBAAA,GAAyB,YAAA;;iBAQjD,kBAAA,CACd,IAAA,EAAM,sBAAA,GACL,aAAA;;iBAQa,oBAAA,CACd,IAAA,EAAM,sBAAA,GACL,eAAA;;iBASa,sBAAA,CACd,IAAA,EAAM,sBAAA,GACL,iBAAA;;iBAWa,mBAAA,CACd,IAAA,EAAM,sBAAA,GACL,cAAA;;;;;;iBAkBa,mBAAA,CACd,IAAA,EAAM,sBAAA,GACL,cAAA"}
@@ -0,0 +1,447 @@
1
+ import { ApiError as ApiError$1 } from "./errors.js";
2
+ import { execFile } from "node:child_process";
3
+ import { promisify } from "node:util";
4
+ import { ApiError as ModularApiError } from "@databricks/sdk-core/apierror";
5
+ import { STATUS_CODES } from "node:http";
6
+ import { newTokenCredentials, tokenProviderFn } from "@databricks/sdk-auth";
7
+ import { DefaultCredentialsError, M2mCredentialsError, PatCredentialsError, U2mCredentialsError, defaultCredentials, newM2mCredentials, newPatCredentials, newU2mCredentials } from "@databricks/sdk-auth/credentials";
8
+ import { newFetchHttpClient } from "@databricks/sdk-core/http";
9
+ import { resolve, resolve as resolveProfile } from "@databricks/sdk-core/profiles";
10
+ import { ScimClient } from "@databricks/sdk-scim/v1";
11
+ import { StatementExecutionClient } from "@databricks/sdk-statementexecution/v1";
12
+ import { WarehousesClient } from "@databricks/sdk-warehouses/v1";
13
+
14
+ //#region src/workspace-client/modular.ts
15
+ /**
16
+ * The single module allowed to import the modular `@databricks/sdk-*` SDK
17
+ * directly — the new-SDK sibling of {@link ./legacy.ts}. Every other AppKit
18
+ * module reaches these clients through the {@link WorkspaceClient} facade and
19
+ * the type re-exports below, so the modular SDK stays isolated exactly like the
20
+ * legacy one (the oxlint `no-restricted-imports` boundary walls `@databricks/sdk-*`
21
+ * off everywhere outside `packages/shared/src/workspace-client/`).
22
+ *
23
+ * Migrated services are built here as per-service clients; the facade delegates
24
+ * their accessors to these instead of the legacy monolithic client. Currently
25
+ * `warehouses`, `statementExecution`, `currentUser` (SCIM), `genie`, `jobs`,
26
+ * `files`, `vectorSearch`, `tables`, `modelServing`, `volumes`, `functions`,
27
+ * `connections`, `database`, `postgres`, `experiments` and `apps` are
28
+ * migrated, plus the auth + raw-request seam ({@link buildWorkspaceAuth}).
29
+ * Only `servingEndpoints`, `config` and `apiClient` still route through
30
+ * `legacy.ts`.
31
+ *
32
+ * NOTE: statementExecution relies on a pinned pnpm patch
33
+ * (`patches/@databricks__sdk-statementexecution@0.52.0.patch`) that restores the
34
+ * undocumented Reyden `attachment` response field, which the SDK's generated
35
+ * unmarshal transform would otherwise strip.
36
+ *
37
+ * NOTE: vectorSearch relies on a pinned pnpm patch
38
+ * (`patches/@databricks__sdk-vectorsearch@0.51.0.patch`): it adds the
39
+ * undocumented query `debug_level` request / `debug_info` response fields (the
40
+ * source of ai-search `queryTimeMs`), and lets row values be `bigint`, since the
41
+ * SDK parses with json-bigint and the unpatched schema rejects ints over 2^53.
42
+ *
43
+ * NOTE: genie relies on a pinned pnpm patch
44
+ * (`patches/@databricks__sdk-genie@0.54.0.patch`): the generated model types the
45
+ * query result's `data_array` as protobuf `ListValue[]` (`{ values: [...] }`), but
46
+ * the API returns plain `JSON_ARRAY` rows (`[["a", null], ...]`), so the unmarshal
47
+ * schema rejected every real query result. The patch restores `(string | null)[][]`.
48
+ */
49
+ /**
50
+ * Prepend `https://` to a scheme-less host. The legacy SDK normalized the host
51
+ * this way; the modular SDK does NOT — it passes the host straight into `fetch`,
52
+ * so a bare `DATABRICKS_HOST=my-workspace.cloud.databricks.com` (the common form,
53
+ * and what the Databricks Apps runtime sets) yields `TypeError: Invalid URL`.
54
+ */
55
+ function normalizeHost(host) {
56
+ const trimmed = host?.trim();
57
+ if (!trimmed) return void 0;
58
+ return /^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
59
+ }
60
+ const TOKEN_REFRESH_MARGIN_MS = 4e4;
61
+ /**
62
+ * Cache a token until shortly before it expires. The modular `newM2mCredentials`
63
+ * caches only the token endpoint and mints a fresh OAuth token on EVERY request;
64
+ * the legacy SDK reused it until expiry. Concurrent callers share one in-flight
65
+ * fetch. Like the legacy SDK, a token without an expiry is reused indefinitely.
66
+ */
67
+ function withTokenCache(credentials) {
68
+ let current;
69
+ let inflight;
70
+ const isFresh = (t) => t.expiry === void 0 || t.expiry.getTime() - TOKEN_REFRESH_MARGIN_MS > Date.now();
71
+ return newTokenCredentials(credentials.name(), tokenProviderFn(async () => {
72
+ if (current && isFresh(current)) return current;
73
+ inflight ??= credentials.token().then((t) => current = t).finally(() => {
74
+ inflight = void 0;
75
+ });
76
+ return inflight;
77
+ }));
78
+ }
79
+ /**
80
+ * The SDK default chain (profile / `~/.databrickscfg`), with the token cache the
81
+ * chain lacks: its CLI strategy shells out to `databricks auth token` and its
82
+ * M2M strategy mints a new OAuth token on EVERY request. `DefaultCredentials`
83
+ * hides the token behind `authHeaders()`, so mirror its strategy order (PAT →
84
+ * M2M → CLI) to get a cacheable `TokenCredentials`. A profile `authType` naming
85
+ * one of these (`databricks auth login` writes `databricks-cli`) pins that
86
+ * strategy; other auth types and `groupId` keep the SDK's own (uncached) logic.
87
+ * TODO: drop once sdk-auth caches tokens in its M2M and CLI credentials.
88
+ */
89
+ function cachedDefaultCredentials(profileOptions) {
90
+ const select = async () => {
91
+ const profile = await resolve(profileOptions);
92
+ const host = normalizeHost(profile.host)?.replace(/\/+$/, "");
93
+ const { name, token, clientId, clientSecret, authType } = profile;
94
+ const allows = (strategy) => !authType || authType === strategy;
95
+ if (host && !profile.groupId) {
96
+ if (token && allows("pat")) return newPatCredentials(token.value);
97
+ if (clientId && clientSecret && allows("oauth-m2m")) return withTokenCache(newM2mCredentials({
98
+ host,
99
+ clientId,
100
+ clientSecret: clientSecret.value,
101
+ ...profile.accountId !== void 0 && { accountId: profile.accountId }
102
+ }));
103
+ if (name && allows("databricks-cli")) return withTokenCache(newU2mCredentials({
104
+ profile: name,
105
+ ...profile.databricksCliPath !== void 0 && { cliPath: profile.databricksCliPath }
106
+ }));
107
+ }
108
+ return defaultCredentials({ profile: {
109
+ ...profile,
110
+ ...host && { host }
111
+ } });
112
+ };
113
+ let selected;
114
+ return {
115
+ name: () => "default",
116
+ async authHeaders() {
117
+ selected ??= select().catch((e) => {
118
+ selected = void 0;
119
+ throw e;
120
+ });
121
+ return (await selected).authHeaders();
122
+ }
123
+ };
124
+ }
125
+ const execFileAsync = promisify(execFile);
126
+ /** Auth could not be configured (missing or unsupported credentials). */
127
+ var AuthConfigError = class extends Error {
128
+ name = "AuthConfigError";
129
+ };
130
+ /** Whether `e` means auth isn't set up, from AppKit or the modular SDK. */
131
+ function isAuthConfigError(e) {
132
+ return e instanceof AuthConfigError || e instanceof DefaultCredentialsError || e instanceof M2mCredentialsError || e instanceof PatCredentialsError || e instanceof U2mCredentialsError;
133
+ }
134
+ /**
135
+ * Databricks CLI auth for a host, not a profile: what the legacy SDK used when
136
+ * only a host was configured. The modular CLI strategy needs a profile name.
137
+ */
138
+ function cliHostCredentials(host) {
139
+ return withTokenCache(newTokenCredentials("databricks-cli", tokenProviderFn(async () => {
140
+ let stdout;
141
+ try {
142
+ ({stdout} = await execFileAsync("databricks", [
143
+ "auth",
144
+ "token",
145
+ "--host",
146
+ host
147
+ ]));
148
+ } catch (e) {
149
+ const err = e;
150
+ throw new AuthConfigError(`cannot get an access token for ${host} from the Databricks CLI: ${String(err.stderr ?? err.message ?? e).trim()}`);
151
+ }
152
+ const parsed = JSON.parse(stdout);
153
+ return {
154
+ value: parsed.access_token,
155
+ ...parsed.expiry && { expiry: new Date(parsed.expiry) }
156
+ };
157
+ })));
158
+ }
159
+ /** Credentials that fail on use with `message`, so boot surfaces it clearly. */
160
+ function unsupportedCredentials(message) {
161
+ return {
162
+ name: () => "unsupported",
163
+ authHeaders: async () => {
164
+ throw new AuthConfigError(message);
165
+ }
166
+ };
167
+ }
168
+ /**
169
+ * Map wrapper options onto the modular SDK's `ClientOptions`, reproducing the
170
+ * legacy SDK's auth resolution: explicit token → PAT (the OBO path); profile →
171
+ * profile file; otherwise the service principal from the environment. It carries
172
+ * the privilege-escalation guard — check `token !== undefined` (NOT truthiness)
173
+ * so an explicitly-passed token, even an empty string, pins the PAT path and
174
+ * fails loudly at request time rather than silently falling through to the
175
+ * service-principal env credentials (which would be an OBO privilege escalation).
176
+ */
177
+ function mapToClientOptions(opts) {
178
+ const clientOptions = {};
179
+ const host = normalizeHost(opts.host ?? (opts.profile ? void 0 : process.env.DATABRICKS_HOST));
180
+ if (host) clientOptions.host = host;
181
+ if (opts.token !== void 0) clientOptions.credentials = newPatCredentials(opts.token);
182
+ else if (opts.profile) {
183
+ clientOptions.profileOptions = { profile: opts.profile };
184
+ clientOptions.credentials = cachedDefaultCredentials({ profile: opts.profile });
185
+ } else {
186
+ const clientId = process.env.DATABRICKS_CLIENT_ID;
187
+ const clientSecret = process.env.DATABRICKS_CLIENT_SECRET;
188
+ const envToken = process.env.DATABRICKS_TOKEN;
189
+ const authType = process.env.DATABRICKS_AUTH_TYPE?.trim() || void 0;
190
+ const allows = (strategy) => !authType || authType === strategy;
191
+ if (host && clientId && clientSecret && allows("oauth-m2m")) clientOptions.credentials = withTokenCache(newM2mCredentials({
192
+ host,
193
+ clientId,
194
+ clientSecret
195
+ }));
196
+ else if (envToken && allows("pat")) clientOptions.credentials = newPatCredentials(envToken);
197
+ else if (host && allows("databricks-cli")) clientOptions.credentials = cliHostCredentials(host);
198
+ else if (!host && !authType) clientOptions.credentials = cachedDefaultCredentials();
199
+ else clientOptions.credentials = unsupportedCredentials(`DATABRICKS_AUTH_TYPE=${authType ?? ""} cannot be satisfied: supported types are pat (DATABRICKS_TOKEN), oauth-m2m (DATABRICKS_CLIENT_ID/SECRET) and databricks-cli (\`databricks auth login\`).`);
200
+ }
201
+ clientOptions.httpClient = buildHttpClient(opts);
202
+ return clientOptions;
203
+ }
204
+ /**
205
+ * Wrap the SDK's default fetch transport to prepend AppKit's product segment
206
+ * (e.g. `databricks-appkit/0.88.1`) to the outgoing `User-Agent`, which
207
+ * Databricks-side dashboards match on.
208
+ *
209
+ * Why the transport and not the SDK's `setProduct`: that is process-global,
210
+ * while the header on the `httpClient` is per-client, and the wrapper ships
211
+ * inside appkit's bundled `dist`, so it also reaches deployed apps. The SDK's
212
+ * own client-info (`sdk-js-core/…`, runtime) is already on `request.headers`,
213
+ * so prepending keeps it intact after AppKit's segment.
214
+ *
215
+ * The wrapper also retries (see `sendWithRetry`). With no product configured
216
+ * (build-time callers) it adds no AppKit segment, like the legacy behavior.
217
+ */
218
+ function buildHttpClient(opts) {
219
+ const co = opts.clientOptions;
220
+ let appkitUserAgent;
221
+ if (co?.product && co?.productVersion) {
222
+ const segments = [`${co.product}/${co.productVersion}`];
223
+ if (co.userAgentExtra) for (const [key, value] of Object.entries(co.userAgentExtra)) segments.push(`${key}/${String(value)}`);
224
+ appkitUserAgent = segments.join(" ");
225
+ }
226
+ const base = newFetchHttpClient();
227
+ return { send(request) {
228
+ if (appkitUserAgent) {
229
+ const existing = request.headers.get("User-Agent");
230
+ request.headers.set("User-Agent", existing ? `${appkitUserAgent} ${existing}` : appkitUserAgent);
231
+ }
232
+ return sendWithRetry(base, request);
233
+ } };
234
+ }
235
+ const RETRY_TIMEOUT_MS = 3e5;
236
+ const TRANSIENT_ERROR_MESSAGES = [
237
+ "com.databricks.backend.manager.util.UnknownWorkerEnvironmentException",
238
+ "does not have any associated worker environments",
239
+ "There is no worker environment with id",
240
+ "Unknown worker environment",
241
+ "ClusterNotReadyException",
242
+ "connection reset by peer",
243
+ "TLS handshake timeout",
244
+ "connection refused",
245
+ "Unexpected error",
246
+ "i/o timeout"
247
+ ];
248
+ async function sendWithRetry(base, request) {
249
+ if (request.body instanceof ReadableStream) return base.send(request);
250
+ const deadline = Date.now() + RETRY_TIMEOUT_MS;
251
+ for (let attempt = 1;; attempt++) {
252
+ const response = await base.send(request);
253
+ if (response.statusCode < 400) return response;
254
+ const body = new Uint8Array(await new Response(response.body).arrayBuffer());
255
+ const text = new TextDecoder().decode(body);
256
+ const retryable = response.statusCode === 429 || TRANSIENT_ERROR_MESSAGES.some((m) => text.includes(m));
257
+ const waitMs = Math.min(attempt * 1e3 + 50 + Math.random() * 700, 1e4);
258
+ if (!retryable || request.signal?.aborted || Date.now() + waitMs > deadline) return {
259
+ ...response,
260
+ body: new Response(body).body
261
+ };
262
+ await new Promise((resolve) => setTimeout(resolve, waitMs));
263
+ }
264
+ }
265
+ /**
266
+ * Build host/credential resolution from {@link mapToClientOptions}, mirroring
267
+ * the modular SDK's `resolveClientConfig` (sdk-warehouses `dist/v1/transport.js`):
268
+ * resolve the profile from config file + env, explicit options win, and fall
269
+ * back to `defaultCredentials` over the resolved profile. Resolved once, lazily;
270
+ * a failed resolution is retried on the next call.
271
+ */
272
+ function buildWorkspaceAuth(opts) {
273
+ const options = mapToClientOptions(opts);
274
+ const transport = options.httpClient ?? newFetchHttpClient();
275
+ let resolved;
276
+ const resolveOnce = () => {
277
+ resolved ??= (async () => {
278
+ const profile = await resolve(options.profileOptions);
279
+ const host = normalizeHost(options.host ?? profile.host)?.replace(/\/+$/, "");
280
+ if (!host) throw new Error("Host is required.");
281
+ return {
282
+ host,
283
+ credentials: options.credentials ?? defaultCredentials({ profile: {
284
+ ...profile,
285
+ host
286
+ } })
287
+ };
288
+ })().catch((e) => {
289
+ resolved = void 0;
290
+ throw e;
291
+ });
292
+ return resolved;
293
+ };
294
+ const authenticate = async (headers) => {
295
+ const { credentials } = await resolveOnce();
296
+ for (const h of await credentials.authHeaders()) headers.set(h.key, h.value);
297
+ };
298
+ return {
299
+ getHost: async () => (await resolveOnce()).host,
300
+ authenticate,
301
+ async request(req) {
302
+ const url = new URL(req.path, (await resolveOnce()).host);
303
+ for (const [k, v] of Object.entries(req.query ?? {})) url.searchParams.set(k, v);
304
+ const headers = new Headers(req.headers);
305
+ await authenticate(headers);
306
+ const res = await transport.send({
307
+ url: url.toString(),
308
+ method: req.method,
309
+ headers,
310
+ body: req.body,
311
+ signal: req.signal
312
+ });
313
+ const nullBody = [
314
+ 204,
315
+ 205,
316
+ 304
317
+ ].includes(res.statusCode);
318
+ const response = new Response(nullBody ? null : res.body, {
319
+ status: res.statusCode,
320
+ statusText: STATUS_CODES[res.statusCode],
321
+ headers: res.headers
322
+ });
323
+ if (!response.ok) throw await toApiError(response);
324
+ return response;
325
+ }
326
+ };
327
+ }
328
+ /**
329
+ * Same error class the legacy `apiClient.request` threw, so existing catch
330
+ * sites (`instanceof ApiError`, `.statusCode`, `.errorCode`) keep working.
331
+ * Message + code follow the legacy `parseErrorFromResponse` so callers that
332
+ * surface `err.message` (e.g. the serving plugin's 502 body) are unchanged:
333
+ * a body without both `error_code` and `message` (plain text, HTML, or a
334
+ * model-specific error JSON) becomes `Response from server (<status text>) <body>`.
335
+ */
336
+ async function toApiError(response) {
337
+ const text = await response.text();
338
+ let json;
339
+ try {
340
+ json = JSON.parse(text);
341
+ } catch {}
342
+ if (json?.message && json.error_code) return new ApiError$1(json.error || json.message, json.error_code, response.status, json, json.details ?? []);
343
+ const html = text.match(/<pre>(.*)<\/pre>/) ?? text.match(/<title>(Error \d+.*?)<\/title>/);
344
+ return new ApiError$1(html ? html[1].trim().replace(/([\s.])*$/, "") : `Response from server (${response.statusText}) ${text}`, response.statusText || "UNKNOWN", response.status, json ?? text, []);
345
+ }
346
+ /** Build a modular Warehouses client from wrapper options. */
347
+ function buildWarehousesClient(opts) {
348
+ return new WarehousesClient(mapToClientOptions(opts));
349
+ }
350
+ /** Build a modular Statement Execution client from wrapper options. */
351
+ function buildStatementExecutionClient(opts) {
352
+ return new StatementExecutionClient(mapToClientOptions(opts));
353
+ }
354
+ /**
355
+ * Build a modular SCIM client from wrapper options. Backs the facade's
356
+ * `currentUser` accessor: legacy `currentUser.me()` is `ScimClient.me({})`.
357
+ */
358
+ function buildScimClient(opts) {
359
+ return new ScimClient(mapToClientOptions(opts));
360
+ }
361
+ /** Build a modular Apps client from wrapper options. */
362
+ function buildAppsClient(opts) {
363
+ return lazyClient(() => import("@databricks/sdk-apps/v1").then((m) => m.AppsClient), mapToClientOptions(opts));
364
+ }
365
+ /**
366
+ * Defer loading an SDK client's module until its first method call, so app
367
+ * boot doesn't pay for clients it never uses. Generated methods return either
368
+ * a Promise or (`*Iter`) an AsyncGenerator, so each proxied call returns the
369
+ * pending result as a Promise that is also async-iterable.
370
+ */
371
+ function lazyClient(load, options) {
372
+ let client;
373
+ return new Proxy({}, { get(_target, prop) {
374
+ if (typeof prop === "symbol" || prop === "then") return void 0;
375
+ return (...args) => {
376
+ client ??= load().then((Client) => new Client(options));
377
+ const result = client.then((c) => c[prop](...args));
378
+ return Object.assign(result, { async *[Symbol.asyncIterator]() {
379
+ yield* await result;
380
+ } });
381
+ };
382
+ } });
383
+ }
384
+ /** Build a modular Genie client from wrapper options. */
385
+ function buildGenieClient(opts) {
386
+ return lazyClient(() => import("@databricks/sdk-genie/v1").then((m) => m.GenieClient), mapToClientOptions(opts));
387
+ }
388
+ /** Build a modular Jobs (API 2.2) client from wrapper options. */
389
+ function buildJobsClient(opts) {
390
+ return lazyClient(() => import("@databricks/sdk-jobs/v2").then((m) => m.JobsClient), mapToClientOptions(opts));
391
+ }
392
+ /**
393
+ * Build a modular Files client from wrapper options. `getFileMetadata` is not
394
+ * used: its generated HEAD call parses the (empty) body and drops the response
395
+ * headers that carry the metadata, so the connector issues that HEAD through
396
+ * {@link WorkspaceAuth.request} instead.
397
+ */
398
+ function buildFilesClient(opts) {
399
+ return lazyClient(() => import("@databricks/sdk-files/v2").then((m) => m.FilesClient), mapToClientOptions(opts));
400
+ }
401
+ /**
402
+ * Build a modular Vector Search client from wrapper options. Query calls rely
403
+ * on the sdk-vectorsearch pnpm patch (`debugLevel` / `debugInfo`, `bigint` rows).
404
+ */
405
+ function buildVectorSearchClient(opts) {
406
+ return lazyClient(() => import("@databricks/sdk-vectorsearch/v1").then((m) => m.VectorSearchClient), mapToClientOptions(opts));
407
+ }
408
+ /** Build a modular Model Serving (serving endpoints) client from wrapper options. */
409
+ function buildModelServingClient(opts) {
410
+ return lazyClient(() => import("@databricks/sdk-modelserving/v1").then((m) => m.ModelServingClient), mapToClientOptions(opts));
411
+ }
412
+ /** Build a modular MLflow Experiments client from wrapper options. */
413
+ function buildExperimentsClient(opts) {
414
+ return lazyClient(() => import("@databricks/sdk-experiments/v1").then((m) => m.ExperimentsClient), mapToClientOptions(opts));
415
+ }
416
+ /** Build a modular Unity Catalog Tables client from wrapper options. */
417
+ function buildTablesClient(opts) {
418
+ return lazyClient(() => import("@databricks/sdk-uc-tables/v1").then((m) => m.TablesClient), mapToClientOptions(opts));
419
+ }
420
+ /** Build a modular Unity Catalog Volumes client from wrapper options. */
421
+ function buildVolumesClient(opts) {
422
+ return lazyClient(() => import("@databricks/sdk-uc-volumes/v1").then((m) => m.VolumesClient), mapToClientOptions(opts));
423
+ }
424
+ /** Build a modular Unity Catalog Functions client from wrapper options. */
425
+ function buildFunctionsClient(opts) {
426
+ return lazyClient(() => import("@databricks/sdk-uc-functions/v1").then((m) => m.FunctionsClient), mapToClientOptions(opts));
427
+ }
428
+ /** Build a modular Unity Catalog Connections client from wrapper options. */
429
+ function buildConnectionsClient(opts) {
430
+ return lazyClient(() => import("@databricks/sdk-uc-connections/v1").then((m) => m.ConnectionsClient), mapToClientOptions(opts));
431
+ }
432
+ /** Build a modular Lakebase (provisioned) Database client from wrapper options. */
433
+ function buildDatabaseClient(opts) {
434
+ return lazyClient(() => import("@databricks/sdk-database/v1").then((m) => m.DatabaseClient), mapToClientOptions(opts));
435
+ }
436
+ /**
437
+ * Build a modular Lakebase Postgres (autoscaling: projects, branches,
438
+ * endpoints) client from wrapper options. Distinct from the provisioned
439
+ * `/api/2.0/database` instance API.
440
+ */
441
+ function buildPostgresClient(opts) {
442
+ return lazyClient(() => import("@databricks/sdk-postgres/v1").then((m) => m.PostgresClient), mapToClientOptions(opts));
443
+ }
444
+
445
+ //#endregion
446
+ export { ModularApiError, buildAppsClient, buildConnectionsClient, buildDatabaseClient, buildExperimentsClient, buildFilesClient, buildFunctionsClient, buildGenieClient, buildJobsClient, buildModelServingClient, buildPostgresClient, buildScimClient, buildStatementExecutionClient, buildTablesClient, buildVectorSearchClient, buildVolumesClient, buildWarehousesClient, buildWorkspaceAuth, isAuthConfigError, resolveProfile };
447
+ //# sourceMappingURL=modular.js.map