@malloy-publisher/sdk 0.0.135 → 0.0.138
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-BGGK1ZQ_.es.js → ServerProvider-B8JWg8Mo.es.js} +563 -491
- package/dist/ServerProvider-DC74Txr5.cjs.js +1 -0
- package/dist/client/api.d.ts +126 -53
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +22 -21
- package/dist/components/Notebook/NotebookCell.d.ts +2 -2
- package/dist/components/Notebook/types.d.ts +21 -0
- package/dist/index.cjs.js +15 -15
- package/dist/index.es.js +483 -418
- package/package.json +1 -1
- package/src/components/Notebook/Notebook.tsx +106 -5
- package/src/components/Notebook/NotebookCell.tsx +2 -2
- package/src/components/Notebook/types.ts +24 -0
- package/src/components/Package/Connections.tsx +3 -6
- package/dist/ServerProvider-lXAaPKBb.cjs.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "@malloydata/malloy-explorer/styles.css";
|
|
2
2
|
import { Stack, Typography } from "@mui/material";
|
|
3
|
-
import {
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { RawNotebook } from "../../client";
|
|
4
5
|
import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
|
|
5
6
|
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
6
7
|
|
|
@@ -9,6 +10,7 @@ import { Loading } from "../Loading";
|
|
|
9
10
|
import { useServer } from "../ServerProvider";
|
|
10
11
|
import { CleanNotebookContainer, CleanNotebookSection } from "../styles";
|
|
11
12
|
import { NotebookCell } from "./NotebookCell";
|
|
13
|
+
import { EnhancedNotebookCell } from "./types";
|
|
12
14
|
|
|
13
15
|
interface NotebookProps {
|
|
14
16
|
resourceUri: string;
|
|
@@ -27,12 +29,14 @@ export default function Notebook({
|
|
|
27
29
|
versionId,
|
|
28
30
|
modelPath: notebookPath,
|
|
29
31
|
} = parseResourceUri(resourceUri);
|
|
32
|
+
|
|
33
|
+
// Fetch the raw notebook cells
|
|
30
34
|
const {
|
|
31
35
|
data: notebook,
|
|
32
36
|
isSuccess,
|
|
33
37
|
isError,
|
|
34
38
|
error,
|
|
35
|
-
} = useQueryWithApiError<
|
|
39
|
+
} = useQueryWithApiError<RawNotebook>({
|
|
36
40
|
queryKey: [resourceUri],
|
|
37
41
|
queryFn: async () => {
|
|
38
42
|
const response = await apiClients.notebooks.getNotebook(
|
|
@@ -45,15 +49,101 @@ export default function Notebook({
|
|
|
45
49
|
},
|
|
46
50
|
});
|
|
47
51
|
|
|
52
|
+
// State to store executed cells with results
|
|
53
|
+
const [enhancedCells, setEnhancedCells] = useState<EnhancedNotebookCell[]>(
|
|
54
|
+
[],
|
|
55
|
+
);
|
|
56
|
+
const [isExecuting, setIsExecuting] = useState(false);
|
|
57
|
+
const [executionError, setExecutionError] = useState<Error | null>(null);
|
|
58
|
+
|
|
59
|
+
// Execute cells sequentially when notebook is loaded
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!isSuccess || !notebook.notebookCells) return;
|
|
62
|
+
|
|
63
|
+
const executeCells = async () => {
|
|
64
|
+
setIsExecuting(true);
|
|
65
|
+
setExecutionError(null);
|
|
66
|
+
const cells: EnhancedNotebookCell[] = [];
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
// Execute cells sequentially
|
|
70
|
+
for (let i = 0; i < notebook.notebookCells.length; i++) {
|
|
71
|
+
const rawCell = notebook.notebookCells[i];
|
|
72
|
+
|
|
73
|
+
// Markdown cells don't need execution - use raw content directly
|
|
74
|
+
if (rawCell.type === "markdown") {
|
|
75
|
+
cells.push({
|
|
76
|
+
type: rawCell.type,
|
|
77
|
+
text: rawCell.text,
|
|
78
|
+
});
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Execute code cells
|
|
83
|
+
try {
|
|
84
|
+
// Call the executeNotebookCell API
|
|
85
|
+
const response = await fetch(
|
|
86
|
+
`/api/v0/projects/${projectName}/packages/${packageName}/notebooks/${notebookPath}/cells/${i}${versionId ? `?versionId=${versionId}` : ""}`,
|
|
87
|
+
{
|
|
88
|
+
method: "GET",
|
|
89
|
+
credentials: "include",
|
|
90
|
+
},
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
if (!response.ok) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`Failed to execute cell ${i}: ${response.statusText}`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const executedCell = await response.json();
|
|
100
|
+
|
|
101
|
+
// Combine raw cell with execution results
|
|
102
|
+
cells.push({
|
|
103
|
+
type: rawCell.type,
|
|
104
|
+
text: rawCell.text,
|
|
105
|
+
queryName: executedCell.queryName,
|
|
106
|
+
result: executedCell.result,
|
|
107
|
+
newSources: executedCell.newSources,
|
|
108
|
+
});
|
|
109
|
+
} catch (cellError) {
|
|
110
|
+
// If a cell fails, add it without execution results
|
|
111
|
+
console.error(`Error executing cell ${i}:`, cellError);
|
|
112
|
+
cells.push({
|
|
113
|
+
type: rawCell.type,
|
|
114
|
+
text: rawCell.text,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
setEnhancedCells(cells);
|
|
120
|
+
} catch (error) {
|
|
121
|
+
console.error("Error executing notebook cells:", error);
|
|
122
|
+
setExecutionError(error as Error);
|
|
123
|
+
} finally {
|
|
124
|
+
setIsExecuting(false);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
executeCells();
|
|
129
|
+
}, [isSuccess, notebook, projectName, packageName, notebookPath, versionId]);
|
|
130
|
+
|
|
48
131
|
return (
|
|
49
132
|
<CleanNotebookContainer>
|
|
50
133
|
<CleanNotebookSection>
|
|
51
134
|
<Stack spacing={3} component="section">
|
|
52
|
-
{!isSuccess && !isError && (
|
|
53
|
-
<Loading
|
|
135
|
+
{(!isSuccess || isExecuting) && !isError && (
|
|
136
|
+
<Loading
|
|
137
|
+
text={
|
|
138
|
+
isExecuting
|
|
139
|
+
? "Executing Notebook..."
|
|
140
|
+
: "Fetching Notebook..."
|
|
141
|
+
}
|
|
142
|
+
/>
|
|
54
143
|
)}
|
|
55
144
|
{isSuccess &&
|
|
56
|
-
|
|
145
|
+
!isExecuting &&
|
|
146
|
+
enhancedCells.map((cell, index) => (
|
|
57
147
|
<NotebookCell
|
|
58
148
|
cell={cell}
|
|
59
149
|
key={index}
|
|
@@ -75,6 +165,17 @@ export default function Notebook({
|
|
|
75
165
|
context={`${projectName} > ${packageName} > ${notebookPath}`}
|
|
76
166
|
/>
|
|
77
167
|
)}
|
|
168
|
+
|
|
169
|
+
{executionError && (
|
|
170
|
+
<ApiErrorDisplay
|
|
171
|
+
error={{
|
|
172
|
+
message: executionError.message,
|
|
173
|
+
status: 500,
|
|
174
|
+
name: "ExecutionError",
|
|
175
|
+
}}
|
|
176
|
+
context="Notebook Execution"
|
|
177
|
+
/>
|
|
178
|
+
)}
|
|
78
179
|
</Stack>
|
|
79
180
|
</CleanNotebookSection>
|
|
80
181
|
</CleanNotebookContainer>
|
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
} from "@mui/material";
|
|
17
17
|
import Markdown from "markdown-to-jsx";
|
|
18
18
|
import React, { useEffect, useState } from "react";
|
|
19
|
-
import { NotebookCell as ClientNotebookCell } from "../../client";
|
|
20
19
|
import { highlight } from "../highlighter";
|
|
21
20
|
import { ModelExplorerDialog } from "../Model/ModelExplorerDialog";
|
|
22
21
|
import { createEmbeddedQueryResult } from "../QueryResult/QueryResult";
|
|
23
22
|
import ResultContainer from "../RenderedResult/ResultContainer";
|
|
24
23
|
import ResultsDialog from "../ResultsDialog";
|
|
25
24
|
import { CleanMetricCard, CleanNotebookCell } from "../styles";
|
|
25
|
+
import { EnhancedNotebookCell } from "./types";
|
|
26
26
|
|
|
27
27
|
interface NotebookCellProps {
|
|
28
|
-
cell:
|
|
28
|
+
cell: EnhancedNotebookCell;
|
|
29
29
|
expandCodeCell?: boolean;
|
|
30
30
|
hideCodeCellIcon?: boolean;
|
|
31
31
|
expandEmbedding?: boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NotebookCell as ClientNotebookCell } from "../../client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enhanced notebook cell that extends the base API cell with execution results.
|
|
5
|
+
* The base ClientNotebookCell only contains type and text (raw content).
|
|
6
|
+
* This interface adds the runtime execution data.
|
|
7
|
+
*/
|
|
8
|
+
export interface EnhancedNotebookCell extends ClientNotebookCell {
|
|
9
|
+
/**
|
|
10
|
+
* Name of the query that was executed (for code cells that run queries)
|
|
11
|
+
*/
|
|
12
|
+
queryName?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* JSON string containing the query execution results
|
|
16
|
+
*/
|
|
17
|
+
result?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Array of JSON strings containing SourceInfo objects for data sources
|
|
21
|
+
* that become available in this cell (e.g., from imports or source definitions)
|
|
22
|
+
*/
|
|
23
|
+
newSources?: string[];
|
|
24
|
+
}
|
|
@@ -121,6 +121,7 @@ export default function Connections({ resourceUri }: ConnectionsProps) {
|
|
|
121
121
|
projectName: projectName,
|
|
122
122
|
connectionName: selectedConnection,
|
|
123
123
|
});
|
|
124
|
+
|
|
124
125
|
const { data, isSuccess, isError, error } = useQueryWithApiError({
|
|
125
126
|
queryKey: ["connections", projectName],
|
|
126
127
|
queryFn: () => apiClients.connections.listConnections(projectName),
|
|
@@ -275,15 +276,11 @@ export default function Connections({ resourceUri }: ConnectionsProps) {
|
|
|
275
276
|
updateConnection.mutateAsync(payload)
|
|
276
277
|
}
|
|
277
278
|
onDelete={(payload) => {
|
|
278
|
-
if (
|
|
279
|
-
!selectedConnectionResourceUri.startsWith(
|
|
280
|
-
"publisher:",
|
|
281
|
-
)
|
|
282
|
-
) {
|
|
279
|
+
if (!conn.resource) {
|
|
283
280
|
deleteConnection.mutateAsync(payload);
|
|
284
281
|
} else {
|
|
285
282
|
setNotificationMessage(
|
|
286
|
-
"Cannot delete this connection
|
|
283
|
+
"Cannot delete this connection",
|
|
287
284
|
);
|
|
288
285
|
}
|
|
289
286
|
}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const Q=require("react/jsx-runtime"),F=require("@tanstack/react-query"),u=require("axios"),I=require("react"),q=new F.QueryClient({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),m="http://localhost/api/v0".replace(/\/+$/,"");class j{constructor(a,e=m,r=u){this.basePath=e,this.axios=r,a&&(this.configuration=a,this.basePath=a.basePath??e)}configuration}class te 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 te(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)}},ae={Bigquery:"bigquery",Snowflake:"snowflake",Postgres:"postgres"},re={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Mysql:"mysql",Duckdb:"duckdb",Motherduck:"motherduck"},oe={Ok:"ok",Failed:"failed"},se={Embedded:"embedded",Materialized:"materialized"},ne={Markdown:"markdown",Code:"code"},B=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=B(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)}}},ce=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 M extends j{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 $=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}}}},T=function(c){const a=$(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)}}},le=function(c,a,e){const r=T(c);return{testConnectionConfiguration(t,o){return r.testConnectionConfiguration(t,o).then(s=>s(e,a))}}};class ie extends j{testConnectionConfiguration(a,e){return T(this.configuration).testConnectionConfiguration(a,e).then(r=>r(this.axios,this.basePath))}}const E=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}}}},U=function(c){const a=E(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)}}},pe=function(c,a,e){const r=U(c);return{listDatabases(t,o,s,n){return r.listDatabases(t,o,s,n).then(l=>l(e,a))}}};class L extends j{listDatabases(a,e,r,t){return U(this.configuration).listDatabases(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const H=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=H(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)}}},de=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 W extends j{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 D=function(c){return{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=D(c);return{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)}}},he=function(c,a,e){const r=N(c);return{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 G extends j{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 f=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}}}},C=function(c){const a=f(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)}}},ue=function(c,a,e){const r=C(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 z extends j{createPackage(a,e,r){return C(this.configuration).createPackage(a,e,r).then(t=>t(this.axios,this.basePath))}deletePackage(a,e,r){return C(this.configuration).deletePackage(a,e,r).then(t=>t(this.axios,this.basePath))}getPackage(a,e,r,t,o){return C(this.configuration).getPackage(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listPackages(a,e){return C(this.configuration).listPackages(a,e).then(r=>r(this.axios,this.basePath))}updatePackage(a,e,r,t){return C(this.configuration).updatePackage(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const J=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=J(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)}}},me=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 K extends j{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 Y=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=Y(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)}}},Pe=function(c,a,e){const r=w(c);return{getStatus(t){return r.getStatus(t).then(o=>o(e,a))}}};class Ve extends j{getStatus(a){return w(this.configuration).getStatus(a).then(e=>e(this.axios,this.basePath))}}const _=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=_(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)}}},be=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 X extends j{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 Z{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 ee=I.createContext(void 0),Oe=(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 Z({basePath:e});return{models:new W(t,e,r),projects:new K(t,e,r),packages:new z(t,e,r),notebooks:new G(t,e,r),connections:new M(t,e,r),databases:new L(t,e,r),watchMode:new X(t,e,r)}},ge=({children:c,getAccessToken:a,baseURL:e,mutable:r=!0})=>{const t=I.useMemo(()=>Oe(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:q,children:Q.jsx(ee.Provider,{value:o,children:c})})},ye=()=>{const c=I.useContext(ee);if(c===void 0)throw new Error("useServer must be used within a ServerProvider");return c};exports.AttachedDatabaseTypeEnum=ae;exports.Configuration=Z;exports.ConnectionStatusStatusEnum=oe;exports.ConnectionTypeEnum=re;exports.ConnectionsApi=M;exports.ConnectionsApiAxiosParamCreator=B;exports.ConnectionsApiFactory=ce;exports.ConnectionsApiFp=A;exports.ConnectionsTestApi=ie;exports.ConnectionsTestApiAxiosParamCreator=$;exports.ConnectionsTestApiFactory=le;exports.ConnectionsTestApiFp=T;exports.DatabaseTypeEnum=se;exports.DatabasesApi=L;exports.DatabasesApiAxiosParamCreator=E;exports.DatabasesApiFactory=pe;exports.DatabasesApiFp=U;exports.ModelsApi=W;exports.ModelsApiAxiosParamCreator=H;exports.ModelsApiFactory=de;exports.ModelsApiFp=k;exports.NotebookCellTypeEnum=ne;exports.NotebooksApi=G;exports.NotebooksApiAxiosParamCreator=D;exports.NotebooksApiFactory=he;exports.NotebooksApiFp=N;exports.PackagesApi=z;exports.PackagesApiAxiosParamCreator=f;exports.PackagesApiFactory=ue;exports.PackagesApiFp=C;exports.ProjectsApi=K;exports.ProjectsApiAxiosParamCreator=J;exports.ProjectsApiFactory=me;exports.ProjectsApiFp=x;exports.PublisherApi=Ve;exports.PublisherApiAxiosParamCreator=Y;exports.PublisherApiFactory=Pe;exports.PublisherApiFp=w;exports.ServerProvider=ge;exports.WatchModeApi=X;exports.WatchModeApiAxiosParamCreator=_;exports.WatchModeApiFactory=be;exports.WatchModeApiFp=v;exports.globalQueryClient=q;exports.useServer=ye;
|