@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,183 @@
1
+ import { resolveClientConfig } from "./transport.js";
2
+ import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse } from "./utils.js";
3
+ import { name, version } from "../package.js";
4
+ import { marshalCancelStatementRequestSchema, marshalExecuteStatementRequestSchema, unmarshalCancelStatementResponseSchema, unmarshalResultDataSchema, unmarshalStatementResponseSchema } from "./model.js";
5
+ import { VERSION } from "@databricks/sdk-auth";
6
+ import { createDefault } from "@databricks/sdk-core/clientinfo";
7
+ import { NoOpLogger } from "@databricks/sdk-core/logger";
8
+
9
+ //#region src/v1/client.ts
10
+ const PACKAGE_SEGMENT = {
11
+ key: "sdk-js-" + name.replace(/^@[^/]+\/sdk-/, ""),
12
+ value: version
13
+ };
14
+ var StatementExecutionClient = class {
15
+ options;
16
+ logger;
17
+ userAgent;
18
+ config;
19
+ constructor(options) {
20
+ this.options = options;
21
+ this.logger = options.logger ?? new NoOpLogger();
22
+ this.userAgent = createDefault().with(PACKAGE_SEGMENT).with({
23
+ key: "sdk-js-auth",
24
+ value: VERSION
25
+ }).with({
26
+ key: "auth",
27
+ value: options.credentials?.name() ?? "default"
28
+ }).toString();
29
+ }
30
+ resolveConfig() {
31
+ this.config ??= resolveClientConfig(this.options);
32
+ return this.config;
33
+ }
34
+ /**
35
+ * Requests that an executing statement be canceled. Callers must poll for status to see the
36
+ * terminal state. Cancel response is empty; receiving response indicates successful receipt.
37
+ */
38
+ async cancelStatement(req, options) {
39
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
40
+ const url = `${host}/api/2.0/sql/statements/${req.statementId ?? ""}/cancel`;
41
+ const body = marshalRequest(req, marshalCancelStatementRequestSchema);
42
+ let resp;
43
+ const call = async (callSignal) => {
44
+ const headers = new Headers({ "Content-Type": "application/json" });
45
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
46
+ headers.set("User-Agent", this.userAgent);
47
+ resp = parseResponse(await executeHttpCall({
48
+ request: buildHttpRequest("POST", url, headers, callSignal, body),
49
+ httpClient,
50
+ logger: this.logger
51
+ }), unmarshalCancelStatementResponseSchema);
52
+ };
53
+ await executeCall(call, options);
54
+ if (resp === void 0) throw new Error("operation completed without a result.");
55
+ return resp;
56
+ }
57
+ /**
58
+ * Execute a SQL statement and optionally await its results for a specified time.
59
+ *
60
+ * **Use case: small result sets with INLINE + JSON_ARRAY**
61
+ *
62
+ * For flows that generate small and predictable result sets (<= 25 MiB), `INLINE` responses of `JSON_ARRAY` result
63
+ * data are typically the simplest way to execute and fetch result data.
64
+ *
65
+ * **Use case: large result sets with EXTERNAL_LINKS**
66
+ *
67
+ * Using `EXTERNAL_LINKS` to fetch result data allows you to fetch large result sets efficiently.
68
+ * The main differences from using `INLINE` disposition are that the result data is accessed
69
+ * with short-lived cloud-storage URLs, and
70
+ * that there are 3 supported formats: `JSON_ARRAY`, `ARROW_STREAM` and `CSV` compared to only `JSON_ARRAY` with
71
+ * `INLINE`.
72
+ *
73
+ * **External-link URLs**
74
+ *
75
+ * External links point to data stored within your workspace's internal cloud storage. The URLs are valid for only a
76
+ * short period, <= 15 minutes. Alongside each `external_link` is an expiration field indicating the time at which the URL
77
+ * is no longer valid. In `EXTERNAL_LINKS` mode, chunks can be resolved and fetched multiple times and in parallel.
78
+ *
79
+ * ----
80
+ *
81
+ * ### **Warning: Databricks strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition.**
82
+ *
83
+ * When you use the `EXTERNAL_LINKS` disposition, a short-lived cloud-storage URL is generated to download the
84
+ * results. The URL contains temporary access credentials, so protect it and do not set an `Authorization` header in
85
+ * the download request.
86
+ *
87
+ *
88
+ *
89
+ *
90
+ *
91
+ * The `EXTERNAL_LINKS` disposition can be disabled upon request by creating a [support case](/resources/support.html).
92
+ *
93
+ * See also [Security best practices](/sql/admin/sql-execution-tutorial.html#security-best-practices).
94
+ *
95
+ * ----
96
+ *
97
+ * StatementResponse contains `statement_id` and `status`; other fields might be absent or present depending on
98
+ * context. If the SQL warehouse fails to execute the provided statement, a 200 response is returned with
99
+ * `status.state` set to `FAILED` (in contrast to a failure when accepting the request, which results in a non-200
100
+ * response). Details of the error can be found at `status.error` in case of execution failures.
101
+ */
102
+ async executeStatement(req, options) {
103
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
104
+ const url = `${host}/api/2.0/sql/statements`;
105
+ const body = marshalRequest(req, marshalExecuteStatementRequestSchema);
106
+ let resp;
107
+ const call = async (callSignal) => {
108
+ const headers = new Headers({ "Content-Type": "application/json" });
109
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
110
+ headers.set("User-Agent", this.userAgent);
111
+ resp = parseResponse(await executeHttpCall({
112
+ request: buildHttpRequest("POST", url, headers, callSignal, body),
113
+ httpClient,
114
+ logger: this.logger
115
+ }), unmarshalStatementResponseSchema);
116
+ };
117
+ await executeCall(call, options);
118
+ if (resp === void 0) throw new Error("operation completed without a result.");
119
+ return resp;
120
+ }
121
+ /**
122
+ * After the statement execution has `SUCCEEDED`, this request can be used to fetch any chunk by
123
+ * index. Whereas the first chunk with `chunk_index=0` is typically fetched with
124
+ * :method:statementexecution/executeStatement or :method:statementexecution/getStatement, this
125
+ * request can be used to fetch subsequent chunks. The response structure is identical to the
126
+ * nested `result` element described in the :method:statementexecution/getStatement request, and
127
+ * similarly includes the `next_chunk_index` and `next_chunk_internal_link` fields for simple
128
+ * iteration through the result set. Depending on `disposition`, the response returns chunks of
129
+ * data either inline, or as links.
130
+ */
131
+ async getResultData(req, options) {
132
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
133
+ const url = `${host}/api/2.0/sql/statements/${req.statementId ?? ""}/result/chunks/${String(req.chunkIndex ?? "")}`;
134
+ let resp;
135
+ const call = async (callSignal) => {
136
+ const headers = new Headers();
137
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
138
+ headers.set("User-Agent", this.userAgent);
139
+ resp = parseResponse(await executeHttpCall({
140
+ request: buildHttpRequest("GET", url, headers, callSignal),
141
+ httpClient,
142
+ logger: this.logger
143
+ }), unmarshalResultDataSchema);
144
+ };
145
+ await executeCall(call, options);
146
+ if (resp === void 0) throw new Error("operation completed without a result.");
147
+ return resp;
148
+ }
149
+ /**
150
+ * This request can be used to poll for the statement's status. StatementResponse contains
151
+ * `statement_id` and `status`; other fields might be absent or present depending on context.
152
+ * When the `status.state` field is `SUCCEEDED` it will also return the result manifest and the
153
+ * first chunk of the result data. When the statement is in the terminal states `CANCELED`,
154
+ * `CLOSED` or `FAILED`, it returns HTTP 200 with the state set. After at least 12 hours in
155
+ * terminal state, the statement is removed from the warehouse and further calls will receive an
156
+ * HTTP 404 response.
157
+ *
158
+ * **NOTE**
159
+ * This call currently might take up to 5 seconds to get the latest status and result.
160
+ */
161
+ async getStatementResult(req, options) {
162
+ const { host, workspaceId, httpClient } = await this.resolveConfig();
163
+ const url = `${host}/api/2.0/sql/statements/${req.statementId ?? ""}`;
164
+ let resp;
165
+ const call = async (callSignal) => {
166
+ const headers = new Headers();
167
+ if (workspaceId !== void 0) headers.set("X-Databricks-Workspace-Id", workspaceId);
168
+ headers.set("User-Agent", this.userAgent);
169
+ resp = parseResponse(await executeHttpCall({
170
+ request: buildHttpRequest("GET", url, headers, callSignal),
171
+ httpClient,
172
+ logger: this.logger
173
+ }), unmarshalStatementResponseSchema);
174
+ };
175
+ await executeCall(call, options);
176
+ if (resp === void 0) throw new Error("operation completed without a result.");
177
+ return resp;
178
+ }
179
+ };
180
+
181
+ //#endregion
182
+ export { StatementExecutionClient };
183
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","names":["pkgJson.version","AUTH_VERSION"],"sources":["../../src/v1/client.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';\nimport {createDefault} from '@databricks/sdk-core/clientinfo';\nimport type {Logger} from '@databricks/sdk-core/logger';\nimport {NoOpLogger} from '@databricks/sdk-core/logger';\nimport type {CallOptions} from '@databricks/sdk-options/call';\nimport type {ClientOptions} from '@databricks/sdk-options/client';\nimport type {ResolvedClientConfig} from './transport';\nimport {resolveClientConfig} from './transport';\nimport {\n buildHttpRequest,\n executeCall,\n executeHttpCall,\n marshalRequest,\n parseResponse,\n} from './utils';\nimport pkgJson from '../../package.json' with {type: 'json'};\nimport type {\n CancelStatementRequest,\n CancelStatementResponse,\n ExecuteStatementRequest,\n GetResultDataRequest,\n GetStatementResultRequest,\n ResultData,\n StatementResponse,\n} from './model';\nimport {\n marshalCancelStatementRequestSchema,\n marshalExecuteStatementRequestSchema,\n unmarshalCancelStatementResponseSchema,\n unmarshalResultDataSchema,\n unmarshalStatementResponseSchema,\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 StatementExecutionClient {\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 * Requests that an executing statement be canceled. Callers must poll for status to see the\n * terminal state. Cancel response is empty; receiving response indicates successful receipt.\n */\n async cancelStatement(\n req: CancelStatementRequest,\n options?: CallOptions\n ): Promise<CancelStatementResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/statements/${req.statementId ?? ''}/cancel`;\n const body = marshalRequest(req, marshalCancelStatementRequestSchema);\n let resp: CancelStatementResponse | 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, unmarshalCancelStatementResponseSchema);\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 * Execute a SQL statement and optionally await its results for a specified time.\n *\n * **Use case: small result sets with INLINE + JSON_ARRAY**\n *\n * For flows that generate small and predictable result sets (<= 25 MiB), `INLINE` responses of `JSON_ARRAY` result\n * data are typically the simplest way to execute and fetch result data.\n *\n * **Use case: large result sets with EXTERNAL_LINKS**\n *\n * Using `EXTERNAL_LINKS` to fetch result data allows you to fetch large result sets efficiently.\n * The main differences from using `INLINE` disposition are that the result data is accessed\n * with short-lived cloud-storage URLs, and\n * that there are 3 supported formats: `JSON_ARRAY`, `ARROW_STREAM` and `CSV` compared to only `JSON_ARRAY` with\n * `INLINE`.\n *\n * **External-link URLs**\n *\n * External links point to data stored within your workspace's internal cloud storage. The URLs are valid for only a\n * short period, <= 15 minutes. Alongside each `external_link` is an expiration field indicating the time at which the URL\n * is no longer valid. In `EXTERNAL_LINKS` mode, chunks can be resolved and fetched multiple times and in parallel.\n *\n * ----\n *\n * ### **Warning: Databricks strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition.**\n *\n * When you use the `EXTERNAL_LINKS` disposition, a short-lived cloud-storage URL is generated to download the\n * results. The URL contains temporary access credentials, so protect it and do not set an `Authorization` header in\n * the download request.\n *\n *\n *\n *\n *\n * The `EXTERNAL_LINKS` disposition can be disabled upon request by creating a [support case](/resources/support.html).\n *\n * See also [Security best practices](/sql/admin/sql-execution-tutorial.html#security-best-practices).\n *\n * ----\n *\n * StatementResponse contains `statement_id` and `status`; other fields might be absent or present depending on\n * context. If the SQL warehouse fails to execute the provided statement, a 200 response is returned with\n * `status.state` set to `FAILED` (in contrast to a failure when accepting the request, which results in a non-200\n * response). Details of the error can be found at `status.error` in case of execution failures.\n */\n async executeStatement(\n req: ExecuteStatementRequest,\n options?: CallOptions\n ): Promise<StatementResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/statements`;\n const body = marshalRequest(req, marshalExecuteStatementRequestSchema);\n let resp: StatementResponse | 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, unmarshalStatementResponseSchema);\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 * After the statement execution has `SUCCEEDED`, this request can be used to fetch any chunk by\n * index. Whereas the first chunk with `chunk_index=0` is typically fetched with\n * :method:statementexecution/executeStatement or :method:statementexecution/getStatement, this\n * request can be used to fetch subsequent chunks. The response structure is identical to the\n * nested `result` element described in the :method:statementexecution/getStatement request, and\n * similarly includes the `next_chunk_index` and `next_chunk_internal_link` fields for simple\n * iteration through the result set. Depending on `disposition`, the response returns chunks of\n * data either inline, or as links.\n */\n async getResultData(\n req: GetResultDataRequest,\n options?: CallOptions\n ): Promise<ResultData> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/statements/${req.statementId ?? ''}/result/chunks/${String(req.chunkIndex ?? '')}`;\n let resp: ResultData | 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, unmarshalResultDataSchema);\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 * This request can be used to poll for the statement's status. StatementResponse contains\n * `statement_id` and `status`; other fields might be absent or present depending on context.\n * When the `status.state` field is `SUCCEEDED` it will also return the result manifest and the\n * first chunk of the result data. When the statement is in the terminal states `CANCELED`,\n * `CLOSED` or `FAILED`, it returns HTTP 200 with the state set. After at least 12 hours in\n * terminal state, the statement is removed from the warehouse and further calls will receive an\n * HTTP 404 response.\n *\n * **NOTE**\n * This call currently might take up to 5 seconds to get the latest status and result.\n */\n async getStatementResult(\n req: GetStatementResultRequest,\n options?: CallOptions\n ): Promise<StatementResponse> {\n const {host, workspaceId, httpClient} = await this.resolveConfig();\n const url = `${host}/api/2.0/sql/statements/${req.statementId ?? ''}`;\n let resp: StatementResponse | 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, unmarshalStatementResponseSchema);\n };\n await executeCall(call, options);\n if (resp === undefined) {\n throw new Error('operation completed without a result.');\n }\n return resp;\n }\n}\n"],"mappings":";;;;;;;;;AAoCA,MAAM,kBAAkB;CACtB,KAAK,iBAAyB,QAAQ,iBAAiB,GAAG;CAC1D,OAAOA;CACR;AAED,IAAa,2BAAb,MAAsC;CACpC,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,KA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AChC,MAAI,SAAS,OACX,OAAM,IAAI,MAAM,wCAAwC;AAE1D,SAAO"}
@@ -0,0 +1,3 @@
1
+ import { CancelStatementRequest, CancelStatementResponse, ChunkInfo, ColumnInfo, ColumnTypeName, Disposition, ExecuteStatementRequest, ExternalLink, Format, GetResultDataRequest, GetStatementResultRequest, QueryTag, ResultData, ResultManifest, Schema, ServiceError, ServiceErrorCode, StatementParameter, StatementResponse, StatementStatus, StatementStatus_State, TimeoutAction } from "./model.js";
2
+ import { StatementExecutionClient } from "./client.js";
3
+ export { type CancelStatementRequest, type CancelStatementResponse, type ChunkInfo, type ColumnInfo, ColumnTypeName, Disposition, type ExecuteStatementRequest, type ExternalLink, Format, type GetResultDataRequest, type GetStatementResultRequest, type QueryTag, type ResultData, type ResultManifest, type Schema, type ServiceError, ServiceErrorCode, StatementExecutionClient, type StatementParameter, type StatementResponse, type StatementStatus, StatementStatus_State, TimeoutAction };
@@ -0,0 +1,4 @@
1
+ import { ColumnTypeName, Disposition, Format, ServiceErrorCode, StatementStatus_State, TimeoutAction } from "./model.js";
2
+ import { StatementExecutionClient } from "./client.js";
3
+
4
+ export { ColumnTypeName, Disposition, Format, ServiceErrorCode, StatementExecutionClient, StatementStatus_State, TimeoutAction };