@malloy-publisher/sdk 0.0.150 → 0.0.152
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/{ServerProvider-D-y63tG0.es.js → ServerProvider-BImNv6bh.es.js} +471 -451
- package/dist/ServerProvider-PWUjfVQM.cjs.js +1 -0
- package/dist/client/api.d.ts +76 -0
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/ServerProvider.d.ts +3 -6
- package/dist/index.cjs.js +31 -31
- package/dist/index.es.js +2469 -2449
- package/package.json +1 -1
- package/src/components/Model/SourcesExplorer.tsx +10 -19
- package/src/components/Notebook/Notebook.tsx +120 -85
- package/src/components/Project/ConnectionExplorer.tsx +20 -4
- package/src/components/ServerProvider.tsx +49 -6
- package/dist/ServerProvider-Bzid56gJ.cjs.js +0 -1
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import React, { useEffect, useState } from "react";
|
|
10
10
|
import { useMutationWithApiError } from "../../hooks/useQueryWithApiError";
|
|
11
11
|
import { parseResourceUri } from "../../utils/formatting";
|
|
12
|
-
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
12
|
+
// import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
13
13
|
import { useServer } from "../ServerProvider";
|
|
14
14
|
|
|
15
15
|
type ExplorerComponents = typeof import("@malloydata/malloy-explorer");
|
|
@@ -296,24 +296,15 @@ function SourceExplorerComponentInner({
|
|
|
296
296
|
}}
|
|
297
297
|
/>
|
|
298
298
|
</ResizableCollapsiblePanel>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
source={sourceAndPath.sourceInfo}
|
|
309
|
-
draftQuery={query?.malloyQuery}
|
|
310
|
-
setDraftQuery={(malloyQuery) =>
|
|
311
|
-
setQuery({ ...query, malloyQuery: malloyQuery })
|
|
312
|
-
}
|
|
313
|
-
submittedQuery={submittedQuery}
|
|
314
|
-
options={{ showRawQuery: true }}
|
|
315
|
-
/>
|
|
316
|
-
)}
|
|
299
|
+
<ResultPanel
|
|
300
|
+
source={sourceAndPath.sourceInfo}
|
|
301
|
+
draftQuery={query?.malloyQuery}
|
|
302
|
+
setDraftQuery={(malloyQuery) =>
|
|
303
|
+
setQuery({ ...query, malloyQuery: malloyQuery })
|
|
304
|
+
}
|
|
305
|
+
submittedQuery={submittedQuery}
|
|
306
|
+
options={{ showRawQuery: true }}
|
|
307
|
+
/>
|
|
317
308
|
</div>
|
|
318
309
|
</MalloyExplorerProvider>
|
|
319
310
|
</StyledExplorerContent>
|
|
@@ -28,6 +28,9 @@ import { CleanNotebookContainer, CleanNotebookSection } from "../styles";
|
|
|
28
28
|
import { NotebookCell } from "./NotebookCell";
|
|
29
29
|
import { EnhancedNotebookCell } from "./types";
|
|
30
30
|
|
|
31
|
+
// Maximum number of concurrent cell executions to avoid overwhelming the server
|
|
32
|
+
const MAX_CONCURRENT = 4;
|
|
33
|
+
|
|
31
34
|
interface NotebookProps {
|
|
32
35
|
resourceUri: string;
|
|
33
36
|
maxResultSize?: number;
|
|
@@ -149,6 +152,7 @@ export default function Notebook({
|
|
|
149
152
|
|
|
150
153
|
// Unified cell execution function
|
|
151
154
|
// Executes all notebook cells, optionally applying filters to query cells
|
|
155
|
+
// Runs up to 4 requests in parallel for better performance
|
|
152
156
|
const executeCells = useCallback(
|
|
153
157
|
async (filtersToApply: FilterSelection[] = []) => {
|
|
154
158
|
if (!isSuccess || !notebook?.notebookCells) return;
|
|
@@ -168,7 +172,9 @@ export default function Notebook({
|
|
|
168
172
|
setExecutionError(null);
|
|
169
173
|
|
|
170
174
|
try {
|
|
171
|
-
//
|
|
175
|
+
// Build execution tasks for code cells
|
|
176
|
+
const executionTasks: Array<() => Promise<void>> = [];
|
|
177
|
+
|
|
172
178
|
for (let i = 0; i < notebook.notebookCells.length; i++) {
|
|
173
179
|
const rawCell = notebook.notebookCells[i];
|
|
174
180
|
|
|
@@ -182,101 +188,130 @@ export default function Notebook({
|
|
|
182
188
|
cellText.includes("->") ||
|
|
183
189
|
/^\s*(run|query)\s*:/m.test(cellText);
|
|
184
190
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
let
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
191
|
+
// Capture cell index for closure
|
|
192
|
+
const cellIndex = i;
|
|
193
|
+
|
|
194
|
+
const executeCell = async () => {
|
|
195
|
+
try {
|
|
196
|
+
let result: string | undefined;
|
|
197
|
+
let newSources: string[] | undefined;
|
|
198
|
+
|
|
199
|
+
if (hasQuery && modelPath && filtersToApply.length > 0) {
|
|
200
|
+
// Query cell - use models API with optional filters
|
|
201
|
+
let queryToExecute = cellText;
|
|
202
|
+
|
|
203
|
+
// Apply filters if any match this query's source
|
|
204
|
+
if (filtersToApply.length > 0) {
|
|
205
|
+
const querySourceName =
|
|
206
|
+
extractSourceFromQuery(cellText);
|
|
207
|
+
|
|
208
|
+
// Get the set of joined sources for this query's source
|
|
209
|
+
const joinedSources =
|
|
210
|
+
(querySourceName &&
|
|
211
|
+
sourceJoinsMap.get(querySourceName)) ||
|
|
212
|
+
new Set<string>();
|
|
213
|
+
|
|
214
|
+
// Filter to only include those matching this query's source or joined sources
|
|
215
|
+
const filtersForSource = querySourceName
|
|
216
|
+
? filtersToApply.filter((filter) => {
|
|
217
|
+
const filterSourceName =
|
|
218
|
+
dimensionToSourceMap.get(
|
|
219
|
+
filter.dimensionName,
|
|
220
|
+
);
|
|
221
|
+
if (!filterSourceName) return false;
|
|
222
|
+
return (
|
|
223
|
+
filterSourceName === querySourceName ||
|
|
224
|
+
joinedSources.has(filterSourceName)
|
|
210
225
|
);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (filtersForSource.length > 0) {
|
|
220
|
-
const filterClause = generateFilterClause(
|
|
221
|
-
filtersForSource,
|
|
222
|
-
dimensionToSourceMap,
|
|
223
|
-
querySourceName,
|
|
224
|
-
);
|
|
225
|
-
if (filterClause) {
|
|
226
|
-
queryToExecute = injectWhereClause(
|
|
227
|
-
cellText,
|
|
228
|
-
filterClause,
|
|
226
|
+
})
|
|
227
|
+
: [];
|
|
228
|
+
|
|
229
|
+
if (filtersForSource.length > 0) {
|
|
230
|
+
const filterClause = generateFilterClause(
|
|
231
|
+
filtersForSource,
|
|
232
|
+
dimensionToSourceMap,
|
|
233
|
+
querySourceName,
|
|
229
234
|
);
|
|
235
|
+
if (filterClause) {
|
|
236
|
+
queryToExecute = injectWhereClause(
|
|
237
|
+
cellText,
|
|
238
|
+
filterClause,
|
|
239
|
+
);
|
|
240
|
+
}
|
|
230
241
|
}
|
|
231
242
|
}
|
|
243
|
+
|
|
244
|
+
// Execute using models API
|
|
245
|
+
const response =
|
|
246
|
+
await apiClients.models.executeQueryModel(
|
|
247
|
+
projectName,
|
|
248
|
+
packageName,
|
|
249
|
+
modelPath,
|
|
250
|
+
{
|
|
251
|
+
query: queryToExecute,
|
|
252
|
+
versionId,
|
|
253
|
+
},
|
|
254
|
+
);
|
|
255
|
+
result = response.data.result;
|
|
256
|
+
} else {
|
|
257
|
+
// Non-query code cell (or no filters applied) - use notebook cell execution API
|
|
258
|
+
const response =
|
|
259
|
+
await apiClients.notebooks.executeNotebookCell(
|
|
260
|
+
projectName,
|
|
261
|
+
packageName,
|
|
262
|
+
notebookPath,
|
|
263
|
+
cellIndex,
|
|
264
|
+
versionId,
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
const executedCell = response.data;
|
|
268
|
+
result = executedCell.result;
|
|
269
|
+
newSources =
|
|
270
|
+
rawCell.newSources || executedCell.newSources;
|
|
232
271
|
}
|
|
233
272
|
|
|
234
|
-
//
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
273
|
+
// Update state incrementally
|
|
274
|
+
setEnhancedCells((prev) => {
|
|
275
|
+
const next = [...prev];
|
|
276
|
+
// Ensure we have a cell to update (in case state was reset externally, though unlikely)
|
|
277
|
+
if (!next[cellIndex]) {
|
|
278
|
+
next[cellIndex] = { ...rawCell };
|
|
279
|
+
}
|
|
280
|
+
next[cellIndex] = {
|
|
281
|
+
...next[cellIndex],
|
|
282
|
+
result,
|
|
283
|
+
newSources,
|
|
284
|
+
};
|
|
285
|
+
return next;
|
|
286
|
+
});
|
|
287
|
+
} catch (cellError) {
|
|
288
|
+
console.error(
|
|
289
|
+
`Error executing cell ${cellIndex}:`,
|
|
290
|
+
cellError,
|
|
243
291
|
);
|
|
244
|
-
result
|
|
245
|
-
} else {
|
|
246
|
-
// Non-query code cell (or no filters applied) - use notebook cell execution API
|
|
247
|
-
const response =
|
|
248
|
-
await apiClients.notebooks.executeNotebookCell(
|
|
249
|
-
projectName,
|
|
250
|
-
packageName,
|
|
251
|
-
notebookPath,
|
|
252
|
-
i,
|
|
253
|
-
versionId,
|
|
254
|
-
);
|
|
255
|
-
|
|
256
|
-
const executedCell = response.data;
|
|
257
|
-
result = executedCell.result;
|
|
258
|
-
newSources = rawCell.newSources || executedCell.newSources;
|
|
292
|
+
// Don't update result on error, leave as is (undefined)
|
|
259
293
|
}
|
|
294
|
+
};
|
|
260
295
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
} catch (cellError) {
|
|
276
|
-
console.error(`Error executing cell ${i}:`, cellError);
|
|
277
|
-
// Don't update result on error, leave as is (undefined)
|
|
296
|
+
executionTasks.push(executeCell);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Execute with limited concurrency (up to 4 parallel requests)
|
|
300
|
+
const executing: Promise<void>[] = [];
|
|
301
|
+
|
|
302
|
+
for (const task of executionTasks) {
|
|
303
|
+
const promise = task().then(() => {
|
|
304
|
+
executing.splice(executing.indexOf(promise), 1);
|
|
305
|
+
});
|
|
306
|
+
executing.push(promise);
|
|
307
|
+
|
|
308
|
+
if (executing.length >= MAX_CONCURRENT) {
|
|
309
|
+
await Promise.race(executing);
|
|
278
310
|
}
|
|
279
311
|
}
|
|
312
|
+
|
|
313
|
+
// Wait for remaining tasks to complete
|
|
314
|
+
await Promise.all(executing);
|
|
280
315
|
} catch (error) {
|
|
281
316
|
console.error("Error executing notebook cells:", error);
|
|
282
317
|
setExecutionError(error as Error);
|
|
@@ -172,7 +172,14 @@ type TableSchemaViewerProps = {
|
|
|
172
172
|
function TableSchemaViewer({ table }: TableSchemaViewerProps) {
|
|
173
173
|
return (
|
|
174
174
|
<>
|
|
175
|
-
<Typography
|
|
175
|
+
<Typography
|
|
176
|
+
variant="overline"
|
|
177
|
+
fontWeight="bold"
|
|
178
|
+
sx={{
|
|
179
|
+
display: "block",
|
|
180
|
+
wordBreak: "break-all",
|
|
181
|
+
}}
|
|
182
|
+
>
|
|
176
183
|
Schema: {table.resource}
|
|
177
184
|
</Typography>
|
|
178
185
|
<Divider />
|
|
@@ -286,9 +293,18 @@ function TablesInSchema({
|
|
|
286
293
|
resource: string;
|
|
287
294
|
columns: Array<{ name: string; type: string }>;
|
|
288
295
|
}) => {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
table.resource.
|
|
296
|
+
let tableName = "";
|
|
297
|
+
if (
|
|
298
|
+
table.resource.includes("gs://") ||
|
|
299
|
+
table.resource.includes("s3://")
|
|
300
|
+
) {
|
|
301
|
+
tableName =
|
|
302
|
+
table.resource.split("/").pop() || table.resource;
|
|
303
|
+
} else {
|
|
304
|
+
// Extract table name from resource path (e.g., "schema.table_name" -> "table_name")
|
|
305
|
+
tableName =
|
|
306
|
+
table.resource.split(".").pop() || table.resource;
|
|
307
|
+
}
|
|
292
308
|
return (
|
|
293
309
|
<ListItemButton
|
|
294
310
|
key={table.resource}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
2
2
|
import axios from "axios";
|
|
3
|
-
import React, {
|
|
3
|
+
import React, {
|
|
4
|
+
createContext,
|
|
5
|
+
ReactNode,
|
|
6
|
+
useContext,
|
|
7
|
+
useMemo,
|
|
8
|
+
useEffect,
|
|
9
|
+
useState,
|
|
10
|
+
} from "react";
|
|
4
11
|
import {
|
|
5
12
|
ConnectionsApi,
|
|
6
13
|
DatabasesApi,
|
|
@@ -8,6 +15,7 @@ import {
|
|
|
8
15
|
NotebooksApi,
|
|
9
16
|
PackagesApi,
|
|
10
17
|
ProjectsApi,
|
|
18
|
+
PublisherApi,
|
|
11
19
|
WatchModeApi,
|
|
12
20
|
} from "../client";
|
|
13
21
|
import { Configuration } from "../client/configuration";
|
|
@@ -18,6 +26,7 @@ export interface ServerContextValue {
|
|
|
18
26
|
getAccessToken?: () => Promise<string>;
|
|
19
27
|
apiClients: ApiClients;
|
|
20
28
|
mutable: boolean;
|
|
29
|
+
isLoadingStatus: boolean;
|
|
21
30
|
}
|
|
22
31
|
|
|
23
32
|
const ServerContext = createContext<ServerContextValue | undefined>(undefined);
|
|
@@ -39,7 +48,6 @@ export interface ServerProviderProps {
|
|
|
39
48
|
* When false, users can only view and explore existing projects and packages.
|
|
40
49
|
* @default true
|
|
41
50
|
*/
|
|
42
|
-
mutable?: boolean;
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
const getApiClients = (
|
|
@@ -65,6 +73,7 @@ const getApiClients = (
|
|
|
65
73
|
|
|
66
74
|
return {
|
|
67
75
|
models: new ModelsApi(config, basePath, axiosInstance),
|
|
76
|
+
publisher: new PublisherApi(config, basePath, axiosInstance),
|
|
68
77
|
projects: new ProjectsApi(config, basePath, axiosInstance),
|
|
69
78
|
packages: new PackagesApi(config, basePath, axiosInstance),
|
|
70
79
|
notebooks: new NotebooksApi(config, basePath, axiosInstance),
|
|
@@ -80,20 +89,54 @@ export const ServerProvider: React.FC<ServerProviderProps> = ({
|
|
|
80
89
|
children,
|
|
81
90
|
getAccessToken,
|
|
82
91
|
baseURL,
|
|
83
|
-
mutable = true,
|
|
84
92
|
}) => {
|
|
85
93
|
const apiClients = useMemo(
|
|
86
94
|
() => getApiClients(baseURL, getAccessToken),
|
|
87
95
|
[baseURL, getAccessToken],
|
|
88
96
|
);
|
|
89
97
|
|
|
98
|
+
const server =
|
|
99
|
+
baseURL || `${window.location.protocol}//${window.location.host}/api/v0`;
|
|
100
|
+
|
|
101
|
+
const [mutable, setMutable] = useState(true);
|
|
102
|
+
const [isLoadingStatus, setIsLoadingStatus] = useState(true);
|
|
103
|
+
|
|
104
|
+
// Fetch status on mount
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
let isMounted = true;
|
|
107
|
+
|
|
108
|
+
const fetchStatus = async () => {
|
|
109
|
+
try {
|
|
110
|
+
const response = await apiClients.publisher.getStatus();
|
|
111
|
+
|
|
112
|
+
if (isMounted) {
|
|
113
|
+
const data = response.data as { frozenConfig?: boolean };
|
|
114
|
+
const frozenConfig = data?.frozenConfig;
|
|
115
|
+
setMutable(!frozenConfig);
|
|
116
|
+
setIsLoadingStatus(false);
|
|
117
|
+
}
|
|
118
|
+
} catch (error) {
|
|
119
|
+
console.error("Failed to fetch publisher status:", error);
|
|
120
|
+
if (isMounted) {
|
|
121
|
+
setMutable(true); // Default to mutable on error
|
|
122
|
+
setIsLoadingStatus(false);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
fetchStatus();
|
|
128
|
+
|
|
129
|
+
return () => {
|
|
130
|
+
isMounted = false;
|
|
131
|
+
};
|
|
132
|
+
}, [apiClients]);
|
|
133
|
+
|
|
90
134
|
const value: ServerContextValue = {
|
|
91
|
-
server
|
|
92
|
-
baseURL ||
|
|
93
|
-
`${window.location.protocol}//${window.location.host}/api/v0`,
|
|
135
|
+
server,
|
|
94
136
|
getAccessToken,
|
|
95
137
|
apiClients,
|
|
96
138
|
mutable,
|
|
139
|
+
isLoadingStatus,
|
|
97
140
|
};
|
|
98
141
|
|
|
99
142
|
return (
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const Q=require("react/jsx-runtime"),F=require("@tanstack/react-query"),u=require("axios"),I=require("react"),m="http://localhost/api/v0".replace(/\/+$/,"");class C{constructor(a,e=m,r=u){this.basePath=e,this.axios=r,a&&(this.configuration=a,this.basePath=a.basePath??e)}configuration}class ae extends Error{constructor(a,e){super(e),this.field=a,this.name="RequiredError"}}const P={},V="https://example.com",d=function(c,a,e){if(e==null)throw new ae(a,`Required parameter ${a} was null or undefined when calling ${c}.`)};function R(c,a,e=""){a!=null&&(typeof a=="object"?Array.isArray(a)?a.forEach(r=>R(c,r,e)):Object.keys(a).forEach(r=>R(c,a[r],`${e}${e!==""?".":""}${r}`)):c.has(e)?c.append(e,a):c.set(e,a))}const b=function(c,...a){const e=new URLSearchParams(c.search);R(e,a),c.search=e.toString()},S=function(c,a,e){const r=typeof c!="string";return(r&&e&&e.isJsonMime?e.isJsonMime(a.headers["Content-Type"]):r)?JSON.stringify(c!==void 0?c:{}):c||""},O=function(c){return c.pathname+c.search+c.hash},g=function(c,a,e,r){return(t=a,o=e)=>{const s={...c.options,url:(t.defaults.baseURL?"":r?.basePath??o)+c.url};return t.request(s)}},re={Bigquery:"bigquery",Snowflake:"snowflake",Postgres:"postgres"},oe={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Mysql:"mysql",Duckdb:"duckdb",Motherduck:"motherduck"},se={Ok:"ok",Failed:"failed"},ne={Embedded:"embedded",Materialized:"materialized"},ce={Markdown:"markdown",Code:"code"},le={Markdown:"markdown",Code:"code"},q=function(c){return{getConnection:async(a,e,r={})=>{d("getConnection","projectName",a),d("getConnection","connectionName",e);const t="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"GET",...s,...r},l={};b(o,{});let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},{url:O(o),options:n}},getQuerydata:async(a,e,r,t,o={})=>{d("getQuerydata","projectName",a),d("getQuerydata","connectionName",e);const s="/projects/{projectName}/connections/{connectionName}/queryData".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},h={};r!==void 0&&(h.sqlStatement=r),t!==void 0&&(h.options=t),b(n,h);let y=l&&l.headers?l.headers:{};return i.headers={...p,...y,...o.headers},{url:O(n),options:i}},getSqlsource:async(a,e,r,t={})=>{d("getSqlsource","projectName",a),d("getSqlsource","connectionName",e);const o="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.sqlStatement=r),b(s,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:O(s),options:l}},getTable:async(a,e,r,t,o={})=>{d("getTable","projectName",a),d("getTable","connectionName",e),d("getTable","schemaName",r),d("getTable","tablePath",t);const s="/projects/{projectName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))).replace("{schemaName}",encodeURIComponent(String(r))).replace("{tablePath}",encodeURIComponent(String(t))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={};b(n,{});let y=l&&l.headers?l.headers:{};return i.headers={...p,...y,...o.headers},{url:O(n),options:i}},getTablesource:async(a,e,r,t,o={})=>{d("getTablesource","projectName",a),d("getTablesource","connectionName",e);const s="/projects/{projectName}/connections/{connectionName}/tableSource".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},h={};r!==void 0&&(h.tableKey=r),t!==void 0&&(h.tablePath=t),b(n,h);let y=l&&l.headers?l.headers:{};return i.headers={...p,...y,...o.headers},{url:O(n),options:i}},getTemporarytable:async(a,e,r,t={})=>{d("getTemporarytable","projectName",a),d("getTemporarytable","connectionName",e);const o="/projects/{projectName}/connections/{connectionName}/temporaryTable".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.sqlStatement=r),b(s,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:O(s),options:l}},listConnections:async(a,e={})=>{d("listConnections","projectName",a);const r="/projects/{projectName}/connections".replace("{projectName}",encodeURIComponent(String(a))),t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"GET",...o,...e},n={};b(t,{});let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},{url:O(t),options:s}},listSchemas:async(a,e,r={})=>{d("listSchemas","projectName",a),d("listSchemas","connectionName",e);const t="/projects/{projectName}/connections/{connectionName}/schemas".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"GET",...s,...r},l={};b(o,{});let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},{url:O(o),options:n}},listTables:async(a,e,r,t={})=>{d("listTables","projectName",a),d("listTables","connectionName",e),d("listTables","schemaName",r);const o="/projects/{projectName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))).replace("{schemaName}",encodeURIComponent(String(r))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={};b(s,{});let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:O(s),options:l}},postQuerydata:async(a,e,r,t,o={})=>{d("postQuerydata","projectName",a),d("postQuerydata","connectionName",e),d("postQuerydata","postSqlsourceRequest",r);const s="/projects/{projectName}/connections/{connectionName}/sqlQuery".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"POST",...l,...o},p={},h={};t!==void 0&&(h.options=t),p["Content-Type"]="application/json",b(n,h);let y=l&&l.headers?l.headers:{};return i.headers={...p,...y,...o.headers},i.data=S(r,i,c),{url:O(n),options:i}},postSqlsource:async(a,e,r,t={})=>{d("postSqlsource","projectName",a),d("postSqlsource","connectionName",e),d("postSqlsource","postSqlsourceRequest",r);const o="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"POST",...n,...t},i={},p={};i["Content-Type"]="application/json",b(s,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},l.data=S(r,l,c),{url:O(s),options:l}},postTemporarytable:async(a,e,r,t={})=>{d("postTemporarytable","projectName",a),d("postTemporarytable","connectionName",e),d("postTemporarytable","postSqlsourceRequest",r);const o="/projects/{projectName}/connections/{connectionName}/sqlTemporaryTable".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"POST",...n,...t},i={},p={};i["Content-Type"]="application/json",b(s,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},l.data=S(r,l,c),{url:O(s),options:l}}}},A=function(c){const a=q(c);return{async getConnection(e,r,t){const o=await a.getConnection(e,r,t),s=c?.serverIndex??0,n=P["ConnectionsApi.getConnection"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async getQuerydata(e,r,t,o,s){const n=await a.getQuerydata(e,r,t,o,s),l=c?.serverIndex??0,i=P["ConnectionsApi.getQuerydata"]?.[l]?.url;return(p,h)=>g(n,u,m,c)(p,i||h)},async getSqlsource(e,r,t,o){const s=await a.getSqlsource(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.getSqlsource"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async getTable(e,r,t,o,s){const n=await a.getTable(e,r,t,o,s),l=c?.serverIndex??0,i=P["ConnectionsApi.getTable"]?.[l]?.url;return(p,h)=>g(n,u,m,c)(p,i||h)},async getTablesource(e,r,t,o,s){const n=await a.getTablesource(e,r,t,o,s),l=c?.serverIndex??0,i=P["ConnectionsApi.getTablesource"]?.[l]?.url;return(p,h)=>g(n,u,m,c)(p,i||h)},async getTemporarytable(e,r,t,o){const s=await a.getTemporarytable(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.getTemporarytable"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async listConnections(e,r){const t=await a.listConnections(e,r),o=c?.serverIndex??0,s=P["ConnectionsApi.listConnections"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async listSchemas(e,r,t){const o=await a.listSchemas(e,r,t),s=c?.serverIndex??0,n=P["ConnectionsApi.listSchemas"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async listTables(e,r,t,o){const s=await a.listTables(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.listTables"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async postQuerydata(e,r,t,o,s){const n=await a.postQuerydata(e,r,t,o,s),l=c?.serverIndex??0,i=P["ConnectionsApi.postQuerydata"]?.[l]?.url;return(p,h)=>g(n,u,m,c)(p,i||h)},async postSqlsource(e,r,t,o){const s=await a.postSqlsource(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.postSqlsource"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async postTemporarytable(e,r,t,o){const s=await a.postTemporarytable(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.postTemporarytable"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},ie=function(c,a,e){const r=A(c);return{getConnection(t,o,s){return r.getConnection(t,o,s).then(n=>n(e,a))},getQuerydata(t,o,s,n,l){return r.getQuerydata(t,o,s,n,l).then(i=>i(e,a))},getSqlsource(t,o,s,n){return r.getSqlsource(t,o,s,n).then(l=>l(e,a))},getTable(t,o,s,n,l){return r.getTable(t,o,s,n,l).then(i=>i(e,a))},getTablesource(t,o,s,n,l){return r.getTablesource(t,o,s,n,l).then(i=>i(e,a))},getTemporarytable(t,o,s,n){return r.getTemporarytable(t,o,s,n).then(l=>l(e,a))},listConnections(t,o){return r.listConnections(t,o).then(s=>s(e,a))},listSchemas(t,o,s){return r.listSchemas(t,o,s).then(n=>n(e,a))},listTables(t,o,s,n){return r.listTables(t,o,s,n).then(l=>l(e,a))},postQuerydata(t,o,s,n,l){return r.postQuerydata(t,o,s,n,l).then(i=>i(e,a))},postSqlsource(t,o,s,n){return r.postSqlsource(t,o,s,n).then(l=>l(e,a))},postTemporarytable(t,o,s,n){return r.postTemporarytable(t,o,s,n).then(l=>l(e,a))}}};class B extends C{getConnection(a,e,r){return A(this.configuration).getConnection(a,e,r).then(t=>t(this.axios,this.basePath))}getQuerydata(a,e,r,t,o){return A(this.configuration).getQuerydata(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getSqlsource(a,e,r,t){return A(this.configuration).getSqlsource(a,e,r,t).then(o=>o(this.axios,this.basePath))}getTable(a,e,r,t,o){return A(this.configuration).getTable(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getTablesource(a,e,r,t,o){return A(this.configuration).getTablesource(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getTemporarytable(a,e,r,t){return A(this.configuration).getTemporarytable(a,e,r,t).then(o=>o(this.axios,this.basePath))}listConnections(a,e){return A(this.configuration).listConnections(a,e).then(r=>r(this.axios,this.basePath))}listSchemas(a,e,r){return A(this.configuration).listSchemas(a,e,r).then(t=>t(this.axios,this.basePath))}listTables(a,e,r,t){return A(this.configuration).listTables(a,e,r,t).then(o=>o(this.axios,this.basePath))}postQuerydata(a,e,r,t,o){return A(this.configuration).postQuerydata(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}postSqlsource(a,e,r,t){return A(this.configuration).postSqlsource(a,e,r,t).then(o=>o(this.axios,this.basePath))}postTemporarytable(a,e,r,t){return A(this.configuration).postTemporarytable(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const M=function(c){return{testConnectionConfiguration:async(a,e={})=>{d("testConnectionConfiguration","connection",a);const r="/connections/test",t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"POST",...o,...e},n={},l={};n["Content-Type"]="application/json",b(t,l);let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},s.data=S(a,s,c),{url:O(t),options:s}}}},U=function(c){const a=M(c);return{async testConnectionConfiguration(e,r){const t=await a.testConnectionConfiguration(e,r),o=c?.serverIndex??0,s=P["ConnectionsTestApi.testConnectionConfiguration"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)}}},pe=function(c,a,e){const r=U(c);return{testConnectionConfiguration(t,o){return r.testConnectionConfiguration(t,o).then(s=>s(e,a))}}};class de extends C{testConnectionConfiguration(a,e){return U(this.configuration).testConnectionConfiguration(a,e).then(r=>r(this.axios,this.basePath))}}const $=function(c){return{listDatabases:async(a,e,r,t={})=>{d("listDatabases","projectName",a),d("listDatabases","packageName",e);const o="/projects/{projectName}/packages/{packageName}/databases".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),b(s,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:O(s),options:l}}}},T=function(c){const a=$(c);return{async listDatabases(e,r,t,o){const s=await a.listDatabases(e,r,t,o),n=c?.serverIndex??0,l=P["DatabasesApi.listDatabases"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},he=function(c,a,e){const r=T(c);return{listDatabases(t,o,s,n){return r.listDatabases(t,o,s,n).then(l=>l(e,a))}}};class E extends C{listDatabases(a,e,r,t){return T(this.configuration).listDatabases(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const L=function(c){return{executeQueryModel:async(a,e,r,t,o={})=>{d("executeQueryModel","projectName",a),d("executeQueryModel","packageName",e),d("executeQueryModel","path",r),d("executeQueryModel","queryRequest",t);const s="/projects/{projectName}/packages/{packageName}/models/{path}/query".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"POST",...l,...o},p={},h={};p["Content-Type"]="application/json",b(n,h);let y=l&&l.headers?l.headers:{};return i.headers={...p,...y,...o.headers},i.data=S(t,i,c),{url:O(n),options:i}},getModel:async(a,e,r,t,o={})=>{d("getModel","projectName",a),d("getModel","packageName",e),d("getModel","path",r);const s="/projects/{projectName}/packages/{packageName}/models/{path}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},h={};t!==void 0&&(h.versionId=t),b(n,h);let y=l&&l.headers?l.headers:{};return i.headers={...p,...y,...o.headers},{url:O(n),options:i}},listModels:async(a,e,r,t={})=>{d("listModels","projectName",a),d("listModels","packageName",e);const o="/projects/{projectName}/packages/{packageName}/models".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),b(s,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:O(s),options:l}}}},k=function(c){const a=L(c);return{async executeQueryModel(e,r,t,o,s){const n=await a.executeQueryModel(e,r,t,o,s),l=c?.serverIndex??0,i=P["ModelsApi.executeQueryModel"]?.[l]?.url;return(p,h)=>g(n,u,m,c)(p,i||h)},async getModel(e,r,t,o,s){const n=await a.getModel(e,r,t,o,s),l=c?.serverIndex??0,i=P["ModelsApi.getModel"]?.[l]?.url;return(p,h)=>g(n,u,m,c)(p,i||h)},async listModels(e,r,t,o){const s=await a.listModels(e,r,t,o),n=c?.serverIndex??0,l=P["ModelsApi.listModels"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},ue=function(c,a,e){const r=k(c);return{executeQueryModel(t,o,s,n,l){return r.executeQueryModel(t,o,s,n,l).then(i=>i(e,a))},getModel(t,o,s,n,l){return r.getModel(t,o,s,n,l).then(i=>i(e,a))},listModels(t,o,s,n){return r.listModels(t,o,s,n).then(l=>l(e,a))}}};class H extends C{executeQueryModel(a,e,r,t,o){return k(this.configuration).executeQueryModel(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getModel(a,e,r,t,o){return k(this.configuration).getModel(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listModels(a,e,r,t){return k(this.configuration).listModels(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const W=function(c){return{executeNotebookCell:async(a,e,r,t,o,s={})=>{d("executeNotebookCell","projectName",a),d("executeNotebookCell","packageName",e),d("executeNotebookCell","path",r),d("executeNotebookCell","cellIndex",t);const n="/projects/{projectName}/packages/{packageName}/notebooks/{path}/cells/{cellIndex}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))).replace("{cellIndex}",encodeURIComponent(String(t))),l=new URL(n,V);let i;c&&(i=c.baseOptions);const p={method:"GET",...i,...s},h={},y={};o!==void 0&&(y.versionId=o),b(l,y);let te=i&&i.headers?i.headers:{};return p.headers={...h,...te,...s.headers},{url:O(l),options:p}},getNotebook:async(a,e,r,t,o={})=>{d("getNotebook","projectName",a),d("getNotebook","packageName",e),d("getNotebook","path",r);const s="/projects/{projectName}/packages/{packageName}/notebooks/{path}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},h={};t!==void 0&&(h.versionId=t),b(n,h);let y=l&&l.headers?l.headers:{};return i.headers={...p,...y,...o.headers},{url:O(n),options:i}},listNotebooks:async(a,e,r,t={})=>{d("listNotebooks","projectName",a),d("listNotebooks","packageName",e);const o="/projects/{projectName}/packages/{packageName}/notebooks".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),b(s,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:O(s),options:l}}}},N=function(c){const a=W(c);return{async executeNotebookCell(e,r,t,o,s,n){const l=await a.executeNotebookCell(e,r,t,o,s,n),i=c?.serverIndex??0,p=P["NotebooksApi.executeNotebookCell"]?.[i]?.url;return(h,y)=>g(l,u,m,c)(h,p||y)},async getNotebook(e,r,t,o,s){const n=await a.getNotebook(e,r,t,o,s),l=c?.serverIndex??0,i=P["NotebooksApi.getNotebook"]?.[l]?.url;return(p,h)=>g(n,u,m,c)(p,i||h)},async listNotebooks(e,r,t,o){const s=await a.listNotebooks(e,r,t,o),n=c?.serverIndex??0,l=P["NotebooksApi.listNotebooks"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},me=function(c,a,e){const r=N(c);return{executeNotebookCell(t,o,s,n,l,i){return r.executeNotebookCell(t,o,s,n,l,i).then(p=>p(e,a))},getNotebook(t,o,s,n,l){return r.getNotebook(t,o,s,n,l).then(i=>i(e,a))},listNotebooks(t,o,s,n){return r.listNotebooks(t,o,s,n).then(l=>l(e,a))}}};class D extends C{executeNotebookCell(a,e,r,t,o,s){return N(this.configuration).executeNotebookCell(a,e,r,t,o,s).then(n=>n(this.axios,this.basePath))}getNotebook(a,e,r,t,o){return N(this.configuration).getNotebook(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listNotebooks(a,e,r,t){return N(this.configuration).listNotebooks(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const G=function(c){return{createPackage:async(a,e,r={})=>{d("createPackage","projectName",a),d("createPackage","_package",e);const t="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(a))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"POST",...s,...r},l={},i={};l["Content-Type"]="application/json",b(o,i);let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},n.data=S(e,n,c),{url:O(o),options:n}},deletePackage:async(a,e,r={})=>{d("deletePackage","projectName",a),d("deletePackage","packageName",e);const t="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"DELETE",...s,...r},l={};b(o,{});let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},{url:O(o),options:n}},getPackage:async(a,e,r,t,o={})=>{d("getPackage","projectName",a),d("getPackage","packageName",e);const s="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},h={};r!==void 0&&(h.versionId=r),t!==void 0&&(h.reload=t),b(n,h);let y=l&&l.headers?l.headers:{};return i.headers={...p,...y,...o.headers},{url:O(n),options:i}},listPackages:async(a,e={})=>{d("listPackages","projectName",a);const r="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(a))),t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"GET",...o,...e},n={};b(t,{});let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},{url:O(t),options:s}},updatePackage:async(a,e,r,t={})=>{d("updatePackage","projectName",a),d("updatePackage","packageName",e),d("updatePackage","_package",r);const o="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"PATCH",...n,...t},i={},p={};i["Content-Type"]="application/json",b(s,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},l.data=S(r,l,c),{url:O(s),options:l}}}},j=function(c){const a=G(c);return{async createPackage(e,r,t){const o=await a.createPackage(e,r,t),s=c?.serverIndex??0,n=P["PackagesApi.createPackage"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async deletePackage(e,r,t){const o=await a.deletePackage(e,r,t),s=c?.serverIndex??0,n=P["PackagesApi.deletePackage"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async getPackage(e,r,t,o,s){const n=await a.getPackage(e,r,t,o,s),l=c?.serverIndex??0,i=P["PackagesApi.getPackage"]?.[l]?.url;return(p,h)=>g(n,u,m,c)(p,i||h)},async listPackages(e,r){const t=await a.listPackages(e,r),o=c?.serverIndex??0,s=P["PackagesApi.listPackages"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async updatePackage(e,r,t,o){const s=await a.updatePackage(e,r,t,o),n=c?.serverIndex??0,l=P["PackagesApi.updatePackage"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},Pe=function(c,a,e){const r=j(c);return{createPackage(t,o,s){return r.createPackage(t,o,s).then(n=>n(e,a))},deletePackage(t,o,s){return r.deletePackage(t,o,s).then(n=>n(e,a))},getPackage(t,o,s,n,l){return r.getPackage(t,o,s,n,l).then(i=>i(e,a))},listPackages(t,o){return r.listPackages(t,o).then(s=>s(e,a))},updatePackage(t,o,s,n){return r.updatePackage(t,o,s,n).then(l=>l(e,a))}}};class f extends C{createPackage(a,e,r){return j(this.configuration).createPackage(a,e,r).then(t=>t(this.axios,this.basePath))}deletePackage(a,e,r){return j(this.configuration).deletePackage(a,e,r).then(t=>t(this.axios,this.basePath))}getPackage(a,e,r,t,o){return j(this.configuration).getPackage(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listPackages(a,e){return j(this.configuration).listPackages(a,e).then(r=>r(this.axios,this.basePath))}updatePackage(a,e,r,t){return j(this.configuration).updatePackage(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const z=function(c){return{createProject:async(a,e={})=>{d("createProject","project",a);const r="/projects",t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"POST",...o,...e},n={},l={};n["Content-Type"]="application/json",b(t,l);let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},s.data=S(a,s,c),{url:O(t),options:s}},deleteProject:async(a,e={})=>{d("deleteProject","projectName",a);const r="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(a))),t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"DELETE",...o,...e},n={};b(t,{});let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},{url:O(t),options:s}},getProject:async(a,e,r={})=>{d("getProject","projectName",a);const t="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(a))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"GET",...s,...r},l={},i={};e!==void 0&&(i.reload=e),b(o,i);let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},{url:O(o),options:n}},listProjects:async(a={})=>{const e="/projects",r=new URL(e,V);let t;c&&(t=c.baseOptions);const o={method:"GET",...t,...a},s={};b(r,{});let l=t&&t.headers?t.headers:{};return o.headers={...s,...l,...a.headers},{url:O(r),options:o}},updateProject:async(a,e,r={})=>{d("updateProject","projectName",a),d("updateProject","project",e);const t="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(a))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"PATCH",...s,...r},l={},i={};l["Content-Type"]="application/json",b(o,i);let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},n.data=S(e,n,c),{url:O(o),options:n}}}},x=function(c){const a=z(c);return{async createProject(e,r){const t=await a.createProject(e,r),o=c?.serverIndex??0,s=P["ProjectsApi.createProject"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async deleteProject(e,r){const t=await a.deleteProject(e,r),o=c?.serverIndex??0,s=P["ProjectsApi.deleteProject"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async getProject(e,r,t){const o=await a.getProject(e,r,t),s=c?.serverIndex??0,n=P["ProjectsApi.getProject"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async listProjects(e){const r=await a.listProjects(e),t=c?.serverIndex??0,o=P["ProjectsApi.listProjects"]?.[t]?.url;return(s,n)=>g(r,u,m,c)(s,o||n)},async updateProject(e,r,t){const o=await a.updateProject(e,r,t),s=c?.serverIndex??0,n=P["ProjectsApi.updateProject"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)}}},Ve=function(c,a,e){const r=x(c);return{createProject(t,o){return r.createProject(t,o).then(s=>s(e,a))},deleteProject(t,o){return r.deleteProject(t,o).then(s=>s(e,a))},getProject(t,o,s){return r.getProject(t,o,s).then(n=>n(e,a))},listProjects(t){return r.listProjects(t).then(o=>o(e,a))},updateProject(t,o,s){return r.updateProject(t,o,s).then(n=>n(e,a))}}};class J extends C{createProject(a,e){return x(this.configuration).createProject(a,e).then(r=>r(this.axios,this.basePath))}deleteProject(a,e){return x(this.configuration).deleteProject(a,e).then(r=>r(this.axios,this.basePath))}getProject(a,e,r){return x(this.configuration).getProject(a,e,r).then(t=>t(this.axios,this.basePath))}listProjects(a){return x(this.configuration).listProjects(a).then(e=>e(this.axios,this.basePath))}updateProject(a,e,r){return x(this.configuration).updateProject(a,e,r).then(t=>t(this.axios,this.basePath))}}const K=function(c){return{getStatus:async(a={})=>{const e="/status",r=new URL(e,V);let t;c&&(t=c.baseOptions);const o={method:"GET",...t,...a},s={};b(r,{});let l=t&&t.headers?t.headers:{};return o.headers={...s,...l,...a.headers},{url:O(r),options:o}}}},w=function(c){const a=K(c);return{async getStatus(e){const r=await a.getStatus(e),t=c?.serverIndex??0,o=P["PublisherApi.getStatus"]?.[t]?.url;return(s,n)=>g(r,u,m,c)(s,o||n)}}},be=function(c,a,e){const r=w(c);return{getStatus(t){return r.getStatus(t).then(o=>o(e,a))}}};class Oe extends C{getStatus(a){return w(this.configuration).getStatus(a).then(e=>e(this.axios,this.basePath))}}const Y=function(c){return{getWatchStatus:async(a={})=>{const e="/watch-mode/status",r=new URL(e,V);let t;c&&(t=c.baseOptions);const o={method:"GET",...t,...a},s={};b(r,{});let l=t&&t.headers?t.headers:{};return o.headers={...s,...l,...a.headers},{url:O(r),options:o}},startWatching:async(a,e={})=>{d("startWatching","startWatchRequest",a);const r="/watch-mode/start",t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"POST",...o,...e},n={},l={};n["Content-Type"]="application/json",b(t,l);let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},s.data=S(a,s,c),{url:O(t),options:s}},stopWatching:async(a={})=>{const e="/watch-mode/stop",r=new URL(e,V);let t;c&&(t=c.baseOptions);const o={method:"POST",...t,...a},s={};b(r,{});let l=t&&t.headers?t.headers:{};return o.headers={...s,...l,...a.headers},{url:O(r),options:o}}}},v=function(c){const a=Y(c);return{async getWatchStatus(e){const r=await a.getWatchStatus(e),t=c?.serverIndex??0,o=P["WatchModeApi.getWatchStatus"]?.[t]?.url;return(s,n)=>g(r,u,m,c)(s,o||n)},async startWatching(e,r){const t=await a.startWatching(e,r),o=c?.serverIndex??0,s=P["WatchModeApi.startWatching"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async stopWatching(e){const r=await a.stopWatching(e),t=c?.serverIndex??0,o=P["WatchModeApi.stopWatching"]?.[t]?.url;return(s,n)=>g(r,u,m,c)(s,o||n)}}},ge=function(c,a,e){const r=v(c);return{getWatchStatus(t){return r.getWatchStatus(t).then(o=>o(e,a))},startWatching(t,o){return r.startWatching(t,o).then(s=>s(e,a))},stopWatching(t){return r.stopWatching(t).then(o=>o(e,a))}}};class _ extends C{getWatchStatus(a){return v(this.configuration).getWatchStatus(a).then(e=>e(this.axios,this.basePath))}startWatching(a,e){return v(this.configuration).startWatching(a,e).then(r=>r(this.axios,this.basePath))}stopWatching(a){return v(this.configuration).stopWatching(a).then(e=>e(this.axios,this.basePath))}}class X{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(a={}){this.apiKey=a.apiKey,this.username=a.username,this.password=a.password,this.accessToken=a.accessToken,this.basePath=a.basePath,this.serverIndex=a.serverIndex,this.baseOptions={...a.baseOptions,headers:{...a.baseOptions?.headers}},this.formDataCtor=a.formDataCtor}isJsonMime(a){const e=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return a!==null&&(e.test(a)||a.toLowerCase()==="application/json-patch+json")}}const Z=new F.QueryClient({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),ee=I.createContext(void 0),ye=(c,a)=>{const e=`${window.location.protocol}//${window.location.host}/api/v0`,r=u.create({baseURL:c||e,withCredentials:!0,timeout:6e5});r.interceptors.request.use(async o=>{const s=await a?.();return o.headers.Authorization=s||"",o});const t=new X({basePath:e});return{models:new H(t,e,r),projects:new J(t,e,r),packages:new f(t,e,r),notebooks:new D(t,e,r),connections:new B(t,e,r),databases:new E(t,e,r),watchMode:new _(t,e,r)}},Ae=({children:c,getAccessToken:a,baseURL:e,mutable:r=!0})=>{const t=I.useMemo(()=>ye(e,a),[e,a]),o={server:e||`${window.location.protocol}//${window.location.host}/api/v0`,getAccessToken:a,apiClients:t,mutable:r};return Q.jsx(F.QueryClientProvider,{client:Z,children:Q.jsx(ee.Provider,{value:o,children:c})})},Se=()=>{const c=I.useContext(ee);if(c===void 0)throw new Error("useServer must be used within a ServerProvider");return c};exports.AttachedDatabaseTypeEnum=re;exports.Configuration=X;exports.ConnectionStatusStatusEnum=se;exports.ConnectionTypeEnum=oe;exports.ConnectionsApi=B;exports.ConnectionsApiAxiosParamCreator=q;exports.ConnectionsApiFactory=ie;exports.ConnectionsApiFp=A;exports.ConnectionsTestApi=de;exports.ConnectionsTestApiAxiosParamCreator=M;exports.ConnectionsTestApiFactory=pe;exports.ConnectionsTestApiFp=U;exports.DatabaseTypeEnum=ne;exports.DatabasesApi=E;exports.DatabasesApiAxiosParamCreator=$;exports.DatabasesApiFactory=he;exports.DatabasesApiFp=T;exports.ModelsApi=H;exports.ModelsApiAxiosParamCreator=L;exports.ModelsApiFactory=ue;exports.ModelsApiFp=k;exports.NotebookCellResultTypeEnum=le;exports.NotebookCellTypeEnum=ce;exports.NotebooksApi=D;exports.NotebooksApiAxiosParamCreator=W;exports.NotebooksApiFactory=me;exports.NotebooksApiFp=N;exports.PackagesApi=f;exports.PackagesApiAxiosParamCreator=G;exports.PackagesApiFactory=Pe;exports.PackagesApiFp=j;exports.ProjectsApi=J;exports.ProjectsApiAxiosParamCreator=z;exports.ProjectsApiFactory=Ve;exports.ProjectsApiFp=x;exports.PublisherApi=Oe;exports.PublisherApiAxiosParamCreator=K;exports.PublisherApiFactory=be;exports.PublisherApiFp=w;exports.ServerProvider=Ae;exports.WatchModeApi=_;exports.WatchModeApiAxiosParamCreator=Y;exports.WatchModeApiFactory=ge;exports.WatchModeApiFp=v;exports.globalQueryClient=Z;exports.useServer=Se;
|