@malloy-publisher/sdk 0.0.118 → 0.0.120
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-49yj-aFb.cjs.js +1 -0
- package/dist/{ServerProvider-v0TajMUn.es.js → ServerProvider-BDgL8SVP.es.js} +355 -429
- package/dist/client/api.d.ts +285 -276
- package/dist/client/configuration.d.ts +1 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.es.js +43 -46
- package/dist/components/ServerProvider.d.ts +1 -3
- package/dist/index.cjs.js +111 -111
- package/dist/index.es.js +33143 -30265
- package/package.json +1 -1
- package/src/components/Connections/common.ts +2 -0
- package/src/components/Home/DeleteProjectDialog.tsx +10 -0
- package/src/components/Home/Home.tsx +1 -1
- package/src/components/Model/Model.tsx +19 -13
- package/src/components/Model/ModelCell.tsx +10 -8
- package/src/components/Model/ModelExplorer.tsx +91 -56
- package/src/components/Model/SourcesExplorer.tsx +7 -6
- package/src/components/Notebook/NotebookCell.tsx +4 -4
- package/src/components/Package/FileTreeView.tsx +3 -3
- package/src/components/Package/Package.tsx +7 -11
- package/src/components/Project/About.tsx +63 -8
- package/src/components/Project/ConnectionExplorer.tsx +123 -160
- package/src/components/Project/DeletePackageDialog.tsx +10 -0
- package/src/components/QueryResult/QueryResult.tsx +9 -7
- package/src/components/ServerProvider.tsx +0 -4
- package/src/hooks/useRawQueryData.ts +8 -6
- package/src/utils/formatting.ts +2 -1
- package/src/utils/parsing.ts +1 -1
- package/dist/ServerProvider-Bx3fsDOb.cjs.js +0 -1
- package/dist/components/Package/Schedules.d.ts +0 -5
- package/src/components/Package/Schedules.tsx +0 -114
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import {
|
|
3
2
|
Box,
|
|
3
|
+
Divider,
|
|
4
|
+
FormControlLabel,
|
|
5
|
+
Grid,
|
|
4
6
|
List,
|
|
5
7
|
ListItemButton,
|
|
6
8
|
ListItemText,
|
|
7
|
-
Typography,
|
|
8
|
-
Divider,
|
|
9
9
|
Paper,
|
|
10
|
-
Grid,
|
|
11
10
|
Switch,
|
|
12
|
-
FormControlLabel,
|
|
13
11
|
Table,
|
|
14
12
|
TableBody,
|
|
15
13
|
TableCell,
|
|
16
14
|
TableContainer,
|
|
17
15
|
TableHead,
|
|
18
16
|
TableRow,
|
|
19
|
-
|
|
17
|
+
Typography,
|
|
20
18
|
} from "@mui/material";
|
|
21
|
-
import
|
|
22
|
-
import { Loading } from "../Loading";
|
|
19
|
+
import React from "react";
|
|
23
20
|
import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
|
|
24
21
|
import { parseResourceUri } from "../../utils/formatting";
|
|
22
|
+
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
23
|
+
import { Loading } from "../Loading";
|
|
25
24
|
import { useServer } from "../ServerProvider";
|
|
26
25
|
|
|
27
26
|
interface ConnectionExplorerProps {
|
|
@@ -37,19 +36,30 @@ export default function ConnectionExplorer({
|
|
|
37
36
|
}: ConnectionExplorerProps) {
|
|
38
37
|
const { apiClients } = useServer();
|
|
39
38
|
const { projectName: projectName } = parseResourceUri(resourceUri);
|
|
40
|
-
const [selectedTable, setSelectedTable] = React.useState<
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const [selectedTable, setSelectedTable] = React.useState<
|
|
40
|
+
| { resource: string; columns: Array<{ name: string; type: string }> }
|
|
41
|
+
| undefined
|
|
42
|
+
>(undefined);
|
|
43
43
|
const [selectedSchema, setSelectedSchema] = React.useState<string | null>(
|
|
44
44
|
schema || null,
|
|
45
45
|
);
|
|
46
46
|
const [showHiddenSchemas, setShowHiddenSchemas] = React.useState(false);
|
|
47
|
-
const {
|
|
48
|
-
|
|
47
|
+
const {
|
|
48
|
+
data: schemasData,
|
|
49
|
+
isError: schemasError,
|
|
50
|
+
isLoading: schemasLoading,
|
|
51
|
+
error: schemasErrorObj,
|
|
52
|
+
} = useQueryWithApiError({
|
|
53
|
+
queryKey: ["schemas", projectName, connectionName],
|
|
49
54
|
queryFn: () =>
|
|
50
55
|
apiClients.connections.listSchemas(projectName, connectionName),
|
|
51
56
|
});
|
|
52
57
|
|
|
58
|
+
const availableSchemas =
|
|
59
|
+
schemasData?.data
|
|
60
|
+
?.map((schema: { name: string }) => schema.name)
|
|
61
|
+
.sort() || [];
|
|
62
|
+
|
|
53
63
|
return (
|
|
54
64
|
<Grid container spacing={1}>
|
|
55
65
|
{!schema && (
|
|
@@ -82,74 +92,39 @@ export default function ConnectionExplorer({
|
|
|
82
92
|
<Box
|
|
83
93
|
sx={{ mt: "2px", maxHeight: "600px", overflowY: "auto" }}
|
|
84
94
|
>
|
|
85
|
-
{
|
|
86
|
-
{
|
|
95
|
+
{schemasLoading && <Loading text="Loading schemas..." />}
|
|
96
|
+
{schemasError && (
|
|
87
97
|
<ApiErrorDisplay
|
|
88
|
-
error={
|
|
89
|
-
context={`${projectName} > ${connectionName}`}
|
|
98
|
+
error={schemasErrorObj}
|
|
99
|
+
context={`${projectName} > ${connectionName} > Schemas`}
|
|
90
100
|
/>
|
|
91
101
|
)}
|
|
92
|
-
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
? fullDescription.split(/\r?\n/)[0]
|
|
119
|
-
: undefined;
|
|
120
|
-
|
|
121
|
-
const item = (
|
|
122
|
-
<ListItemButton
|
|
123
|
-
key={schema.name}
|
|
124
|
-
selected={
|
|
125
|
-
selectedSchema === schema.name
|
|
126
|
-
}
|
|
127
|
-
onClick={() =>
|
|
128
|
-
setSelectedSchema(schema.name)
|
|
129
|
-
}
|
|
130
|
-
>
|
|
131
|
-
<ListItemText
|
|
132
|
-
primary={schema.name}
|
|
133
|
-
secondary={firstLine}
|
|
134
|
-
/>
|
|
135
|
-
</ListItemButton>
|
|
136
|
-
);
|
|
137
|
-
|
|
138
|
-
return hasDescription ? (
|
|
139
|
-
<Tooltip
|
|
140
|
-
key={schema.name}
|
|
141
|
-
title={fullDescription}
|
|
142
|
-
arrow
|
|
143
|
-
>
|
|
144
|
-
{item}
|
|
145
|
-
</Tooltip>
|
|
146
|
-
) : (
|
|
147
|
-
item
|
|
148
|
-
);
|
|
149
|
-
},
|
|
150
|
-
)}
|
|
151
|
-
</List>
|
|
152
|
-
)}
|
|
102
|
+
{!schemasLoading &&
|
|
103
|
+
!schemasError &&
|
|
104
|
+
availableSchemas.length === 0 && (
|
|
105
|
+
<Typography variant="body2">No Schemas</Typography>
|
|
106
|
+
)}
|
|
107
|
+
{!schemasLoading &&
|
|
108
|
+
!schemasError &&
|
|
109
|
+
availableSchemas.length > 0 && (
|
|
110
|
+
<List dense disablePadding>
|
|
111
|
+
{availableSchemas.map((schemaName: string) => {
|
|
112
|
+
const isSelected =
|
|
113
|
+
selectedSchema === schemaName;
|
|
114
|
+
return (
|
|
115
|
+
<ListItemButton
|
|
116
|
+
key={schemaName}
|
|
117
|
+
selected={isSelected}
|
|
118
|
+
onClick={() =>
|
|
119
|
+
setSelectedSchema(schemaName)
|
|
120
|
+
}
|
|
121
|
+
>
|
|
122
|
+
<ListItemText primary={schemaName} />
|
|
123
|
+
</ListItemButton>
|
|
124
|
+
);
|
|
125
|
+
})}
|
|
126
|
+
</List>
|
|
127
|
+
)}
|
|
153
128
|
</Box>
|
|
154
129
|
</Paper>
|
|
155
130
|
</Grid>
|
|
@@ -160,8 +135,8 @@ export default function ConnectionExplorer({
|
|
|
160
135
|
<TablesInSchema
|
|
161
136
|
connectionName={connectionName}
|
|
162
137
|
schemaName={selectedSchema}
|
|
163
|
-
onTableClick={(
|
|
164
|
-
setSelectedTable(
|
|
138
|
+
onTableClick={(table) => {
|
|
139
|
+
setSelectedTable(table);
|
|
165
140
|
}}
|
|
166
141
|
resourceUri={resourceUri}
|
|
167
142
|
/>
|
|
@@ -169,14 +144,9 @@ export default function ConnectionExplorer({
|
|
|
169
144
|
)}
|
|
170
145
|
</Grid>
|
|
171
146
|
<Grid size={{ xs: 12, md: schema ? 6 : 4 }}>
|
|
172
|
-
{selectedTable &&
|
|
147
|
+
{selectedTable && (
|
|
173
148
|
<Paper sx={{ p: 1, m: 0 }}>
|
|
174
|
-
<TableSchemaViewer
|
|
175
|
-
connectionName={connectionName}
|
|
176
|
-
schemaName={selectedSchema}
|
|
177
|
-
tableName={selectedTable}
|
|
178
|
-
resourceUri={resourceUri}
|
|
179
|
-
/>
|
|
149
|
+
<TableSchemaViewer table={selectedTable} />
|
|
180
150
|
</Paper>
|
|
181
151
|
)}
|
|
182
152
|
</Grid>
|
|
@@ -185,76 +155,42 @@ export default function ConnectionExplorer({
|
|
|
185
155
|
}
|
|
186
156
|
|
|
187
157
|
type TableSchemaViewerProps = {
|
|
188
|
-
|
|
189
|
-
schemaName: string;
|
|
190
|
-
tableName: string;
|
|
191
|
-
resourceUri: string;
|
|
158
|
+
table: { resource: string; columns: Array<{ name: string; type: string }> };
|
|
192
159
|
};
|
|
193
160
|
|
|
194
|
-
function TableSchemaViewer({
|
|
195
|
-
connectionName,
|
|
196
|
-
schemaName,
|
|
197
|
-
tableName,
|
|
198
|
-
resourceUri,
|
|
199
|
-
}: TableSchemaViewerProps) {
|
|
200
|
-
const { apiClients } = useServer();
|
|
201
|
-
const { projectName: projectName } = parseResourceUri(resourceUri);
|
|
202
|
-
const { data, isSuccess, isError, error, isLoading } = useQueryWithApiError({
|
|
203
|
-
queryKey: [
|
|
204
|
-
"tablePathSchema",
|
|
205
|
-
projectName,
|
|
206
|
-
connectionName,
|
|
207
|
-
schemaName,
|
|
208
|
-
tableName,
|
|
209
|
-
],
|
|
210
|
-
queryFn: () =>
|
|
211
|
-
apiClients.connections.getTablesource(
|
|
212
|
-
projectName,
|
|
213
|
-
connectionName,
|
|
214
|
-
tableName,
|
|
215
|
-
`${schemaName}.${tableName}`,
|
|
216
|
-
),
|
|
217
|
-
});
|
|
218
|
-
|
|
161
|
+
function TableSchemaViewer({ table }: TableSchemaViewerProps) {
|
|
219
162
|
return (
|
|
220
163
|
<>
|
|
221
164
|
<Typography variant="overline" fontWeight="bold">
|
|
222
|
-
Schema: {
|
|
165
|
+
Schema: {table.resource}
|
|
223
166
|
</Typography>
|
|
224
167
|
<Divider />
|
|
225
168
|
<Box sx={{ mt: "10px", maxHeight: "600px", overflowY: "auto" }}>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
</TableRow>
|
|
252
|
-
),
|
|
253
|
-
)}
|
|
254
|
-
</TableBody>
|
|
255
|
-
</Table>
|
|
256
|
-
</TableContainer>
|
|
257
|
-
)}
|
|
169
|
+
<TableContainer>
|
|
170
|
+
<Table
|
|
171
|
+
size="small"
|
|
172
|
+
sx={{ "& .MuiTableCell-root": { padding: "10px" } }}
|
|
173
|
+
>
|
|
174
|
+
<TableHead>
|
|
175
|
+
<TableRow>
|
|
176
|
+
<TableCell>NAME</TableCell>
|
|
177
|
+
<TableCell>TYPE</TableCell>
|
|
178
|
+
</TableRow>
|
|
179
|
+
</TableHead>
|
|
180
|
+
<TableBody>
|
|
181
|
+
{table.columns
|
|
182
|
+
?.sort((a: { name: string }, b: { name: string }) =>
|
|
183
|
+
a.name.localeCompare(b.name),
|
|
184
|
+
)
|
|
185
|
+
?.map((column: { name: string; type: string }) => (
|
|
186
|
+
<TableRow key={column.name}>
|
|
187
|
+
<TableCell>{column.name}</TableCell>
|
|
188
|
+
<TableCell>{column.type}</TableCell>
|
|
189
|
+
</TableRow>
|
|
190
|
+
))}
|
|
191
|
+
</TableBody>
|
|
192
|
+
</Table>
|
|
193
|
+
</TableContainer>
|
|
258
194
|
</Box>
|
|
259
195
|
</>
|
|
260
196
|
);
|
|
@@ -263,7 +199,10 @@ function TableSchemaViewer({
|
|
|
263
199
|
interface TablesInSchemaProps {
|
|
264
200
|
connectionName: string;
|
|
265
201
|
schemaName: string;
|
|
266
|
-
onTableClick: (
|
|
202
|
+
onTableClick: (table: {
|
|
203
|
+
resource: string;
|
|
204
|
+
columns: Array<{ name: string; type: string }>;
|
|
205
|
+
}) => void;
|
|
267
206
|
resourceUri: string;
|
|
268
207
|
}
|
|
269
208
|
|
|
@@ -299,19 +238,43 @@ function TablesInSchema({
|
|
|
299
238
|
context={`${projectName} > ${connectionName} > ${schemaName}`}
|
|
300
239
|
/>
|
|
301
240
|
)}
|
|
302
|
-
{isSuccess && data
|
|
241
|
+
{isSuccess && data?.data?.length === 0 && (
|
|
303
242
|
<Typography variant="body2">No Tables</Typography>
|
|
304
243
|
)}
|
|
305
|
-
{isSuccess && data.data.length > 0 && (
|
|
244
|
+
{isSuccess && data?.data && data.data.length > 0 && (
|
|
306
245
|
<List dense disablePadding>
|
|
307
|
-
{data.data
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
246
|
+
{data.data
|
|
247
|
+
.sort(
|
|
248
|
+
(a: { resource: string }, b: { resource: string }) => {
|
|
249
|
+
// Extract table names for sorting
|
|
250
|
+
const tableNameA =
|
|
251
|
+
a.resource.split(".").pop() || a.resource;
|
|
252
|
+
const tableNameB =
|
|
253
|
+
b.resource.split(".").pop() || b.resource;
|
|
254
|
+
return tableNameA.localeCompare(tableNameB);
|
|
255
|
+
},
|
|
256
|
+
)
|
|
257
|
+
.map(
|
|
258
|
+
(table: {
|
|
259
|
+
resource: string;
|
|
260
|
+
columns: Array<{ name: string; type: string }>;
|
|
261
|
+
}) => {
|
|
262
|
+
// Extract table name from resource path (e.g., "schema.table_name" -> "table_name")
|
|
263
|
+
const tableName =
|
|
264
|
+
table.resource.split(".").pop() || table.resource;
|
|
265
|
+
return (
|
|
266
|
+
<ListItemButton
|
|
267
|
+
key={table.resource}
|
|
268
|
+
onClick={() => onTableClick(table)}
|
|
269
|
+
>
|
|
270
|
+
<ListItemText
|
|
271
|
+
primary={tableName}
|
|
272
|
+
secondary={`${table.columns.length} columns`}
|
|
273
|
+
/>
|
|
274
|
+
</ListItemButton>
|
|
275
|
+
);
|
|
276
|
+
},
|
|
277
|
+
)}
|
|
315
278
|
</List>
|
|
316
279
|
)}
|
|
317
280
|
</Box>
|
|
@@ -86,6 +86,16 @@ export default function DeletePackageDialog({
|
|
|
86
86
|
</Typography>
|
|
87
87
|
</DialogContent>
|
|
88
88
|
<DialogActions>
|
|
89
|
+
<Button
|
|
90
|
+
variant="outlined"
|
|
91
|
+
onClick={handleClose}
|
|
92
|
+
style={{
|
|
93
|
+
borderColor: "#14b3cb",
|
|
94
|
+
color: "#14b3cb",
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
Cancel
|
|
98
|
+
</Button>
|
|
89
99
|
<Button
|
|
90
100
|
variant="contained"
|
|
91
101
|
autoFocus
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Suspense, lazy } from "react";
|
|
2
|
-
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
3
|
-
import { Loading } from "../Loading";
|
|
4
2
|
import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
|
|
5
3
|
import { parseResourceUri } from "../../utils/formatting";
|
|
4
|
+
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
5
|
+
import { Loading } from "../Loading";
|
|
6
6
|
import { useServer } from "../ServerProvider";
|
|
7
7
|
|
|
8
8
|
const RenderedResult = lazy(() => import("../RenderedResult/RenderedResult"));
|
|
@@ -77,14 +77,16 @@ export default function QueryResult({
|
|
|
77
77
|
const { data, isSuccess, isError, error } = useQueryWithApiError({
|
|
78
78
|
queryKey: [resourceUri, query, sourceName, queryName],
|
|
79
79
|
queryFn: () =>
|
|
80
|
-
apiClients.
|
|
80
|
+
apiClients.models.executeQueryModel(
|
|
81
81
|
projectName,
|
|
82
82
|
packageName,
|
|
83
83
|
modelPath,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
{
|
|
85
|
+
query: query,
|
|
86
|
+
sourceName: sourceName,
|
|
87
|
+
queryName: queryName,
|
|
88
|
+
versionId: versionId,
|
|
89
|
+
},
|
|
88
90
|
),
|
|
89
91
|
});
|
|
90
92
|
|
|
@@ -8,8 +8,6 @@ import {
|
|
|
8
8
|
NotebooksApi,
|
|
9
9
|
PackagesApi,
|
|
10
10
|
ProjectsApi,
|
|
11
|
-
QueryresultsApi,
|
|
12
|
-
SchedulesApi,
|
|
13
11
|
WatchModeApi,
|
|
14
12
|
} from "../client";
|
|
15
13
|
import { Configuration } from "../client/configuration";
|
|
@@ -65,14 +63,12 @@ const getApiClients = (
|
|
|
65
63
|
const config = new Configuration({ basePath });
|
|
66
64
|
|
|
67
65
|
return {
|
|
68
|
-
queryResults: new QueryresultsApi(config, basePath, axiosInstance),
|
|
69
66
|
models: new ModelsApi(config, basePath, axiosInstance),
|
|
70
67
|
projects: new ProjectsApi(config, basePath, axiosInstance),
|
|
71
68
|
packages: new PackagesApi(config, basePath, axiosInstance),
|
|
72
69
|
notebooks: new NotebooksApi(config, basePath, axiosInstance),
|
|
73
70
|
connections: new ConnectionsApi(config, basePath, axiosInstance),
|
|
74
71
|
databases: new DatabasesApi(config, basePath, axiosInstance),
|
|
75
|
-
schedules: new SchedulesApi(config, basePath, axiosInstance),
|
|
76
72
|
watchMode: new WatchModeApi(config, basePath, axiosInstance),
|
|
77
73
|
};
|
|
78
74
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useServer } from "../components/ServerProvider";
|
|
1
2
|
import { parseResourceUri } from "../utils/formatting";
|
|
2
3
|
import { useQueryWithApiError } from "./useQueryWithApiError";
|
|
3
|
-
import { useServer } from "../components/ServerProvider";
|
|
4
4
|
|
|
5
5
|
interface UseRawQueryDataProps {
|
|
6
6
|
modelPath: string;
|
|
@@ -35,14 +35,16 @@ export function useRawQueryData({
|
|
|
35
35
|
queryName,
|
|
36
36
|
],
|
|
37
37
|
queryFn: () =>
|
|
38
|
-
apiClients.
|
|
38
|
+
apiClients.models.executeQueryModel(
|
|
39
39
|
projectName,
|
|
40
40
|
packageName,
|
|
41
41
|
modelPath,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
{
|
|
43
|
+
query: query,
|
|
44
|
+
sourceName: sourceName,
|
|
45
|
+
queryName: queryName,
|
|
46
|
+
versionId: versionId,
|
|
47
|
+
},
|
|
46
48
|
),
|
|
47
49
|
enabled,
|
|
48
50
|
});
|
package/src/utils/formatting.ts
CHANGED
|
@@ -23,7 +23,8 @@ export const parseResourceUri = (resourceUri: string) => {
|
|
|
23
23
|
parsedResource.connectionName =
|
|
24
24
|
decodeURI(pathParts[i + 1]) || undefined;
|
|
25
25
|
} else if (part === "models") {
|
|
26
|
-
parsedResource.modelPath =
|
|
26
|
+
parsedResource.modelPath =
|
|
27
|
+
decodeURI(pathParts.slice(i + 1).join("/")) || undefined;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
package/src/utils/parsing.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const getProjectDescription = (readme: string | undefined): string => {
|
|
|
15
15
|
|
|
16
16
|
// Get first paragraph (split by double newlines)
|
|
17
17
|
const paragraphs = cleanText.split(/\n\s*\n/);
|
|
18
|
-
const firstParagraph = paragraphs[
|
|
18
|
+
const firstParagraph = paragraphs[1] || cleanText;
|
|
19
19
|
|
|
20
20
|
// Limit to ~120 characters
|
|
21
21
|
if (firstParagraph.length <= 120) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const B=require("react/jsx-runtime"),$=require("@tanstack/react-query"),u=require("axios"),w=require("react"),M=new $.QueryClient({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),m="http://localhost/api/v0".replace(/\/+$/,"");class S{constructor(a,e=m,r=u){this.basePath=e,this.axios=r,a&&(this.configuration=a,this.basePath=a.basePath??e)}configuration}class le 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 le(a,`Required parameter ${a} was null or undefined when calling ${c}.`)};function U(c,a,e=""){a!=null&&(typeof a=="object"?Array.isArray(a)?a.forEach(r=>U(c,r,e)):Object.keys(a).forEach(r=>U(c,a[r],`${e}${e!==""?".":""}${r}`)):c.has(e)?c.append(e,a):c.set(e,a))}const O=function(c,...a){const e=new URLSearchParams(c.search);U(e,a),c.search=e.toString()},j=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||""},b=function(c){return c.pathname+c.search+c.hash},y=function(c,a,e,r){return(t=a,s=e)=>{const o={...c.options,url:(t.defaults.baseURL?"":r?.basePath??s)+c.url};return t.request(o)}},ie={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Mysql:"mysql"},pe={Ok:"ok",Failed:"failed"},he={Embedded:"embedded",Materialized:"materialized"},de={Markdown:"markdown",Code:"code"},E=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))),s=new URL(t,V);let o;c&&(o=c.baseOptions);const n={method:"GET",...o,...r},l={};O(s,{});let p=o&&o.headers?o.headers:{};return n.headers={...l,...p,...r.headers},{url:b(s),options:n}},getQuerydata:async(a,e,r,t,s={})=>{d("getQuerydata","projectName",a),d("getQuerydata","connectionName",e);const o="/projects/{projectName}/connections/{connectionName}/queryData".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),n=new URL(o,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...s},p={},h={};r!==void 0&&(h.sqlStatement=r),t!==void 0&&(h.options=t),O(n,h);let g=l&&l.headers?l.headers:{};return i.headers={...p,...g,...s.headers},{url:b(n),options:i}},getSqlsource:async(a,e,r,t={})=>{d("getSqlsource","projectName",a),d("getSqlsource","connectionName",e);const s="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.sqlStatement=r),O(o,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:b(o),options:l}},getTablesource:async(a,e,r,t,s={})=>{d("getTablesource","projectName",a),d("getTablesource","connectionName",e);const o="/projects/{projectName}/connections/{connectionName}/tableSource".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),n=new URL(o,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...s},p={},h={};r!==void 0&&(h.tableKey=r),t!==void 0&&(h.tablePath=t),O(n,h);let g=l&&l.headers?l.headers:{};return i.headers={...p,...g,...s.headers},{url:b(n),options:i}},getTemporarytable:async(a,e,r,t={})=>{d("getTemporarytable","projectName",a),d("getTemporarytable","connectionName",e);const s="/projects/{projectName}/connections/{connectionName}/temporaryTable".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.sqlStatement=r),O(o,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:b(o),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 s;c&&(s=c.baseOptions);const o={method:"GET",...s,...e},n={};O(t,{});let i=s&&s.headers?s.headers:{};return o.headers={...n,...i,...e.headers},{url:b(t),options:o}},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))),s=new URL(t,V);let o;c&&(o=c.baseOptions);const n={method:"GET",...o,...r},l={};O(s,{});let p=o&&o.headers?o.headers:{};return n.headers={...l,...p,...r.headers},{url:b(s),options:n}},listTables:async(a,e,r,t={})=>{d("listTables","projectName",a),d("listTables","connectionName",e),d("listTables","schemaName",r);const s="/projects/{projectName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))).replace("{schemaName}",encodeURIComponent(String(r))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={};O(o,{});let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:b(o),options:l}},postQuerydata:async(a,e,r,t,s={})=>{d("postQuerydata","projectName",a),d("postQuerydata","connectionName",e),d("postQuerydata","postSqlsourceRequest",r);const o="/projects/{projectName}/connections/{connectionName}/queryData".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),n=new URL(o,V);let l;c&&(l=c.baseOptions);const i={method:"POST",...l,...s},p={},h={};t!==void 0&&(h.options=t),p["Content-Type"]="application/json",O(n,h);let g=l&&l.headers?l.headers:{};return i.headers={...p,...g,...s.headers},i.data=j(r,i,c),{url:b(n),options:i}},postSqlsource:async(a,e,r,t={})=>{d("postSqlsource","projectName",a),d("postSqlsource","connectionName",e),d("postSqlsource","postSqlsourceRequest",r);const s="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"POST",...n,...t},i={},p={};i["Content-Type"]="application/json",O(o,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},l.data=j(r,l,c),{url:b(o),options:l}},postTemporarytable:async(a,e,r,t={})=>{d("postTemporarytable","projectName",a),d("postTemporarytable","connectionName",e),d("postTemporarytable","postSqlsourceRequest",r);const s="/projects/{projectName}/connections/{connectionName}/temporaryTable".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"POST",...n,...t},i={},p={};i["Content-Type"]="application/json",O(o,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},l.data=j(r,l,c),{url:b(o),options:l}},testConnection:async(a,e,r={})=>{d("testConnection","projectName",a),d("testConnection","connectionName",e);const t="/projects/{projectName}/connections/{connectionName}/test".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(t,V);let o;c&&(o=c.baseOptions);const n={method:"GET",...o,...r},l={};O(s,{});let p=o&&o.headers?o.headers:{};return n.headers={...l,...p,...r.headers},{url:b(s),options:n}},testConnectionConfiguration:async(a,e={})=>{d("testConnectionConfiguration","connection",a);const r="/connections/test",t=new URL(r,V);let s;c&&(s=c.baseOptions);const o={method:"POST",...s,...e},n={},l={};n["Content-Type"]="application/json",O(t,l);let i=s&&s.headers?s.headers:{};return o.headers={...n,...i,...e.headers},o.data=j(a,o,c),{url:b(t),options:o}}}},A=function(c){const a=E(c);return{async getConnection(e,r,t){const s=await a.getConnection(e,r,t),o=c?.serverIndex??0,n=P["ConnectionsApi.getConnection"]?.[o]?.url;return(l,i)=>y(s,u,m,c)(l,n||i)},async getQuerydata(e,r,t,s,o){const n=await a.getQuerydata(e,r,t,s,o),l=c?.serverIndex??0,i=P["ConnectionsApi.getQuerydata"]?.[l]?.url;return(p,h)=>y(n,u,m,c)(p,i||h)},async getSqlsource(e,r,t,s){const o=await a.getSqlsource(e,r,t,s),n=c?.serverIndex??0,l=P["ConnectionsApi.getSqlsource"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)},async getTablesource(e,r,t,s,o){const n=await a.getTablesource(e,r,t,s,o),l=c?.serverIndex??0,i=P["ConnectionsApi.getTablesource"]?.[l]?.url;return(p,h)=>y(n,u,m,c)(p,i||h)},async getTemporarytable(e,r,t,s){const o=await a.getTemporarytable(e,r,t,s),n=c?.serverIndex??0,l=P["ConnectionsApi.getTemporarytable"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)},async listConnections(e,r){const t=await a.listConnections(e,r),s=c?.serverIndex??0,o=P["ConnectionsApi.listConnections"]?.[s]?.url;return(n,l)=>y(t,u,m,c)(n,o||l)},async listSchemas(e,r,t){const s=await a.listSchemas(e,r,t),o=c?.serverIndex??0,n=P["ConnectionsApi.listSchemas"]?.[o]?.url;return(l,i)=>y(s,u,m,c)(l,n||i)},async listTables(e,r,t,s){const o=await a.listTables(e,r,t,s),n=c?.serverIndex??0,l=P["ConnectionsApi.listTables"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)},async postQuerydata(e,r,t,s,o){const n=await a.postQuerydata(e,r,t,s,o),l=c?.serverIndex??0,i=P["ConnectionsApi.postQuerydata"]?.[l]?.url;return(p,h)=>y(n,u,m,c)(p,i||h)},async postSqlsource(e,r,t,s){const o=await a.postSqlsource(e,r,t,s),n=c?.serverIndex??0,l=P["ConnectionsApi.postSqlsource"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)},async postTemporarytable(e,r,t,s){const o=await a.postTemporarytable(e,r,t,s),n=c?.serverIndex??0,l=P["ConnectionsApi.postTemporarytable"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)},async testConnection(e,r,t){const s=await a.testConnection(e,r,t),o=c?.serverIndex??0,n=P["ConnectionsApi.testConnection"]?.[o]?.url;return(l,i)=>y(s,u,m,c)(l,n||i)},async testConnectionConfiguration(e,r){const t=await a.testConnectionConfiguration(e,r),s=c?.serverIndex??0,o=P["ConnectionsApi.testConnectionConfiguration"]?.[s]?.url;return(n,l)=>y(t,u,m,c)(n,o||l)}}},ue=function(c,a,e){const r=A(c);return{getConnection(t,s,o){return r.getConnection(t,s,o).then(n=>n(e,a))},getQuerydata(t,s,o,n,l){return r.getQuerydata(t,s,o,n,l).then(i=>i(e,a))},getSqlsource(t,s,o,n){return r.getSqlsource(t,s,o,n).then(l=>l(e,a))},getTablesource(t,s,o,n,l){return r.getTablesource(t,s,o,n,l).then(i=>i(e,a))},getTemporarytable(t,s,o,n){return r.getTemporarytable(t,s,o,n).then(l=>l(e,a))},listConnections(t,s){return r.listConnections(t,s).then(o=>o(e,a))},listSchemas(t,s,o){return r.listSchemas(t,s,o).then(n=>n(e,a))},listTables(t,s,o,n){return r.listTables(t,s,o,n).then(l=>l(e,a))},postQuerydata(t,s,o,n,l){return r.postQuerydata(t,s,o,n,l).then(i=>i(e,a))},postSqlsource(t,s,o,n){return r.postSqlsource(t,s,o,n).then(l=>l(e,a))},postTemporarytable(t,s,o,n){return r.postTemporarytable(t,s,o,n).then(l=>l(e,a))},testConnection(t,s,o){return r.testConnection(t,s,o).then(n=>n(e,a))},testConnectionConfiguration(t,s){return r.testConnectionConfiguration(t,s).then(o=>o(e,a))}}};class L extends S{getConnection(a,e,r){return A(this.configuration).getConnection(a,e,r).then(t=>t(this.axios,this.basePath))}getQuerydata(a,e,r,t,s){return A(this.configuration).getQuerydata(a,e,r,t,s).then(o=>o(this.axios,this.basePath))}getSqlsource(a,e,r,t){return A(this.configuration).getSqlsource(a,e,r,t).then(s=>s(this.axios,this.basePath))}getTablesource(a,e,r,t,s){return A(this.configuration).getTablesource(a,e,r,t,s).then(o=>o(this.axios,this.basePath))}getTemporarytable(a,e,r,t){return A(this.configuration).getTemporarytable(a,e,r,t).then(s=>s(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(s=>s(this.axios,this.basePath))}postQuerydata(a,e,r,t,s){return A(this.configuration).postQuerydata(a,e,r,t,s).then(o=>o(this.axios,this.basePath))}postSqlsource(a,e,r,t){return A(this.configuration).postSqlsource(a,e,r,t).then(s=>s(this.axios,this.basePath))}postTemporarytable(a,e,r,t){return A(this.configuration).postTemporarytable(a,e,r,t).then(s=>s(this.axios,this.basePath))}testConnection(a,e,r){return A(this.configuration).testConnection(a,e,r).then(t=>t(this.axios,this.basePath))}testConnectionConfiguration(a,e){return A(this.configuration).testConnectionConfiguration(a,e).then(r=>r(this.axios,this.basePath))}}const H=function(c){return{listDatabases:async(a,e,r,t={})=>{d("listDatabases","projectName",a),d("listDatabases","packageName",e);const s="/projects/{projectName}/packages/{packageName}/databases".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),O(o,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:b(o),options:l}}}},T=function(c){const a=H(c);return{async listDatabases(e,r,t,s){const o=await a.listDatabases(e,r,t,s),n=c?.serverIndex??0,l=P["DatabasesApi.listDatabases"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)}}},me=function(c,a,e){const r=T(c);return{listDatabases(t,s,o,n){return r.listDatabases(t,s,o,n).then(l=>l(e,a))}}};class W extends S{listDatabases(a,e,r,t){return T(this.configuration).listDatabases(a,e,r,t).then(s=>s(this.axios,this.basePath))}}const D=function(c){return{getModel:async(a,e,r,t,s={})=>{d("getModel","projectName",a),d("getModel","packageName",e),d("getModel","path",r);const o="/projects/{projectName}/packages/{packageName}/models/{path}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),n=new URL(o,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...s},p={},h={};t!==void 0&&(h.versionId=t),O(n,h);let g=l&&l.headers?l.headers:{};return i.headers={...p,...g,...s.headers},{url:b(n),options:i}},listModels:async(a,e,r,t={})=>{d("listModels","projectName",a),d("listModels","packageName",e);const s="/projects/{projectName}/packages/{packageName}/models".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),O(o,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:b(o),options:l}}}},N=function(c){const a=D(c);return{async getModel(e,r,t,s,o){const n=await a.getModel(e,r,t,s,o),l=c?.serverIndex??0,i=P["ModelsApi.getModel"]?.[l]?.url;return(p,h)=>y(n,u,m,c)(p,i||h)},async listModels(e,r,t,s){const o=await a.listModels(e,r,t,s),n=c?.serverIndex??0,l=P["ModelsApi.listModels"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)}}},Pe=function(c,a,e){const r=N(c);return{getModel(t,s,o,n,l){return r.getModel(t,s,o,n,l).then(i=>i(e,a))},listModels(t,s,o,n){return r.listModels(t,s,o,n).then(l=>l(e,a))}}};class f extends S{getModel(a,e,r,t,s){return N(this.configuration).getModel(a,e,r,t,s).then(o=>o(this.axios,this.basePath))}listModels(a,e,r,t){return N(this.configuration).listModels(a,e,r,t).then(s=>s(this.axios,this.basePath))}}const G=function(c){return{getNotebook:async(a,e,r,t,s={})=>{d("getNotebook","projectName",a),d("getNotebook","packageName",e),d("getNotebook","path",r);const o="/projects/{projectName}/packages/{packageName}/notebooks/{path}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),n=new URL(o,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...s},p={},h={};t!==void 0&&(h.versionId=t),O(n,h);let g=l&&l.headers?l.headers:{};return i.headers={...p,...g,...s.headers},{url:b(n),options:i}},listNotebooks:async(a,e,r,t={})=>{d("listNotebooks","projectName",a),d("listNotebooks","packageName",e);const s="/projects/{projectName}/packages/{packageName}/notebooks".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),O(o,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:b(o),options:l}}}},R=function(c){const a=G(c);return{async getNotebook(e,r,t,s,o){const n=await a.getNotebook(e,r,t,s,o),l=c?.serverIndex??0,i=P["NotebooksApi.getNotebook"]?.[l]?.url;return(p,h)=>y(n,u,m,c)(p,i||h)},async listNotebooks(e,r,t,s){const o=await a.listNotebooks(e,r,t,s),n=c?.serverIndex??0,l=P["NotebooksApi.listNotebooks"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)}}},Ve=function(c,a,e){const r=R(c);return{getNotebook(t,s,o,n,l){return r.getNotebook(t,s,o,n,l).then(i=>i(e,a))},listNotebooks(t,s,o,n){return r.listNotebooks(t,s,o,n).then(l=>l(e,a))}}};class z extends S{getNotebook(a,e,r,t,s){return R(this.configuration).getNotebook(a,e,r,t,s).then(o=>o(this.axios,this.basePath))}listNotebooks(a,e,r,t){return R(this.configuration).listNotebooks(a,e,r,t).then(s=>s(this.axios,this.basePath))}}const J=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))),s=new URL(t,V);let o;c&&(o=c.baseOptions);const n={method:"POST",...o,...r},l={},i={};l["Content-Type"]="application/json",O(s,i);let p=o&&o.headers?o.headers:{};return n.headers={...l,...p,...r.headers},n.data=j(e,n,c),{url:b(s),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))),s=new URL(t,V);let o;c&&(o=c.baseOptions);const n={method:"DELETE",...o,...r},l={};O(s,{});let p=o&&o.headers?o.headers:{};return n.headers={...l,...p,...r.headers},{url:b(s),options:n}},getPackage:async(a,e,r,t,s={})=>{d("getPackage","projectName",a),d("getPackage","packageName",e);const o="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),n=new URL(o,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...s},p={},h={};r!==void 0&&(h.versionId=r),t!==void 0&&(h.reload=t),O(n,h);let g=l&&l.headers?l.headers:{};return i.headers={...p,...g,...s.headers},{url:b(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 s;c&&(s=c.baseOptions);const o={method:"GET",...s,...e},n={};O(t,{});let i=s&&s.headers?s.headers:{};return o.headers={...n,...i,...e.headers},{url:b(t),options:o}},updatePackage:async(a,e,r,t={})=>{d("updatePackage","projectName",a),d("updatePackage","packageName",e),d("updatePackage","_package",r);const s="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"PATCH",...n,...t},i={},p={};i["Content-Type"]="application/json",O(o,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},l.data=j(r,l,c),{url:b(o),options:l}}}},x=function(c){const a=J(c);return{async createPackage(e,r,t){const s=await a.createPackage(e,r,t),o=c?.serverIndex??0,n=P["PackagesApi.createPackage"]?.[o]?.url;return(l,i)=>y(s,u,m,c)(l,n||i)},async deletePackage(e,r,t){const s=await a.deletePackage(e,r,t),o=c?.serverIndex??0,n=P["PackagesApi.deletePackage"]?.[o]?.url;return(l,i)=>y(s,u,m,c)(l,n||i)},async getPackage(e,r,t,s,o){const n=await a.getPackage(e,r,t,s,o),l=c?.serverIndex??0,i=P["PackagesApi.getPackage"]?.[l]?.url;return(p,h)=>y(n,u,m,c)(p,i||h)},async listPackages(e,r){const t=await a.listPackages(e,r),s=c?.serverIndex??0,o=P["PackagesApi.listPackages"]?.[s]?.url;return(n,l)=>y(t,u,m,c)(n,o||l)},async updatePackage(e,r,t,s){const o=await a.updatePackage(e,r,t,s),n=c?.serverIndex??0,l=P["PackagesApi.updatePackage"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)}}},Oe=function(c,a,e){const r=x(c);return{createPackage(t,s,o){return r.createPackage(t,s,o).then(n=>n(e,a))},deletePackage(t,s,o){return r.deletePackage(t,s,o).then(n=>n(e,a))},getPackage(t,s,o,n,l){return r.getPackage(t,s,o,n,l).then(i=>i(e,a))},listPackages(t,s){return r.listPackages(t,s).then(o=>o(e,a))},updatePackage(t,s,o,n){return r.updatePackage(t,s,o,n).then(l=>l(e,a))}}};class K extends S{createPackage(a,e,r){return x(this.configuration).createPackage(a,e,r).then(t=>t(this.axios,this.basePath))}deletePackage(a,e,r){return x(this.configuration).deletePackage(a,e,r).then(t=>t(this.axios,this.basePath))}getPackage(a,e,r,t,s){return x(this.configuration).getPackage(a,e,r,t,s).then(o=>o(this.axios,this.basePath))}listPackages(a,e){return x(this.configuration).listPackages(a,e).then(r=>r(this.axios,this.basePath))}updatePackage(a,e,r,t){return x(this.configuration).updatePackage(a,e,r,t).then(s=>s(this.axios,this.basePath))}}const Y=function(c){return{createProject:async(a,e={})=>{d("createProject","project",a);const r="/projects",t=new URL(r,V);let s;c&&(s=c.baseOptions);const o={method:"POST",...s,...e},n={},l={};n["Content-Type"]="application/json",O(t,l);let i=s&&s.headers?s.headers:{};return o.headers={...n,...i,...e.headers},o.data=j(a,o,c),{url:b(t),options:o}},deleteProject:async(a,e={})=>{d("deleteProject","projectName",a);const r="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(a))),t=new URL(r,V);let s;c&&(s=c.baseOptions);const o={method:"DELETE",...s,...e},n={};O(t,{});let i=s&&s.headers?s.headers:{};return o.headers={...n,...i,...e.headers},{url:b(t),options:o}},getProject:async(a,e,r={})=>{d("getProject","projectName",a);const t="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(a))),s=new URL(t,V);let o;c&&(o=c.baseOptions);const n={method:"GET",...o,...r},l={},i={};e!==void 0&&(i.reload=e),O(s,i);let p=o&&o.headers?o.headers:{};return n.headers={...l,...p,...r.headers},{url:b(s),options:n}},listProjects:async(a={})=>{const e="/projects",r=new URL(e,V);let t;c&&(t=c.baseOptions);const s={method:"GET",...t,...a},o={};O(r,{});let l=t&&t.headers?t.headers:{};return s.headers={...o,...l,...a.headers},{url:b(r),options:s}},updateProject:async(a,e,r={})=>{d("updateProject","projectName",a),d("updateProject","project",e);const t="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(a))),s=new URL(t,V);let o;c&&(o=c.baseOptions);const n={method:"PATCH",...o,...r},l={},i={};l["Content-Type"]="application/json",O(s,i);let p=o&&o.headers?o.headers:{};return n.headers={...l,...p,...r.headers},n.data=j(e,n,c),{url:b(s),options:n}}}},v=function(c){const a=Y(c);return{async createProject(e,r){const t=await a.createProject(e,r),s=c?.serverIndex??0,o=P["ProjectsApi.createProject"]?.[s]?.url;return(n,l)=>y(t,u,m,c)(n,o||l)},async deleteProject(e,r){const t=await a.deleteProject(e,r),s=c?.serverIndex??0,o=P["ProjectsApi.deleteProject"]?.[s]?.url;return(n,l)=>y(t,u,m,c)(n,o||l)},async getProject(e,r,t){const s=await a.getProject(e,r,t),o=c?.serverIndex??0,n=P["ProjectsApi.getProject"]?.[o]?.url;return(l,i)=>y(s,u,m,c)(l,n||i)},async listProjects(e){const r=await a.listProjects(e),t=c?.serverIndex??0,s=P["ProjectsApi.listProjects"]?.[t]?.url;return(o,n)=>y(r,u,m,c)(o,s||n)},async updateProject(e,r,t){const s=await a.updateProject(e,r,t),o=c?.serverIndex??0,n=P["ProjectsApi.updateProject"]?.[o]?.url;return(l,i)=>y(s,u,m,c)(l,n||i)}}},be=function(c,a,e){const r=v(c);return{createProject(t,s){return r.createProject(t,s).then(o=>o(e,a))},deleteProject(t,s){return r.deleteProject(t,s).then(o=>o(e,a))},getProject(t,s,o){return r.getProject(t,s,o).then(n=>n(e,a))},listProjects(t){return r.listProjects(t).then(s=>s(e,a))},updateProject(t,s,o){return r.updateProject(t,s,o).then(n=>n(e,a))}}};class _ extends S{createProject(a,e){return v(this.configuration).createProject(a,e).then(r=>r(this.axios,this.basePath))}deleteProject(a,e){return v(this.configuration).deleteProject(a,e).then(r=>r(this.axios,this.basePath))}getProject(a,e,r){return v(this.configuration).getProject(a,e,r).then(t=>t(this.axios,this.basePath))}listProjects(a){return v(this.configuration).listProjects(a).then(e=>e(this.axios,this.basePath))}updateProject(a,e,r){return v(this.configuration).updateProject(a,e,r).then(t=>t(this.axios,this.basePath))}}const X=function(c){return{getStatus:async(a={})=>{const e="/status",r=new URL(e,V);let t;c&&(t=c.baseOptions);const s={method:"GET",...t,...a},o={};O(r,{});let l=t&&t.headers?t.headers:{};return s.headers={...o,...l,...a.headers},{url:b(r),options:s}}}},Q=function(c){const a=X(c);return{async getStatus(e){const r=await a.getStatus(e),t=c?.serverIndex??0,s=P["PublisherApi.getStatus"]?.[t]?.url;return(o,n)=>y(r,u,m,c)(o,s||n)}}},ye=function(c,a,e){const r=Q(c);return{getStatus(t){return r.getStatus(t).then(s=>s(e,a))}}};class ge extends S{getStatus(a){return Q(this.configuration).getStatus(a).then(e=>e(this.axios,this.basePath))}}const Z=function(c){return{executeQuery:async(a,e,r,t,s,o,n,l={})=>{d("executeQuery","projectName",a),d("executeQuery","packageName",e),d("executeQuery","path",r);const i="/projects/{projectName}/packages/{packageName}/queryResults/{path}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),p=new URL(i,V);let h;c&&(h=c.baseOptions);const g={method:"GET",...h,...l},I={},C={};t!==void 0&&(C.query=t),s!==void 0&&(C.sourceName=s),o!==void 0&&(C.queryName=o),n!==void 0&&(C.versionId=n),O(p,C);let ce=h&&h.headers?h.headers:{};return g.headers={...I,...ce,...l.headers},{url:b(p),options:g}}}},F=function(c){const a=Z(c);return{async executeQuery(e,r,t,s,o,n,l,i){const p=await a.executeQuery(e,r,t,s,o,n,l,i),h=c?.serverIndex??0,g=P["QueryresultsApi.executeQuery"]?.[h]?.url;return(I,C)=>y(p,u,m,c)(I,g||C)}}},Ae=function(c,a,e){const r=F(c);return{executeQuery(t,s,o,n,l,i,p,h){return r.executeQuery(t,s,o,n,l,i,p,h).then(g=>g(e,a))}}};class ee extends S{executeQuery(a,e,r,t,s,o,n,l){return F(this.configuration).executeQuery(a,e,r,t,s,o,n,l).then(i=>i(this.axios,this.basePath))}}const te=function(c){return{listSchedules:async(a,e,r,t={})=>{d("listSchedules","projectName",a),d("listSchedules","packageName",e);const s="/projects/{projectName}/packages/{packageName}/schedules".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(s,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),O(o,p);let h=n&&n.headers?n.headers:{};return l.headers={...i,...h,...t.headers},{url:b(o),options:l}}}},q=function(c){const a=te(c);return{async listSchedules(e,r,t,s){const o=await a.listSchedules(e,r,t,s),n=c?.serverIndex??0,l=P["SchedulesApi.listSchedules"]?.[n]?.url;return(i,p)=>y(o,u,m,c)(i,l||p)}}},Se=function(c,a,e){const r=q(c);return{listSchedules(t,s,o,n){return r.listSchedules(t,s,o,n).then(l=>l(e,a))}}};class ae extends S{listSchedules(a,e,r,t){return q(this.configuration).listSchedules(a,e,r,t).then(s=>s(this.axios,this.basePath))}}const re=function(c){return{getWatchStatus:async(a={})=>{const e="/watch-mode/status",r=new URL(e,V);let t;c&&(t=c.baseOptions);const s={method:"GET",...t,...a},o={};O(r,{});let l=t&&t.headers?t.headers:{};return s.headers={...o,...l,...a.headers},{url:b(r),options:s}},startWatching:async(a,e={})=>{d("startWatching","startWatchRequest",a);const r="/watch-mode/start",t=new URL(r,V);let s;c&&(s=c.baseOptions);const o={method:"POST",...s,...e},n={},l={};n["Content-Type"]="application/json",O(t,l);let i=s&&s.headers?s.headers:{};return o.headers={...n,...i,...e.headers},o.data=j(a,o,c),{url:b(t),options:o}},stopWatching:async(a={})=>{const e="/watch-mode/stop",r=new URL(e,V);let t;c&&(t=c.baseOptions);const s={method:"POST",...t,...a},o={};O(r,{});let l=t&&t.headers?t.headers:{};return s.headers={...o,...l,...a.headers},{url:b(r),options:s}}}},k=function(c){const a=re(c);return{async getWatchStatus(e){const r=await a.getWatchStatus(e),t=c?.serverIndex??0,s=P["WatchModeApi.getWatchStatus"]?.[t]?.url;return(o,n)=>y(r,u,m,c)(o,s||n)},async startWatching(e,r){const t=await a.startWatching(e,r),s=c?.serverIndex??0,o=P["WatchModeApi.startWatching"]?.[s]?.url;return(n,l)=>y(t,u,m,c)(n,o||l)},async stopWatching(e){const r=await a.stopWatching(e),t=c?.serverIndex??0,s=P["WatchModeApi.stopWatching"]?.[t]?.url;return(o,n)=>y(r,u,m,c)(o,s||n)}}},je=function(c,a,e){const r=k(c);return{getWatchStatus(t){return r.getWatchStatus(t).then(s=>s(e,a))},startWatching(t,s){return r.startWatching(t,s).then(o=>o(e,a))},stopWatching(t){return r.stopWatching(t).then(s=>s(e,a))}}};class se extends S{getWatchStatus(a){return k(this.configuration).getWatchStatus(a).then(e=>e(this.axios,this.basePath))}startWatching(a,e){return k(this.configuration).startWatching(a,e).then(r=>r(this.axios,this.basePath))}stopWatching(a){return k(this.configuration).stopWatching(a).then(e=>e(this.axios,this.basePath))}}class oe{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 ne=w.createContext(void 0),Ce=(c,a)=>{const e=`${window.location.protocol}//${window.location.host}/api/v0`,r=u.create({baseURL:c||e,withCredentials:!0});r.interceptors.request.use(async s=>{const o=await a?.();return s.headers.Authorization=o?`Bearer ${o}`:"",s});const t=new oe({basePath:e});return{queryResults:new ee(t,e,r),models:new f(t,e,r),projects:new _(t,e,r),packages:new K(t,e,r),notebooks:new z(t,e,r),connections:new L(t,e,r),databases:new W(t,e,r),schedules:new ae(t,e,r),watchMode:new se(t,e,r)}},xe=({children:c,getAccessToken:a,baseURL:e,mutable:r=!0})=>{const t=w.useMemo(()=>Ce(e,a),[e,a]),s={server:e||`${window.location.protocol}//${window.location.host}/api/v0`,getAccessToken:a,apiClients:t,mutable:r};return B.jsx($.QueryClientProvider,{client:M,children:B.jsx(ne.Provider,{value:s,children:c})})},ve=()=>{const c=w.useContext(ne);if(c===void 0)throw new Error("useServer must be used within a ServerProvider");return c};exports.Configuration=oe;exports.ConnectionStatusStatusEnum=pe;exports.ConnectionTypeEnum=ie;exports.ConnectionsApi=L;exports.ConnectionsApiAxiosParamCreator=E;exports.ConnectionsApiFactory=ue;exports.ConnectionsApiFp=A;exports.DatabaseTypeEnum=he;exports.DatabasesApi=W;exports.DatabasesApiAxiosParamCreator=H;exports.DatabasesApiFactory=me;exports.DatabasesApiFp=T;exports.ModelsApi=f;exports.ModelsApiAxiosParamCreator=D;exports.ModelsApiFactory=Pe;exports.ModelsApiFp=N;exports.NotebookCellTypeEnum=de;exports.NotebooksApi=z;exports.NotebooksApiAxiosParamCreator=G;exports.NotebooksApiFactory=Ve;exports.NotebooksApiFp=R;exports.PackagesApi=K;exports.PackagesApiAxiosParamCreator=J;exports.PackagesApiFactory=Oe;exports.PackagesApiFp=x;exports.ProjectsApi=_;exports.ProjectsApiAxiosParamCreator=Y;exports.ProjectsApiFactory=be;exports.ProjectsApiFp=v;exports.PublisherApi=ge;exports.PublisherApiAxiosParamCreator=X;exports.PublisherApiFactory=ye;exports.PublisherApiFp=Q;exports.QueryresultsApi=ee;exports.QueryresultsApiAxiosParamCreator=Z;exports.QueryresultsApiFactory=Ae;exports.QueryresultsApiFp=F;exports.SchedulesApi=ae;exports.SchedulesApiAxiosParamCreator=te;exports.SchedulesApiFactory=Se;exports.SchedulesApiFp=q;exports.ServerProvider=xe;exports.WatchModeApi=se;exports.WatchModeApiAxiosParamCreator=re;exports.WatchModeApiFactory=je;exports.WatchModeApiFp=k;exports.globalQueryClient=M;exports.useServer=ve;
|