@malloy-publisher/sdk 0.0.165 → 0.0.167

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.
@@ -1,7 +1,7 @@
1
1
  import { jsx as w } from "react/jsx-runtime";
2
- import { QueryClient as M, QueryClientProvider as E } from "@tanstack/react-query";
2
+ import { QueryClient as F, QueryClientProvider as E } from "@tanstack/react-query";
3
3
  import u from "axios";
4
- import { useContext as L, createContext as H, useMemo as W, useState as T, useEffect as f } from "react";
4
+ import { useContext as L, createContext as H, useMemo as W, useState as T, useEffect as D } from "react";
5
5
  const m = "http://localhost/api/v0".replace(/\/+$/, "");
6
6
  class j {
7
7
  constructor(a, e = m, r = u) {
@@ -9,14 +9,14 @@ class j {
9
9
  }
10
10
  configuration;
11
11
  }
12
- class D extends Error {
12
+ class f extends Error {
13
13
  constructor(a, e) {
14
14
  super(e), this.field = a, this.name = "RequiredError";
15
15
  }
16
16
  }
17
17
  const P = {}, V = "https://example.com", d = function(c, a, e) {
18
18
  if (e == null)
19
- throw new D(a, `Required parameter ${a} was null or undefined when calling ${c}.`);
19
+ throw new f(a, `Required parameter ${a} was null or undefined when calling ${c}.`);
20
20
  };
21
21
  function U(c, a, e = "") {
22
22
  a != null && (typeof a == "object" ? Array.isArray(a) ? a.forEach((r) => U(c, r, e)) : Object.keys(a).forEach(
@@ -26,7 +26,7 @@ function U(c, a, e = "") {
26
26
  const O = function(c, ...a) {
27
27
  const e = new URLSearchParams(c.search);
28
28
  U(e, a), c.search = e.toString();
29
- }, S = function(c, a, e) {
29
+ }, C = function(c, a, e) {
30
30
  const r = typeof c != "string";
31
31
  return (r && e && e.isJsonMime ? e.isJsonMime(a.headers["Content-Type"]) : r) ? JSON.stringify(c !== void 0 ? c : {}) : c || "";
32
32
  }, b = function(c) {
@@ -43,6 +43,13 @@ const O = function(c, ...a) {
43
43
  Gcs: "gcs",
44
44
  S3: "s3"
45
45
  }, be = {
46
+ Error: "error",
47
+ Warn: "warn",
48
+ Debug: "debug"
49
+ }, ge = {
50
+ Success: "success",
51
+ Error: "error"
52
+ }, Se = {
46
53
  Postgres: "postgres",
47
54
  Bigquery: "bigquery",
48
55
  Snowflake: "snowflake",
@@ -50,19 +57,19 @@ const O = function(c, ...a) {
50
57
  Mysql: "mysql",
51
58
  Duckdb: "duckdb",
52
59
  Motherduck: "motherduck"
53
- }, ge = {
60
+ }, ye = {
54
61
  Ok: "ok",
55
62
  Failed: "failed"
56
- }, ye = {
63
+ }, Ce = {
57
64
  Embedded: "embedded",
58
65
  Materialized: "materialized"
59
- }, Ce = {
66
+ }, je = {
60
67
  Markdown: "markdown",
61
68
  Code: "code"
62
- }, Se = {
69
+ }, xe = {
63
70
  Markdown: "markdown",
64
71
  Code: "code"
65
- }, je = {
72
+ }, Ae = {
66
73
  Initializing: "initializing",
67
74
  Serving: "serving",
68
75
  Draining: "draining"
@@ -85,7 +92,7 @@ const O = function(c, ...a) {
85
92
  const l = { method: "POST", ...n, ...t }, i = {}, p = {};
86
93
  i["Content-Type"] = "application/json", O(s, p);
87
94
  let h = n && n.headers ? n.headers : {};
88
- return l.headers = { ...i, ...h, ...t.headers }, l.data = S(r, l, c), {
95
+ return l.headers = { ...i, ...h, ...t.headers }, l.data = C(r, l, c), {
89
96
  url: b(s),
90
97
  options: l
91
98
  };
@@ -150,8 +157,8 @@ const O = function(c, ...a) {
150
157
  c && (l = c.baseOptions);
151
158
  const i = { method: "GET", ...l, ...o }, p = {}, h = {};
152
159
  r !== void 0 && (h.sqlStatement = r), t !== void 0 && (h.options = t), O(n, h);
153
- let y = l && l.headers ? l.headers : {};
154
- return i.headers = { ...p, ...y, ...o.headers }, {
160
+ let S = l && l.headers ? l.headers : {};
161
+ return i.headers = { ...p, ...S, ...o.headers }, {
155
162
  url: b(n),
156
163
  options: i
157
164
  };
@@ -196,8 +203,8 @@ const O = function(c, ...a) {
196
203
  c && (l = c.baseOptions);
197
204
  const i = { method: "GET", ...l, ...o }, p = {};
198
205
  O(n, {});
199
- let y = l && l.headers ? l.headers : {};
200
- return i.headers = { ...p, ...y, ...o.headers }, {
206
+ let S = l && l.headers ? l.headers : {};
207
+ return i.headers = { ...p, ...S, ...o.headers }, {
201
208
  url: b(n),
202
209
  options: i
203
210
  };
@@ -220,8 +227,8 @@ const O = function(c, ...a) {
220
227
  c && (l = c.baseOptions);
221
228
  const i = { method: "GET", ...l, ...o }, p = {}, h = {};
222
229
  r !== void 0 && (h.tableKey = r), t !== void 0 && (h.tablePath = t), O(n, h);
223
- let y = l && l.headers ? l.headers : {};
224
- return i.headers = { ...p, ...y, ...o.headers }, {
230
+ let S = l && l.headers ? l.headers : {};
231
+ return i.headers = { ...p, ...S, ...o.headers }, {
225
232
  url: b(n),
226
233
  options: i
227
234
  };
@@ -329,8 +336,8 @@ const O = function(c, ...a) {
329
336
  c && (l = c.baseOptions);
330
337
  const i = { method: "POST", ...l, ...o }, p = {}, h = {};
331
338
  t !== void 0 && (h.options = t), p["Content-Type"] = "application/json", O(n, h);
332
- let y = l && l.headers ? l.headers : {};
333
- return i.headers = { ...p, ...y, ...o.headers }, i.data = S(r, i, c), {
339
+ let S = l && l.headers ? l.headers : {};
340
+ return i.headers = { ...p, ...S, ...o.headers }, i.data = C(r, i, c), {
334
341
  url: b(n),
335
342
  options: i
336
343
  };
@@ -352,7 +359,7 @@ const O = function(c, ...a) {
352
359
  const l = { method: "POST", ...n, ...t }, i = {}, p = {};
353
360
  i["Content-Type"] = "application/json", O(s, p);
354
361
  let h = n && n.headers ? n.headers : {};
355
- return l.headers = { ...i, ...h, ...t.headers }, l.data = S(r, l, c), {
362
+ return l.headers = { ...i, ...h, ...t.headers }, l.data = C(r, l, c), {
356
363
  url: b(s),
357
364
  options: l
358
365
  };
@@ -374,7 +381,7 @@ const O = function(c, ...a) {
374
381
  const l = { method: "POST", ...n, ...t }, i = {}, p = {};
375
382
  i["Content-Type"] = "application/json", O(s, p);
376
383
  let h = n && n.headers ? n.headers : {};
377
- return l.headers = { ...i, ...h, ...t.headers }, l.data = S(r, l, c), {
384
+ return l.headers = { ...i, ...h, ...t.headers }, l.data = C(r, l, c), {
378
385
  url: b(s),
379
386
  options: l
380
387
  };
@@ -396,13 +403,13 @@ const O = function(c, ...a) {
396
403
  const l = { method: "PATCH", ...n, ...t }, i = {}, p = {};
397
404
  i["Content-Type"] = "application/json", O(s, p);
398
405
  let h = n && n.headers ? n.headers : {};
399
- return l.headers = { ...i, ...h, ...t.headers }, l.data = S(r, l, c), {
406
+ return l.headers = { ...i, ...h, ...t.headers }, l.data = C(r, l, c), {
400
407
  url: b(s),
401
408
  options: l
402
409
  };
403
410
  }
404
411
  };
405
- }, C = function(c) {
412
+ }, y = function(c) {
406
413
  const a = G(c);
407
414
  return {
408
415
  /**
@@ -604,8 +611,8 @@ const O = function(c, ...a) {
604
611
  return (i, p) => g(s, u, m, c)(i, l || p);
605
612
  }
606
613
  };
607
- }, xe = function(c, a, e) {
608
- const r = C(c);
614
+ }, Ne = function(c, a, e) {
615
+ const r = y(c);
609
616
  return {
610
617
  /**
611
618
  * Creates a new database connection in the specified project.
@@ -804,7 +811,7 @@ class z extends j {
804
811
  * @memberof ConnectionsApi
805
812
  */
806
813
  createConnection(a, e, r, t) {
807
- return C(this.configuration).createConnection(a, e, r, t).then((o) => o(this.axios, this.basePath));
814
+ return y(this.configuration).createConnection(a, e, r, t).then((o) => o(this.axios, this.basePath));
808
815
  }
809
816
  /**
810
817
  * Permanently deletes a database connection from the project.
@@ -816,7 +823,7 @@ class z extends j {
816
823
  * @memberof ConnectionsApi
817
824
  */
818
825
  deleteConnection(a, e, r) {
819
- return C(this.configuration).deleteConnection(a, e, r).then((t) => t(this.axios, this.basePath));
826
+ return y(this.configuration).deleteConnection(a, e, r).then((t) => t(this.axios, this.basePath));
820
827
  }
821
828
  /**
822
829
  * Retrieves detailed information about a specific database connection within a project. This includes connection configuration, credentials (if accessible), and metadata. Useful for inspecting connection settings and troubleshooting connectivity issues.
@@ -828,7 +835,7 @@ class z extends j {
828
835
  * @memberof ConnectionsApi
829
836
  */
830
837
  getConnection(a, e, r) {
831
- return C(this.configuration).getConnection(a, e, r).then((t) => t(this.axios, this.basePath));
838
+ return y(this.configuration).getConnection(a, e, r).then((t) => t(this.axios, this.basePath));
832
839
  }
833
840
  /**
834
841
  * **DEPRECATED**: This endpoint is deprecated and may be removed in future versions. Use the POST version instead for better security and functionality. Executes a SQL statement against the specified database connection and returns the results. The query results include data, metadata, and execution information.
@@ -843,7 +850,7 @@ class z extends j {
843
850
  * @memberof ConnectionsApi
844
851
  */
845
852
  getQuerydata(a, e, r, t, o) {
846
- return C(this.configuration).getQuerydata(a, e, r, t, o).then((s) => s(this.axios, this.basePath));
853
+ return y(this.configuration).getQuerydata(a, e, r, t, o).then((s) => s(this.axios, this.basePath));
847
854
  }
848
855
  /**
849
856
  * **DEPRECATED**: This endpoint is deprecated and may be removed in future versions. Use the POST version instead for better security and functionality. Creates a Malloy source from a SQL statement using the specified connection. The SQL statement is executed to generate a source definition that can be used in Malloy models.
@@ -857,7 +864,7 @@ class z extends j {
857
864
  * @memberof ConnectionsApi
858
865
  */
859
866
  getSqlsource(a, e, r, t) {
860
- return C(this.configuration).getSqlsource(a, e, r, t).then((o) => o(this.axios, this.basePath));
867
+ return y(this.configuration).getSqlsource(a, e, r, t).then((o) => o(this.axios, this.basePath));
861
868
  }
862
869
  /**
863
870
  * Retrieves a table from the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed. The tablePath is the full path to the table, including the schema name.
@@ -871,7 +878,7 @@ class z extends j {
871
878
  * @memberof ConnectionsApi
872
879
  */
873
880
  getTable(a, e, r, t, o) {
874
- return C(this.configuration).getTable(a, e, r, t, o).then((s) => s(this.axios, this.basePath));
881
+ return y(this.configuration).getTable(a, e, r, t, o).then((s) => s(this.axios, this.basePath));
875
882
  }
876
883
  /**
877
884
  * Retrieves information about a specific table or view from the database connection. This includes table schema, column definitions, and metadata. The table can be specified by either tableKey or tablePath parameters, depending on the database type.
@@ -886,7 +893,7 @@ class z extends j {
886
893
  * @memberof ConnectionsApi
887
894
  */
888
895
  getTablesource(a, e, r, t, o) {
889
- return C(this.configuration).getTablesource(a, e, r, t, o).then((s) => s(this.axios, this.basePath));
896
+ return y(this.configuration).getTablesource(a, e, r, t, o).then((s) => s(this.axios, this.basePath));
890
897
  }
891
898
  /**
892
899
  * **DEPRECATED**: This endpoint is deprecated and may be removed in future versions. Use the POST version instead for better security and functionality. Creates a temporary table from a SQL statement using the specified connection. Temporary tables are useful for storing intermediate results during complex queries.
@@ -900,7 +907,7 @@ class z extends j {
900
907
  * @memberof ConnectionsApi
901
908
  */
902
909
  getTemporarytable(a, e, r, t) {
903
- return C(this.configuration).getTemporarytable(a, e, r, t).then((o) => o(this.axios, this.basePath));
910
+ return y(this.configuration).getTemporarytable(a, e, r, t).then((o) => o(this.axios, this.basePath));
904
911
  }
905
912
  /**
906
913
  * Retrieves a list of all database connections configured for the specified project. Each connection includes its configuration, type, and status information. This endpoint is useful for discovering available data sources within a project.
@@ -911,7 +918,7 @@ class z extends j {
911
918
  * @memberof ConnectionsApi
912
919
  */
913
920
  listConnections(a, e) {
914
- return C(this.configuration).listConnections(a, e).then((r) => r(this.axios, this.basePath));
921
+ return y(this.configuration).listConnections(a, e).then((r) => r(this.axios, this.basePath));
915
922
  }
916
923
  /**
917
924
  * Retrieves a list of all schemas (databases) available in the specified connection. Each schema includes metadata such as name, description, and whether it\'s the default schema. This endpoint is useful for exploring the database structure and discovering available data sources.
@@ -923,7 +930,7 @@ class z extends j {
923
930
  * @memberof ConnectionsApi
924
931
  */
925
932
  listSchemas(a, e, r) {
926
- return C(this.configuration).listSchemas(a, e, r).then((t) => t(this.axios, this.basePath));
933
+ return y(this.configuration).listSchemas(a, e, r).then((t) => t(this.axios, this.basePath));
927
934
  }
928
935
  /**
929
936
  * Retrieves a list of all tables and views available in the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed.
@@ -936,7 +943,7 @@ class z extends j {
936
943
  * @memberof ConnectionsApi
937
944
  */
938
945
  listTables(a, e, r, t) {
939
- return C(this.configuration).listTables(a, e, r, t).then((o) => o(this.axios, this.basePath));
946
+ return y(this.configuration).listTables(a, e, r, t).then((o) => o(this.axios, this.basePath));
940
947
  }
941
948
  /**
942
949
  * Executes a SQL statement against the specified database connection and returns the results. The results include data, metadata, and execution information.
@@ -950,7 +957,7 @@ class z extends j {
950
957
  * @memberof ConnectionsApi
951
958
  */
952
959
  postQuerydata(a, e, r, t, o) {
953
- return C(this.configuration).postQuerydata(a, e, r, t, o).then((s) => s(this.axios, this.basePath));
960
+ return y(this.configuration).postQuerydata(a, e, r, t, o).then((s) => s(this.axios, this.basePath));
954
961
  }
955
962
  /**
956
963
  * Creates a Malloy source from a SQL statement using the specified database connection. The SQL statement is executed to generate a source definition that can be used in Malloy models.
@@ -963,7 +970,7 @@ class z extends j {
963
970
  * @memberof ConnectionsApi
964
971
  */
965
972
  postSqlsource(a, e, r, t) {
966
- return C(this.configuration).postSqlsource(a, e, r, t).then((o) => o(this.axios, this.basePath));
973
+ return y(this.configuration).postSqlsource(a, e, r, t).then((o) => o(this.axios, this.basePath));
967
974
  }
968
975
  /**
969
976
  * Creates a temporary table from a SQL statement using the specified database connection. Temporary tables are useful for storing intermediate results during complex queries and data processing workflows.
@@ -976,7 +983,7 @@ class z extends j {
976
983
  * @memberof ConnectionsApi
977
984
  */
978
985
  postTemporarytable(a, e, r, t) {
979
- return C(this.configuration).postTemporarytable(a, e, r, t).then((o) => o(this.axios, this.basePath));
986
+ return y(this.configuration).postTemporarytable(a, e, r, t).then((o) => o(this.axios, this.basePath));
980
987
  }
981
988
  /**
982
989
  * Updates the configuration of an existing database connection.
@@ -989,7 +996,7 @@ class z extends j {
989
996
  * @memberof ConnectionsApi
990
997
  */
991
998
  updateConnection(a, e, r, t) {
992
- return C(this.configuration).updateConnection(a, e, r, t).then((o) => o(this.axios, this.basePath));
999
+ return y(this.configuration).updateConnection(a, e, r, t).then((o) => o(this.axios, this.basePath));
993
1000
  }
994
1001
  }
995
1002
  const J = function(c) {
@@ -1009,7 +1016,7 @@ const J = function(c) {
1009
1016
  const s = { method: "POST", ...o, ...e }, n = {}, l = {};
1010
1017
  n["Content-Type"] = "application/json", O(t, l);
1011
1018
  let i = o && o.headers ? o.headers : {};
1012
- return s.headers = { ...n, ...i, ...e.headers }, s.data = S(a, s, c), {
1019
+ return s.headers = { ...n, ...i, ...e.headers }, s.data = C(a, s, c), {
1013
1020
  url: b(t),
1014
1021
  options: s
1015
1022
  };
@@ -1030,7 +1037,7 @@ const J = function(c) {
1030
1037
  return (n, l) => g(t, u, m, c)(n, s || l);
1031
1038
  }
1032
1039
  };
1033
- }, Ae = function(c, a, e) {
1040
+ }, ve = function(c, a, e) {
1034
1041
  const r = Q(c);
1035
1042
  return {
1036
1043
  /**
@@ -1045,7 +1052,7 @@ const J = function(c) {
1045
1052
  }
1046
1053
  };
1047
1054
  };
1048
- class Ne extends j {
1055
+ class ke extends j {
1049
1056
  /**
1050
1057
  * Validates a database connection configuration without adding it to any project. This endpoint allows you to test connection parameters, credentials, and network connectivity before committing the connection to a project. Useful for troubleshooting connection issues and validating configurations during setup.
1051
1058
  * @summary Test database connection configuration
@@ -1100,7 +1107,7 @@ const K = function(c) {
1100
1107
  return (i, p) => g(s, u, m, c)(i, l || p);
1101
1108
  }
1102
1109
  };
1103
- }, ke = function(c, a, e) {
1110
+ }, Ie = function(c, a, e) {
1104
1111
  const r = B(c);
1105
1112
  return {
1106
1113
  /**
@@ -1134,6 +1141,29 @@ class Y extends j {
1134
1141
  }
1135
1142
  const _ = function(c) {
1136
1143
  return {
1144
+ /**
1145
+ * Compiles Malloy source code in the context of a specific model\'s directory, allowing relative imports to resolve correctly against sibling model files. Returns compilation status and any problems (errors or warnings) found.
1146
+ * @summary Compile Malloy source code
1147
+ * @param {string} projectName Name of the project
1148
+ * @param {string} packageName Name of the package
1149
+ * @param {string} path Path to the model within the package (used to resolve relative imports)
1150
+ * @param {CompileRequest} compileRequest
1151
+ * @param {*} [options] Override http request option.
1152
+ * @throws {RequiredError}
1153
+ */
1154
+ compileModelSource: async (a, e, r, t, o = {}) => {
1155
+ d("compileModelSource", "projectName", a), d("compileModelSource", "packageName", e), d("compileModelSource", "path", r), d("compileModelSource", "compileRequest", t);
1156
+ const s = "/projects/{projectName}/packages/{packageName}/models/{path}/compile".replace("{projectName}", encodeURIComponent(String(a))).replace("{packageName}", encodeURIComponent(String(e))).replace("{path}", encodeURIComponent(String(r))), n = new URL(s, V);
1157
+ let l;
1158
+ c && (l = c.baseOptions);
1159
+ const i = { method: "POST", ...l, ...o }, p = {}, h = {};
1160
+ p["Content-Type"] = "application/json", O(n, h);
1161
+ let S = l && l.headers ? l.headers : {};
1162
+ return i.headers = { ...p, ...S, ...o.headers }, i.data = C(t, i, c), {
1163
+ url: b(n),
1164
+ options: i
1165
+ };
1166
+ },
1137
1167
  /**
1138
1168
  * Executes a Malloy query against a model and returns the results. The query can be specified as a raw Malloy query string or by referencing a named query within the model. This endpoint supports both ad-hoc queries and predefined model queries, making it flexible for various use cases including data exploration, reporting, and application integration.
1139
1169
  * @summary Execute Malloy query
@@ -1151,8 +1181,8 @@ const _ = function(c) {
1151
1181
  c && (l = c.baseOptions);
1152
1182
  const i = { method: "POST", ...l, ...o }, p = {}, h = {};
1153
1183
  p["Content-Type"] = "application/json", O(n, h);
1154
- let y = l && l.headers ? l.headers : {};
1155
- return i.headers = { ...p, ...y, ...o.headers }, i.data = S(t, i, c), {
1184
+ let S = l && l.headers ? l.headers : {};
1185
+ return i.headers = { ...p, ...S, ...o.headers }, i.data = C(t, i, c), {
1156
1186
  url: b(n),
1157
1187
  options: i
1158
1188
  };
@@ -1174,8 +1204,8 @@ const _ = function(c) {
1174
1204
  c && (l = c.baseOptions);
1175
1205
  const i = { method: "GET", ...l, ...o }, p = {}, h = {};
1176
1206
  t !== void 0 && (h.versionId = t), O(n, h);
1177
- let y = l && l.headers ? l.headers : {};
1178
- return i.headers = { ...p, ...y, ...o.headers }, {
1207
+ let S = l && l.headers ? l.headers : {};
1208
+ return i.headers = { ...p, ...S, ...o.headers }, {
1179
1209
  url: b(n),
1180
1210
  options: i
1181
1211
  };
@@ -1206,6 +1236,20 @@ const _ = function(c) {
1206
1236
  }, v = function(c) {
1207
1237
  const a = _(c);
1208
1238
  return {
1239
+ /**
1240
+ * Compiles Malloy source code in the context of a specific model\'s directory, allowing relative imports to resolve correctly against sibling model files. Returns compilation status and any problems (errors or warnings) found.
1241
+ * @summary Compile Malloy source code
1242
+ * @param {string} projectName Name of the project
1243
+ * @param {string} packageName Name of the package
1244
+ * @param {string} path Path to the model within the package (used to resolve relative imports)
1245
+ * @param {CompileRequest} compileRequest
1246
+ * @param {*} [options] Override http request option.
1247
+ * @throws {RequiredError}
1248
+ */
1249
+ async compileModelSource(e, r, t, o, s) {
1250
+ const n = await a.compileModelSource(e, r, t, o, s), l = c?.serverIndex ?? 0, i = P["ModelsApi.compileModelSource"]?.[l]?.url;
1251
+ return (p, h) => g(n, u, m, c)(p, i || h);
1252
+ },
1209
1253
  /**
1210
1254
  * Executes a Malloy query against a model and returns the results. The query can be specified as a raw Malloy query string or by referencing a named query within the model. This endpoint supports both ad-hoc queries and predefined model queries, making it flexible for various use cases including data exploration, reporting, and application integration.
1211
1255
  * @summary Execute Malloy query
@@ -1248,9 +1292,22 @@ const _ = function(c) {
1248
1292
  return (i, p) => g(s, u, m, c)(i, l || p);
1249
1293
  }
1250
1294
  };
1251
- }, ve = function(c, a, e) {
1295
+ }, Re = function(c, a, e) {
1252
1296
  const r = v(c);
1253
1297
  return {
1298
+ /**
1299
+ * Compiles Malloy source code in the context of a specific model\'s directory, allowing relative imports to resolve correctly against sibling model files. Returns compilation status and any problems (errors or warnings) found.
1300
+ * @summary Compile Malloy source code
1301
+ * @param {string} projectName Name of the project
1302
+ * @param {string} packageName Name of the package
1303
+ * @param {string} path Path to the model within the package (used to resolve relative imports)
1304
+ * @param {CompileRequest} compileRequest
1305
+ * @param {*} [options] Override http request option.
1306
+ * @throws {RequiredError}
1307
+ */
1308
+ compileModelSource(t, o, s, n, l) {
1309
+ return r.compileModelSource(t, o, s, n, l).then((i) => i(e, a));
1310
+ },
1254
1311
  /**
1255
1312
  * Executes a Malloy query against a model and returns the results. The query can be specified as a raw Malloy query string or by referencing a named query within the model. This endpoint supports both ad-hoc queries and predefined model queries, making it flexible for various use cases including data exploration, reporting, and application integration.
1256
1313
  * @summary Execute Malloy query
@@ -1292,6 +1349,20 @@ const _ = function(c) {
1292
1349
  };
1293
1350
  };
1294
1351
  class X extends j {
1352
+ /**
1353
+ * Compiles Malloy source code in the context of a specific model\'s directory, allowing relative imports to resolve correctly against sibling model files. Returns compilation status and any problems (errors or warnings) found.
1354
+ * @summary Compile Malloy source code
1355
+ * @param {string} projectName Name of the project
1356
+ * @param {string} packageName Name of the package
1357
+ * @param {string} path Path to the model within the package (used to resolve relative imports)
1358
+ * @param {CompileRequest} compileRequest
1359
+ * @param {*} [options] Override http request option.
1360
+ * @throws {RequiredError}
1361
+ * @memberof ModelsApi
1362
+ */
1363
+ compileModelSource(a, e, r, t, o) {
1364
+ return v(this.configuration).compileModelSource(a, e, r, t, o).then((s) => s(this.axios, this.basePath));
1365
+ }
1295
1366
  /**
1296
1367
  * Executes a Malloy query against a model and returns the results. The query can be specified as a raw Malloy query string or by referencing a named query within the model. This endpoint supports both ad-hoc queries and predefined model queries, making it flexible for various use cases including data exploration, reporting, and application integration.
1297
1368
  * @summary Execute Malloy query
@@ -1352,8 +1423,8 @@ const Z = function(c) {
1352
1423
  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);
1353
1424
  let i;
1354
1425
  c && (i = c.baseOptions);
1355
- const p = { method: "GET", ...i, ...s }, h = {}, y = {};
1356
- o !== void 0 && (y.versionId = o), O(l, y);
1426
+ const p = { method: "GET", ...i, ...s }, h = {}, S = {};
1427
+ o !== void 0 && (S.versionId = o), O(l, S);
1357
1428
  let N = i && i.headers ? i.headers : {};
1358
1429
  return p.headers = { ...h, ...N, ...s.headers }, {
1359
1430
  url: b(l),
@@ -1377,8 +1448,8 @@ const Z = function(c) {
1377
1448
  c && (l = c.baseOptions);
1378
1449
  const i = { method: "GET", ...l, ...o }, p = {}, h = {};
1379
1450
  t !== void 0 && (h.versionId = t), O(n, h);
1380
- let y = l && l.headers ? l.headers : {};
1381
- return i.headers = { ...p, ...y, ...o.headers }, {
1451
+ let S = l && l.headers ? l.headers : {};
1452
+ return i.headers = { ...p, ...S, ...o.headers }, {
1382
1453
  url: b(n),
1383
1454
  options: i
1384
1455
  };
@@ -1422,7 +1493,7 @@ const Z = function(c) {
1422
1493
  */
1423
1494
  async executeNotebookCell(e, r, t, o, s, n) {
1424
1495
  const l = await a.executeNotebookCell(e, r, t, o, s, n), i = c?.serverIndex ?? 0, p = P["NotebooksApi.executeNotebookCell"]?.[i]?.url;
1425
- return (h, y) => g(l, u, m, c)(h, p || y);
1496
+ return (h, S) => g(l, u, m, c)(h, p || S);
1426
1497
  },
1427
1498
  /**
1428
1499
  * Retrieves a Malloy notebook with its raw cell contents (markdown and code). Cell execution should be done separately via the execute-notebook-cell endpoint.
@@ -1452,7 +1523,7 @@ const Z = function(c) {
1452
1523
  return (i, p) => g(s, u, m, c)(i, l || p);
1453
1524
  }
1454
1525
  };
1455
- }, Ie = function(c, a, e) {
1526
+ }, Ue = function(c, a, e) {
1456
1527
  const r = I(c);
1457
1528
  return {
1458
1529
  /**
@@ -1558,7 +1629,7 @@ const te = function(c) {
1558
1629
  const n = { method: "POST", ...s, ...r }, l = {}, i = {};
1559
1630
  l["Content-Type"] = "application/json", O(o, i);
1560
1631
  let p = s && s.headers ? s.headers : {};
1561
- return n.headers = { ...l, ...p, ...r.headers }, n.data = S(e, n, c), {
1632
+ return n.headers = { ...l, ...p, ...r.headers }, n.data = C(e, n, c), {
1562
1633
  url: b(o),
1563
1634
  options: n
1564
1635
  };
@@ -1601,8 +1672,8 @@ const te = function(c) {
1601
1672
  c && (l = c.baseOptions);
1602
1673
  const i = { method: "GET", ...l, ...o }, p = {}, h = {};
1603
1674
  r !== void 0 && (h.versionId = r), t !== void 0 && (h.reload = t), O(n, h);
1604
- let y = l && l.headers ? l.headers : {};
1605
- return i.headers = { ...p, ...y, ...o.headers }, {
1675
+ let S = l && l.headers ? l.headers : {};
1676
+ return i.headers = { ...p, ...S, ...o.headers }, {
1606
1677
  url: b(n),
1607
1678
  options: i
1608
1679
  };
@@ -1644,7 +1715,7 @@ const te = function(c) {
1644
1715
  const l = { method: "PATCH", ...n, ...t }, i = {}, p = {};
1645
1716
  i["Content-Type"] = "application/json", O(s, p);
1646
1717
  let h = n && n.headers ? n.headers : {};
1647
- return l.headers = { ...i, ...h, ...t.headers }, l.data = S(r, l, c), {
1718
+ return l.headers = { ...i, ...h, ...t.headers }, l.data = C(r, l, c), {
1648
1719
  url: b(s),
1649
1720
  options: l
1650
1721
  };
@@ -1716,7 +1787,7 @@ const te = function(c) {
1716
1787
  return (i, p) => g(s, u, m, c)(i, l || p);
1717
1788
  }
1718
1789
  };
1719
- }, Re = function(c, a, e) {
1790
+ }, we = function(c, a, e) {
1720
1791
  const r = x(c);
1721
1792
  return {
1722
1793
  /**
@@ -1859,7 +1930,7 @@ const re = function(c) {
1859
1930
  const s = { method: "POST", ...o, ...e }, n = {}, l = {};
1860
1931
  n["Content-Type"] = "application/json", O(t, l);
1861
1932
  let i = o && o.headers ? o.headers : {};
1862
- return s.headers = { ...n, ...i, ...e.headers }, s.data = S(a, s, c), {
1933
+ return s.headers = { ...n, ...i, ...e.headers }, s.data = C(a, s, c), {
1863
1934
  url: b(t),
1864
1935
  options: s
1865
1936
  };
@@ -1939,7 +2010,7 @@ const re = function(c) {
1939
2010
  const n = { method: "PATCH", ...s, ...r }, l = {}, i = {};
1940
2011
  l["Content-Type"] = "application/json", O(o, i);
1941
2012
  let p = s && s.headers ? s.headers : {};
1942
- return n.headers = { ...l, ...p, ...r.headers }, n.data = S(e, n, c), {
2013
+ return n.headers = { ...l, ...p, ...r.headers }, n.data = C(e, n, c), {
1943
2014
  url: b(o),
1944
2015
  options: n
1945
2016
  };
@@ -2005,7 +2076,7 @@ const re = function(c) {
2005
2076
  return (l, i) => g(o, u, m, c)(l, n || i);
2006
2077
  }
2007
2078
  };
2008
- }, Ue = function(c, a, e) {
2079
+ }, Te = function(c, a, e) {
2009
2080
  const r = A(c);
2010
2081
  return {
2011
2082
  /**
@@ -2154,7 +2225,7 @@ const se = function(c) {
2154
2225
  return (s, n) => g(r, u, m, c)(s, o || n);
2155
2226
  }
2156
2227
  };
2157
- }, we = function(c, a, e) {
2228
+ }, Qe = function(c, a, e) {
2158
2229
  const r = q(c);
2159
2230
  return {
2160
2231
  /**
@@ -2215,7 +2286,7 @@ const ce = function(c) {
2215
2286
  const s = { method: "POST", ...o, ...e }, n = {}, l = {};
2216
2287
  n["Content-Type"] = "application/json", O(t, l);
2217
2288
  let i = o && o.headers ? o.headers : {};
2218
- return s.headers = { ...n, ...i, ...e.headers }, s.data = S(a, s, c), {
2289
+ return s.headers = { ...n, ...i, ...e.headers }, s.data = C(a, s, c), {
2219
2290
  url: b(t),
2220
2291
  options: s
2221
2292
  };
@@ -2274,7 +2345,7 @@ const ce = function(c) {
2274
2345
  return (s, n) => g(r, u, m, c)(s, o || n);
2275
2346
  }
2276
2347
  };
2277
- }, Te = function(c, a, e) {
2348
+ }, Be = function(c, a, e) {
2278
2349
  const r = R(c);
2279
2350
  return {
2280
2351
  /**
@@ -2420,7 +2491,7 @@ class ie {
2420
2491
  return a !== null && (e.test(a) || a.toLowerCase() === "application/json-patch+json");
2421
2492
  }
2422
2493
  }
2423
- const pe = new M({
2494
+ const pe = new F({
2424
2495
  defaultOptions: {
2425
2496
  queries: {
2426
2497
  retry: !1,
@@ -2431,7 +2502,7 @@ const pe = new M({
2431
2502
  throwOnError: !1
2432
2503
  }
2433
2504
  }
2434
- }), $ = H(void 0), de = (c, a) => {
2505
+ }), M = H(void 0), de = (c, a) => {
2435
2506
  const e = `${window.location.protocol}//${window.location.host}/api/v0`, r = u.create({
2436
2507
  baseURL: c || e,
2437
2508
  withCredentials: !0,
@@ -2452,7 +2523,7 @@ const pe = new M({
2452
2523
  databases: new Y(t, e, r),
2453
2524
  watchMode: new le(t, e, r)
2454
2525
  };
2455
- }, Qe = ({
2526
+ }, qe = ({
2456
2527
  children: c,
2457
2528
  getAccessToken: a,
2458
2529
  baseURL: e,
@@ -2462,15 +2533,15 @@ const pe = new M({
2462
2533
  () => de(e, a),
2463
2534
  [e, a]
2464
2535
  ), o = e || `${window.location.protocol}//${window.location.host}/api/v0`, [s, n] = T(r), [l, i] = T(!0);
2465
- f(() => {
2536
+ D(() => {
2466
2537
  let h = !0;
2467
2538
  return (async () => {
2468
2539
  try {
2469
2540
  const N = await t.publisher.getStatus();
2470
2541
  if (h) {
2471
- const F = N.data?.frozenConfig;
2542
+ const $ = N.data?.frozenConfig;
2472
2543
  let k;
2473
- F ? k = !1 : r === void 0 ? k = !0 : k = r, n(k), i(!1);
2544
+ $ ? k = !1 : r === void 0 ? k = !0 : k = r, n(k), i(!1);
2474
2545
  }
2475
2546
  } catch (N) {
2476
2547
  console.error("Failed to fetch publisher status:", N), h && (n(r), i(!1));
@@ -2486,59 +2557,61 @@ const pe = new M({
2486
2557
  mutable: s,
2487
2558
  isLoadingStatus: l
2488
2559
  };
2489
- return /* @__PURE__ */ w(E, { client: pe, children: /* @__PURE__ */ w($.Provider, { value: p, children: c }) });
2490
- }, Be = () => {
2491
- const c = L($);
2560
+ return /* @__PURE__ */ w(E, { client: pe, children: /* @__PURE__ */ w(M.Provider, { value: p, children: c }) });
2561
+ }, Me = () => {
2562
+ const c = L(M);
2492
2563
  if (c === void 0)
2493
2564
  throw new Error("useServer must be used within a ServerProvider");
2494
2565
  return c;
2495
2566
  };
2496
2567
  export {
2497
2568
  Oe as A,
2498
- ae as B,
2569
+ x as B,
2499
2570
  be as C,
2500
- ye as D,
2501
- re as E,
2502
- A as F,
2503
- Ue as G,
2504
- oe as H,
2505
- se as I,
2506
- q as J,
2507
- we as K,
2508
- ne as L,
2571
+ Ce as D,
2572
+ we as E,
2573
+ ae as F,
2574
+ re as G,
2575
+ A as H,
2576
+ Te as I,
2577
+ oe as J,
2578
+ se as K,
2579
+ q as L,
2509
2580
  _ as M,
2510
- Ce as N,
2511
- R as O,
2581
+ je as N,
2582
+ Qe as O,
2512
2583
  te as P,
2513
- Te as Q,
2514
- le as R,
2515
- Qe as S,
2516
- ie as T,
2584
+ ne as Q,
2585
+ R,
2586
+ qe as S,
2587
+ Be as T,
2588
+ le as U,
2589
+ ie as V,
2517
2590
  ce as W,
2518
2591
  ge as a,
2519
2592
  Se as b,
2520
- je as c,
2521
- G as d,
2522
- C as e,
2523
- xe as f,
2593
+ ye as c,
2594
+ xe as d,
2595
+ Ae as e,
2596
+ G as f,
2524
2597
  pe as g,
2525
- z as h,
2526
- J as i,
2527
- Q as j,
2528
- Ae as k,
2529
- Ne as l,
2530
- K as m,
2531
- B as n,
2532
- ke as o,
2533
- Y as p,
2534
- v as q,
2535
- ve as r,
2536
- X as s,
2537
- Z as t,
2538
- Be as u,
2539
- I as v,
2540
- Ie as w,
2541
- ee as x,
2542
- x as y,
2543
- Re as z
2598
+ y as h,
2599
+ Ne as i,
2600
+ z as j,
2601
+ J as k,
2602
+ Q as l,
2603
+ ve as m,
2604
+ ke as n,
2605
+ K as o,
2606
+ B as p,
2607
+ Ie as q,
2608
+ Y as r,
2609
+ v as s,
2610
+ Re as t,
2611
+ Me as u,
2612
+ X as v,
2613
+ Z as w,
2614
+ I as x,
2615
+ Ue as y,
2616
+ ee as z
2544
2617
  };
@@ -0,0 +1 @@
1
+ "use strict";const M=require("react/jsx-runtime"),q=require("@tanstack/react-query"),u=require("axios"),N=require("react"),m="http://localhost/api/v0".replace(/\/+$/,"");class A{constructor(a,e=m,r=u){this.basePath=e,this.axios=r,a&&(this.configuration=a,this.basePath=a.basePath??e)}configuration}class se 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 se(a,`Required parameter ${a} was null or undefined when calling ${c}.`)};function T(c,a,e=""){a!=null&&(typeof a=="object"?Array.isArray(a)?a.forEach(r=>T(c,r,e)):Object.keys(a).forEach(r=>T(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);T(e,a),c.search=e.toString()},y=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)}},ne={Bigquery:"bigquery",Snowflake:"snowflake",Postgres:"postgres",Gcs:"gcs",S3:"s3"},ce={Error:"error",Warn:"warn",Debug:"debug"},le={Success:"success",Error:"error"},ie={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Mysql:"mysql",Duckdb:"duckdb",Motherduck:"motherduck"},pe={Ok:"ok",Failed:"failed"},de={Embedded:"embedded",Materialized:"materialized"},he={Markdown:"markdown",Code:"code"},ue={Markdown:"markdown",Code:"code"},me={Initializing:"initializing",Serving:"serving",Draining:"draining"},B=function(c){return{createConnection:async(a,e,r,t={})=>{d("createConnection","projectName",a),d("createConnection","connectionName",e),d("createConnection","connection",r);const o="/projects/{projectName}/connections/{connectionName}".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=y(r,l,c),{url:O(s),options:l}},deleteConnection:async(a,e,r={})=>{d("deleteConnection","projectName",a),d("deleteConnection","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:"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}},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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},i.data=y(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=y(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=y(r,l,c),{url:O(s),options:l}},updateConnection:async(a,e,r,t={})=>{d("updateConnection","projectName",a),d("updateConnection","connectionName",e),d("updateConnection","updateConnectionRequest",r);const o="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",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=y(r,l,c),{url:O(s),options:l}}}},S=function(c){const a=B(c);return{async createConnection(e,r,t,o){const s=await a.createConnection(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.createConnection"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async deleteConnection(e,r,t){const o=await a.deleteConnection(e,r,t),s=c?.serverIndex??0,n=P["ConnectionsApi.deleteConnection"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},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)},async updateConnection(e,r,t,o){const s=await a.updateConnection(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.updateConnection"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},Pe=function(c,a,e){const r=S(c);return{createConnection(t,o,s,n){return r.createConnection(t,o,s,n).then(l=>l(e,a))},deleteConnection(t,o,s){return r.deleteConnection(t,o,s).then(n=>n(e,a))},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))},updateConnection(t,o,s,n){return r.updateConnection(t,o,s,n).then(l=>l(e,a))}}};class $ extends A{createConnection(a,e,r,t){return S(this.configuration).createConnection(a,e,r,t).then(o=>o(this.axios,this.basePath))}deleteConnection(a,e,r){return S(this.configuration).deleteConnection(a,e,r).then(t=>t(this.axios,this.basePath))}getConnection(a,e,r){return S(this.configuration).getConnection(a,e,r).then(t=>t(this.axios,this.basePath))}getQuerydata(a,e,r,t,o){return S(this.configuration).getQuerydata(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getSqlsource(a,e,r,t){return S(this.configuration).getSqlsource(a,e,r,t).then(o=>o(this.axios,this.basePath))}getTable(a,e,r,t,o){return S(this.configuration).getTable(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getTablesource(a,e,r,t,o){return S(this.configuration).getTablesource(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getTemporarytable(a,e,r,t){return S(this.configuration).getTemporarytable(a,e,r,t).then(o=>o(this.axios,this.basePath))}listConnections(a,e){return S(this.configuration).listConnections(a,e).then(r=>r(this.axios,this.basePath))}listSchemas(a,e,r){return S(this.configuration).listSchemas(a,e,r).then(t=>t(this.axios,this.basePath))}listTables(a,e,r,t){return S(this.configuration).listTables(a,e,r,t).then(o=>o(this.axios,this.basePath))}postQuerydata(a,e,r,t,o){return S(this.configuration).postQuerydata(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}postSqlsource(a,e,r,t){return S(this.configuration).postSqlsource(a,e,r,t).then(o=>o(this.axios,this.basePath))}postTemporarytable(a,e,r,t){return S(this.configuration).postTemporarytable(a,e,r,t).then(o=>o(this.axios,this.basePath))}updateConnection(a,e,r,t){return S(this.configuration).updateConnection(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const E=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=y(a,s,c),{url:O(t),options:s}}}},w=function(c){const a=E(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)}}},Ve=function(c,a,e){const r=w(c);return{testConnectionConfiguration(t,o){return r.testConnectionConfiguration(t,o).then(s=>s(e,a))}}};class be extends A{testConnectionConfiguration(a,e){return w(this.configuration).testConnectionConfiguration(a,e).then(r=>r(this.axios,this.basePath))}}const L=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}}}},Q=function(c){const a=L(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)}}},Oe=function(c,a,e){const r=Q(c);return{listDatabases(t,o,s,n){return r.listDatabases(t,o,s,n).then(l=>l(e,a))}}};class H extends A{listDatabases(a,e,r,t){return Q(this.configuration).listDatabases(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const W=function(c){return{compileModelSource:async(a,e,r,t,o={})=>{d("compileModelSource","projectName",a),d("compileModelSource","packageName",e),d("compileModelSource","path",r),d("compileModelSource","compileRequest",t);const s="/projects/{projectName}/packages/{packageName}/models/{path}/compile".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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},i.data=y(t,i,c),{url:O(n),options:i}},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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},i.data=y(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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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=W(c);return{async compileModelSource(e,r,t,o,s){const n=await a.compileModelSource(e,r,t,o,s),l=c?.serverIndex??0,i=P["ModelsApi.compileModelSource"]?.[l]?.url;return(p,h)=>g(n,u,m,c)(p,i||h)},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)}}},ge=function(c,a,e){const r=k(c);return{compileModelSource(t,o,s,n,l){return r.compileModelSource(t,o,s,n,l).then(i=>i(e,a))},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 D extends A{compileModelSource(a,e,r,t,o){return k(this.configuration).compileModelSource(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}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 f=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={},C={};o!==void 0&&(C.versionId=o),b(l,C);let v=i&&i.headers?i.headers:{};return p.headers={...h,...v,...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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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}}}},R=function(c){const a=f(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,C)=>g(l,u,m,c)(h,p||C)},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)}}},Ce=function(c,a,e){const r=R(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 G extends A{executeNotebookCell(a,e,r,t,o,s){return R(this.configuration).executeNotebookCell(a,e,r,t,o,s).then(n=>n(this.axios,this.basePath))}getNotebook(a,e,r,t,o){return R(this.configuration).getNotebook(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listNotebooks(a,e,r,t){return R(this.configuration).listNotebooks(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const z=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=y(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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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=y(r,l,c),{url:O(s),options:l}}}},j=function(c){const a=z(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)}}},Se=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 J extends A{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 K=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=y(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=y(e,n,c),{url:O(o),options:n}}}},x=function(c){const a=K(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)}}},ye=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 Y extends A{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 _=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}}}},F=function(c){const a=_(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)}}},Ae=function(c,a,e){const r=F(c);return{getStatus(t){return r.getStatus(t).then(o=>o(e,a))}}};class X extends A{getStatus(a){return F(this.configuration).getStatus(a).then(e=>e(this.axios,this.basePath))}}const Z=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=y(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}}}},I=function(c){const a=Z(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)}}},je=function(c,a,e){const r=I(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 ee extends A{getWatchStatus(a){return I(this.configuration).getWatchStatus(a).then(e=>e(this.axios,this.basePath))}startWatching(a,e){return I(this.configuration).startWatching(a,e).then(r=>r(this.axios,this.basePath))}stopWatching(a){return I(this.configuration).stopWatching(a).then(e=>e(this.axios,this.basePath))}}class te{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 ae=new q.QueryClient({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),re=N.createContext(void 0),xe=(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 te({basePath:e});return{models:new D(t,e,r),publisher:new X(t,e,r),projects:new Y(t,e,r),packages:new J(t,e,r),notebooks:new G(t,e,r),connections:new $(t,e,r),databases:new H(t,e,r),watchMode:new ee(t,e,r)}},Ne=({children:c,getAccessToken:a,baseURL:e,mutable:r})=>{const t=N.useMemo(()=>xe(e,a),[e,a]),o=e||`${window.location.protocol}//${window.location.host}/api/v0`,[s,n]=N.useState(r),[l,i]=N.useState(!0);N.useEffect(()=>{let h=!0;return(async()=>{try{const v=await t.publisher.getStatus();if(h){const oe=v.data?.frozenConfig;let U;oe?U=!1:r===void 0?U=!0:U=r,n(U),i(!1)}}catch(v){console.error("Failed to fetch publisher status:",v),h&&(n(r),i(!1))}})(),()=>{h=!1}},[t,r]);const p={server:o,getAccessToken:a,apiClients:t,mutable:s,isLoadingStatus:l};return M.jsx(q.QueryClientProvider,{client:ae,children:M.jsx(re.Provider,{value:p,children:c})})},ke=()=>{const c=N.useContext(re);if(c===void 0)throw new Error("useServer must be used within a ServerProvider");return c};exports.AttachedDatabaseTypeEnum=ne;exports.CompileProblemSeverityEnum=ce;exports.CompileResultStatusEnum=le;exports.Configuration=te;exports.ConnectionStatusStatusEnum=pe;exports.ConnectionTypeEnum=ie;exports.ConnectionsApi=$;exports.ConnectionsApiAxiosParamCreator=B;exports.ConnectionsApiFactory=Pe;exports.ConnectionsApiFp=S;exports.ConnectionsTestApi=be;exports.ConnectionsTestApiAxiosParamCreator=E;exports.ConnectionsTestApiFactory=Ve;exports.ConnectionsTestApiFp=w;exports.DatabaseTypeEnum=de;exports.DatabasesApi=H;exports.DatabasesApiAxiosParamCreator=L;exports.DatabasesApiFactory=Oe;exports.DatabasesApiFp=Q;exports.ModelsApi=D;exports.ModelsApiAxiosParamCreator=W;exports.ModelsApiFactory=ge;exports.ModelsApiFp=k;exports.NotebookCellResultTypeEnum=ue;exports.NotebookCellTypeEnum=he;exports.NotebooksApi=G;exports.NotebooksApiAxiosParamCreator=f;exports.NotebooksApiFactory=Ce;exports.NotebooksApiFp=R;exports.PackagesApi=J;exports.PackagesApiAxiosParamCreator=z;exports.PackagesApiFactory=Se;exports.PackagesApiFp=j;exports.ProjectsApi=Y;exports.ProjectsApiAxiosParamCreator=K;exports.ProjectsApiFactory=ye;exports.ProjectsApiFp=x;exports.PublisherApi=X;exports.PublisherApiAxiosParamCreator=_;exports.PublisherApiFactory=Ae;exports.PublisherApiFp=F;exports.ServerProvider=Ne;exports.ServerStatusOperationalStateEnum=me;exports.WatchModeApi=ee;exports.WatchModeApiAxiosParamCreator=Z;exports.WatchModeApiFactory=je;exports.WatchModeApiFp=I;exports.globalQueryClient=ae;exports.useServer=ke;
@@ -126,6 +126,111 @@ export interface Column {
126
126
  */
127
127
  'type'?: string;
128
128
  }
129
+ /**
130
+ * A compilation problem reported by the Malloy compiler
131
+ * @export
132
+ * @interface CompileProblem
133
+ */
134
+ export interface CompileProblem {
135
+ /**
136
+ * Human-readable problem description
137
+ * @type {string}
138
+ * @memberof CompileProblem
139
+ */
140
+ 'message'?: string;
141
+ /**
142
+ * Severity level of the problem
143
+ * @type {string}
144
+ * @memberof CompileProblem
145
+ */
146
+ 'severity'?: CompileProblemSeverityEnum;
147
+ /**
148
+ * Machine-readable error code
149
+ * @type {string}
150
+ * @memberof CompileProblem
151
+ */
152
+ 'code'?: string;
153
+ /**
154
+ *
155
+ * @type {CompileProblemAt}
156
+ * @memberof CompileProblem
157
+ */
158
+ 'at'?: CompileProblemAt;
159
+ }
160
+ export declare const CompileProblemSeverityEnum: {
161
+ readonly Error: "error";
162
+ readonly Warn: "warn";
163
+ readonly Debug: "debug";
164
+ };
165
+ export type CompileProblemSeverityEnum = typeof CompileProblemSeverityEnum[keyof typeof CompileProblemSeverityEnum];
166
+ /**
167
+ * Source location of the problem
168
+ * @export
169
+ * @interface CompileProblemAt
170
+ */
171
+ export interface CompileProblemAt {
172
+ /**
173
+ * URL of the source file
174
+ * @type {string}
175
+ * @memberof CompileProblemAt
176
+ */
177
+ 'url'?: string;
178
+ /**
179
+ * Character range within the source file
180
+ * @type {object}
181
+ * @memberof CompileProblemAt
182
+ */
183
+ 'range'?: object;
184
+ }
185
+ /**
186
+ * Request body for compiling Malloy source code
187
+ * @export
188
+ * @interface CompileRequest
189
+ */
190
+ export interface CompileRequest {
191
+ /**
192
+ * Malloy source code to compile
193
+ * @type {string}
194
+ * @memberof CompileRequest
195
+ */
196
+ 'source': string;
197
+ /**
198
+ * If true, returns the generated SQL alongside compilation results (only available when compilation succeeds and the source contains a runnable query).
199
+ * @type {boolean}
200
+ * @memberof CompileRequest
201
+ */
202
+ 'includeSql'?: boolean;
203
+ }
204
+ /**
205
+ * Result of a Malloy source compilation check
206
+ * @export
207
+ * @interface CompileResult
208
+ */
209
+ export interface CompileResult {
210
+ /**
211
+ * Overall compilation status — \"error\" if any problems have error severity
212
+ * @type {string}
213
+ * @memberof CompileResult
214
+ */
215
+ 'status'?: CompileResultStatusEnum;
216
+ /**
217
+ * List of compilation problems (errors and warnings)
218
+ * @type {Array<CompileProblem>}
219
+ * @memberof CompileResult
220
+ */
221
+ 'problems'?: Array<CompileProblem>;
222
+ /**
223
+ * Generated SQL for the compiled query. Only present when includeSql is true and compilation succeeds with a runnable query.
224
+ * @type {string}
225
+ * @memberof CompileResult
226
+ */
227
+ 'sql'?: string;
228
+ }
229
+ export declare const CompileResultStatusEnum: {
230
+ readonly Success: "success";
231
+ readonly Error: "error";
232
+ };
233
+ export type CompileResultStatusEnum = typeof CompileResultStatusEnum[keyof typeof CompileResultStatusEnum];
129
234
  /**
130
235
  * Compiled Malloy model with sources, queries, and metadata
131
236
  * @export
@@ -2119,6 +2224,17 @@ export declare class DatabasesApi extends BaseAPI {
2119
2224
  * @export
2120
2225
  */
2121
2226
  export declare const ModelsApiAxiosParamCreator: (configuration?: Configuration) => {
2227
+ /**
2228
+ * Compiles Malloy source code in the context of a specific model\'s directory, allowing relative imports to resolve correctly against sibling model files. Returns compilation status and any problems (errors or warnings) found.
2229
+ * @summary Compile Malloy source code
2230
+ * @param {string} projectName Name of the project
2231
+ * @param {string} packageName Name of the package
2232
+ * @param {string} path Path to the model within the package (used to resolve relative imports)
2233
+ * @param {CompileRequest} compileRequest
2234
+ * @param {*} [options] Override http request option.
2235
+ * @throws {RequiredError}
2236
+ */
2237
+ compileModelSource: (projectName: string, packageName: string, path: string, compileRequest: CompileRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2122
2238
  /**
2123
2239
  * Executes a Malloy query against a model and returns the results. The query can be specified as a raw Malloy query string or by referencing a named query within the model. This endpoint supports both ad-hoc queries and predefined model queries, making it flexible for various use cases including data exploration, reporting, and application integration.
2124
2240
  * @summary Execute Malloy query
@@ -2157,6 +2273,17 @@ export declare const ModelsApiAxiosParamCreator: (configuration?: Configuration)
2157
2273
  * @export
2158
2274
  */
2159
2275
  export declare const ModelsApiFp: (configuration?: Configuration) => {
2276
+ /**
2277
+ * Compiles Malloy source code in the context of a specific model\'s directory, allowing relative imports to resolve correctly against sibling model files. Returns compilation status and any problems (errors or warnings) found.
2278
+ * @summary Compile Malloy source code
2279
+ * @param {string} projectName Name of the project
2280
+ * @param {string} packageName Name of the package
2281
+ * @param {string} path Path to the model within the package (used to resolve relative imports)
2282
+ * @param {CompileRequest} compileRequest
2283
+ * @param {*} [options] Override http request option.
2284
+ * @throws {RequiredError}
2285
+ */
2286
+ compileModelSource(projectName: string, packageName: string, path: string, compileRequest: CompileRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CompileResult>>;
2160
2287
  /**
2161
2288
  * Executes a Malloy query against a model and returns the results. The query can be specified as a raw Malloy query string or by referencing a named query within the model. This endpoint supports both ad-hoc queries and predefined model queries, making it flexible for various use cases including data exploration, reporting, and application integration.
2162
2289
  * @summary Execute Malloy query
@@ -2195,6 +2322,17 @@ export declare const ModelsApiFp: (configuration?: Configuration) => {
2195
2322
  * @export
2196
2323
  */
2197
2324
  export declare const ModelsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
2325
+ /**
2326
+ * Compiles Malloy source code in the context of a specific model\'s directory, allowing relative imports to resolve correctly against sibling model files. Returns compilation status and any problems (errors or warnings) found.
2327
+ * @summary Compile Malloy source code
2328
+ * @param {string} projectName Name of the project
2329
+ * @param {string} packageName Name of the package
2330
+ * @param {string} path Path to the model within the package (used to resolve relative imports)
2331
+ * @param {CompileRequest} compileRequest
2332
+ * @param {*} [options] Override http request option.
2333
+ * @throws {RequiredError}
2334
+ */
2335
+ compileModelSource(projectName: string, packageName: string, path: string, compileRequest: CompileRequest, options?: RawAxiosRequestConfig): AxiosPromise<CompileResult>;
2198
2336
  /**
2199
2337
  * Executes a Malloy query against a model and returns the results. The query can be specified as a raw Malloy query string or by referencing a named query within the model. This endpoint supports both ad-hoc queries and predefined model queries, making it flexible for various use cases including data exploration, reporting, and application integration.
2200
2338
  * @summary Execute Malloy query
@@ -2235,6 +2373,18 @@ export declare const ModelsApiFactory: (configuration?: Configuration, basePath?
2235
2373
  * @extends {BaseAPI}
2236
2374
  */
2237
2375
  export declare class ModelsApi extends BaseAPI {
2376
+ /**
2377
+ * Compiles Malloy source code in the context of a specific model\'s directory, allowing relative imports to resolve correctly against sibling model files. Returns compilation status and any problems (errors or warnings) found.
2378
+ * @summary Compile Malloy source code
2379
+ * @param {string} projectName Name of the project
2380
+ * @param {string} packageName Name of the package
2381
+ * @param {string} path Path to the model within the package (used to resolve relative imports)
2382
+ * @param {CompileRequest} compileRequest
2383
+ * @param {*} [options] Override http request option.
2384
+ * @throws {RequiredError}
2385
+ * @memberof ModelsApi
2386
+ */
2387
+ compileModelSource(projectName: string, packageName: string, path: string, compileRequest: CompileRequest, options?: RawAxiosRequestConfig): Promise< AxiosResponse<CompileResult, any, {}>>;
2238
2388
  /**
2239
2389
  * Executes a Malloy query against a model and returns the results. The query can be specified as a raw Malloy query string or by referencing a named query within the model. This endpoint supports both ad-hoc queries and predefined model queries, making it flexible for various use cases including data exploration, reporting, and application integration.
2240
2390
  * @summary Execute Malloy query
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../ServerProvider-CuqrXSm_.cjs.js");exports.AttachedDatabaseTypeEnum=o.AttachedDatabaseTypeEnum;exports.Configuration=o.Configuration;exports.ConnectionStatusStatusEnum=o.ConnectionStatusStatusEnum;exports.ConnectionTypeEnum=o.ConnectionTypeEnum;exports.ConnectionsApi=o.ConnectionsApi;exports.ConnectionsApiAxiosParamCreator=o.ConnectionsApiAxiosParamCreator;exports.ConnectionsApiFactory=o.ConnectionsApiFactory;exports.ConnectionsApiFp=o.ConnectionsApiFp;exports.ConnectionsTestApi=o.ConnectionsTestApi;exports.ConnectionsTestApiAxiosParamCreator=o.ConnectionsTestApiAxiosParamCreator;exports.ConnectionsTestApiFactory=o.ConnectionsTestApiFactory;exports.ConnectionsTestApiFp=o.ConnectionsTestApiFp;exports.DatabaseTypeEnum=o.DatabaseTypeEnum;exports.DatabasesApi=o.DatabasesApi;exports.DatabasesApiAxiosParamCreator=o.DatabasesApiAxiosParamCreator;exports.DatabasesApiFactory=o.DatabasesApiFactory;exports.DatabasesApiFp=o.DatabasesApiFp;exports.ModelsApi=o.ModelsApi;exports.ModelsApiAxiosParamCreator=o.ModelsApiAxiosParamCreator;exports.ModelsApiFactory=o.ModelsApiFactory;exports.ModelsApiFp=o.ModelsApiFp;exports.NotebookCellResultTypeEnum=o.NotebookCellResultTypeEnum;exports.NotebookCellTypeEnum=o.NotebookCellTypeEnum;exports.NotebooksApi=o.NotebooksApi;exports.NotebooksApiAxiosParamCreator=o.NotebooksApiAxiosParamCreator;exports.NotebooksApiFactory=o.NotebooksApiFactory;exports.NotebooksApiFp=o.NotebooksApiFp;exports.PackagesApi=o.PackagesApi;exports.PackagesApiAxiosParamCreator=o.PackagesApiAxiosParamCreator;exports.PackagesApiFactory=o.PackagesApiFactory;exports.PackagesApiFp=o.PackagesApiFp;exports.ProjectsApi=o.ProjectsApi;exports.ProjectsApiAxiosParamCreator=o.ProjectsApiAxiosParamCreator;exports.ProjectsApiFactory=o.ProjectsApiFactory;exports.ProjectsApiFp=o.ProjectsApiFp;exports.PublisherApi=o.PublisherApi;exports.PublisherApiAxiosParamCreator=o.PublisherApiAxiosParamCreator;exports.PublisherApiFactory=o.PublisherApiFactory;exports.PublisherApiFp=o.PublisherApiFp;exports.ServerProvider=o.ServerProvider;exports.ServerStatusOperationalStateEnum=o.ServerStatusOperationalStateEnum;exports.WatchModeApi=o.WatchModeApi;exports.WatchModeApiAxiosParamCreator=o.WatchModeApiAxiosParamCreator;exports.WatchModeApiFactory=o.WatchModeApiFactory;exports.WatchModeApiFp=o.WatchModeApiFp;exports.globalQueryClient=o.globalQueryClient;exports.useServer=o.useServer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ServerProvider-EILsjA_b.cjs.js");exports.AttachedDatabaseTypeEnum=e.AttachedDatabaseTypeEnum;exports.CompileProblemSeverityEnum=e.CompileProblemSeverityEnum;exports.CompileResultStatusEnum=e.CompileResultStatusEnum;exports.Configuration=e.Configuration;exports.ConnectionStatusStatusEnum=e.ConnectionStatusStatusEnum;exports.ConnectionTypeEnum=e.ConnectionTypeEnum;exports.ConnectionsApi=e.ConnectionsApi;exports.ConnectionsApiAxiosParamCreator=e.ConnectionsApiAxiosParamCreator;exports.ConnectionsApiFactory=e.ConnectionsApiFactory;exports.ConnectionsApiFp=e.ConnectionsApiFp;exports.ConnectionsTestApi=e.ConnectionsTestApi;exports.ConnectionsTestApiAxiosParamCreator=e.ConnectionsTestApiAxiosParamCreator;exports.ConnectionsTestApiFactory=e.ConnectionsTestApiFactory;exports.ConnectionsTestApiFp=e.ConnectionsTestApiFp;exports.DatabaseTypeEnum=e.DatabaseTypeEnum;exports.DatabasesApi=e.DatabasesApi;exports.DatabasesApiAxiosParamCreator=e.DatabasesApiAxiosParamCreator;exports.DatabasesApiFactory=e.DatabasesApiFactory;exports.DatabasesApiFp=e.DatabasesApiFp;exports.ModelsApi=e.ModelsApi;exports.ModelsApiAxiosParamCreator=e.ModelsApiAxiosParamCreator;exports.ModelsApiFactory=e.ModelsApiFactory;exports.ModelsApiFp=e.ModelsApiFp;exports.NotebookCellResultTypeEnum=e.NotebookCellResultTypeEnum;exports.NotebookCellTypeEnum=e.NotebookCellTypeEnum;exports.NotebooksApi=e.NotebooksApi;exports.NotebooksApiAxiosParamCreator=e.NotebooksApiAxiosParamCreator;exports.NotebooksApiFactory=e.NotebooksApiFactory;exports.NotebooksApiFp=e.NotebooksApiFp;exports.PackagesApi=e.PackagesApi;exports.PackagesApiAxiosParamCreator=e.PackagesApiAxiosParamCreator;exports.PackagesApiFactory=e.PackagesApiFactory;exports.PackagesApiFp=e.PackagesApiFp;exports.ProjectsApi=e.ProjectsApi;exports.ProjectsApiAxiosParamCreator=e.ProjectsApiAxiosParamCreator;exports.ProjectsApiFactory=e.ProjectsApiFactory;exports.ProjectsApiFp=e.ProjectsApiFp;exports.PublisherApi=e.PublisherApi;exports.PublisherApiAxiosParamCreator=e.PublisherApiAxiosParamCreator;exports.PublisherApiFactory=e.PublisherApiFactory;exports.PublisherApiFp=e.PublisherApiFp;exports.ServerProvider=e.ServerProvider;exports.ServerStatusOperationalStateEnum=e.ServerStatusOperationalStateEnum;exports.WatchModeApi=e.WatchModeApi;exports.WatchModeApiAxiosParamCreator=e.WatchModeApiAxiosParamCreator;exports.WatchModeApiFactory=e.WatchModeApiFactory;exports.WatchModeApiFp=e.WatchModeApiFp;exports.globalQueryClient=e.globalQueryClient;exports.useServer=e.useServer;
@@ -1,50 +1,52 @@
1
- import { A as o, T as e, a as t, C as i, h as r, d as p, f as A, e as n, l as c, i as C, k as P, j as u, D as F, p as b, m as l, o as m, n as y, s as d, M as k, r as x, q as h, b as T, N as M, x as E, t as S, w as g, v as D, B as N, P as j, z as v, y as W, H as f, E as O, G as Q, F as R, L as q, I as w, K as z, J as B, S as G, c as H, R as I, W as J, Q as K, O as L, g as U, u as V } from "../ServerProvider-B-rFU47r.es.js";
1
+ import { A as o, C as e, a as t, V as i, c as r, b as p, j as A, f as n, i as c, h as C, n as P, k as m, m as u, l, D as b, r as F, o as y, q as d, p as k, v as x, M as h, t as E, s as S, d as T, N as M, z as g, w as D, y as N, x as v, F as j, P as W, E as f, B as R, J as O, G as Q, I as q, H as w, Q as z, K as B, O as G, L as H, S as I, e as J, U as K, W as L, T as U, R as V, g as X, u as Y } from "../ServerProvider-B75bEFYb.es.js";
2
2
  export {
3
3
  o as AttachedDatabaseTypeEnum,
4
- e as Configuration,
5
- t as ConnectionStatusStatusEnum,
6
- i as ConnectionTypeEnum,
7
- r as ConnectionsApi,
8
- p as ConnectionsApiAxiosParamCreator,
9
- A as ConnectionsApiFactory,
10
- n as ConnectionsApiFp,
11
- c as ConnectionsTestApi,
12
- C as ConnectionsTestApiAxiosParamCreator,
13
- P as ConnectionsTestApiFactory,
14
- u as ConnectionsTestApiFp,
15
- F as DatabaseTypeEnum,
16
- b as DatabasesApi,
17
- l as DatabasesApiAxiosParamCreator,
18
- m as DatabasesApiFactory,
19
- y as DatabasesApiFp,
20
- d as ModelsApi,
21
- k as ModelsApiAxiosParamCreator,
22
- x as ModelsApiFactory,
23
- h as ModelsApiFp,
4
+ e as CompileProblemSeverityEnum,
5
+ t as CompileResultStatusEnum,
6
+ i as Configuration,
7
+ r as ConnectionStatusStatusEnum,
8
+ p as ConnectionTypeEnum,
9
+ A as ConnectionsApi,
10
+ n as ConnectionsApiAxiosParamCreator,
11
+ c as ConnectionsApiFactory,
12
+ C as ConnectionsApiFp,
13
+ P as ConnectionsTestApi,
14
+ m as ConnectionsTestApiAxiosParamCreator,
15
+ u as ConnectionsTestApiFactory,
16
+ l as ConnectionsTestApiFp,
17
+ b as DatabaseTypeEnum,
18
+ F as DatabasesApi,
19
+ y as DatabasesApiAxiosParamCreator,
20
+ d as DatabasesApiFactory,
21
+ k as DatabasesApiFp,
22
+ x as ModelsApi,
23
+ h as ModelsApiAxiosParamCreator,
24
+ E as ModelsApiFactory,
25
+ S as ModelsApiFp,
24
26
  T as NotebookCellResultTypeEnum,
25
27
  M as NotebookCellTypeEnum,
26
- E as NotebooksApi,
27
- S as NotebooksApiAxiosParamCreator,
28
- g as NotebooksApiFactory,
29
- D as NotebooksApiFp,
30
- N as PackagesApi,
31
- j as PackagesApiAxiosParamCreator,
32
- v as PackagesApiFactory,
33
- W as PackagesApiFp,
34
- f as ProjectsApi,
35
- O as ProjectsApiAxiosParamCreator,
36
- Q as ProjectsApiFactory,
37
- R as ProjectsApiFp,
38
- q as PublisherApi,
39
- w as PublisherApiAxiosParamCreator,
40
- z as PublisherApiFactory,
41
- B as PublisherApiFp,
42
- G as ServerProvider,
43
- H as ServerStatusOperationalStateEnum,
44
- I as WatchModeApi,
45
- J as WatchModeApiAxiosParamCreator,
46
- K as WatchModeApiFactory,
47
- L as WatchModeApiFp,
48
- U as globalQueryClient,
49
- V as useServer
28
+ g as NotebooksApi,
29
+ D as NotebooksApiAxiosParamCreator,
30
+ N as NotebooksApiFactory,
31
+ v as NotebooksApiFp,
32
+ j as PackagesApi,
33
+ W as PackagesApiAxiosParamCreator,
34
+ f as PackagesApiFactory,
35
+ R as PackagesApiFp,
36
+ O as ProjectsApi,
37
+ Q as ProjectsApiAxiosParamCreator,
38
+ q as ProjectsApiFactory,
39
+ w as ProjectsApiFp,
40
+ z as PublisherApi,
41
+ B as PublisherApiAxiosParamCreator,
42
+ G as PublisherApiFactory,
43
+ H as PublisherApiFp,
44
+ I as ServerProvider,
45
+ J as ServerStatusOperationalStateEnum,
46
+ K as WatchModeApi,
47
+ L as WatchModeApiAxiosParamCreator,
48
+ U as WatchModeApiFactory,
49
+ V as WatchModeApiFp,
50
+ X as globalQueryClient,
51
+ Y as useServer
50
52
  };
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var H2=Object.create;var Cf=Object.defineProperty;var U2=Object.getOwnPropertyDescriptor;var z2=Object.getOwnPropertyNames;var V2=Object.getPrototypeOf,W2=Object.prototype.hasOwnProperty;var q2=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of z2(t))!W2.call(e,o)&&o!==n&&Cf(e,o,{get:()=>t[o],enumerable:!(r=U2(t,o))||r.enumerable});return e};var ju=(e,t,n)=>(n=e!=null?H2(V2(e)):{},q2(t||!e||!e.__esModule?Cf(n,"default",{value:e,enumerable:!0}):n,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),I=require("@mui/material"),W=require("react"),Br=require("@tanstack/react-query"),it=require("./ServerProvider-CuqrXSm_.cjs.js"),Y2=require("axios"),An=require("@mui/icons-material"),ct=require("@mui/system"),G2=require("@emotion/styled"),K2=require("@emotion/react"),ms=require("react-dom"),pl=require("markdown-to-jsx"),i0=require("@react-spring/web"),Q2=require("react-router-dom");function l0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const k=l0(W),X2=l0(ms),Ef=e=>e,Z2=()=>{let e=Ef;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Ef}}},u0=Z2();function Nr(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function ke(e){if(typeof e!="string")throw new Error(Nr(7));return e.charAt(0).toUpperCase()+e.slice(1)}function vf(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hu={exports:{}},Uu,Tf;function J2(){if(Tf)return Uu;Tf=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Uu=e,Uu}var zu,Sf;function eC(){if(Sf)return zu;Sf=1;var e=J2();function t(){}function n(){}return n.resetWarningCache=t,zu=function(){function r(s,i,l,u,c,d){if(d!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function o(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},zu}var kf;function tC(){return kf||(kf=1,Hu.exports=eC()()),Hu.exports}var nC=tC();const ce=tr(nC);function c0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=c0(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function De(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=c0(e))&&(r&&(r+=" "),r+=t);return r}function Le(e,t,n=void 0){const r={};for(const o in e){const a=e[o];let s="",i=!0;for(let l=0;l<a.length;l+=1){const u=a[l];u&&(s+=(i===!0?"":" ")+t(u),i=!1,n&&n[u]&&(s+=" "+n[u]))}r[o]=s}return r}var Vu={exports:{}},gt={};/**
1
+ "use strict";var H2=Object.create;var Cf=Object.defineProperty;var U2=Object.getOwnPropertyDescriptor;var z2=Object.getOwnPropertyNames;var V2=Object.getPrototypeOf,W2=Object.prototype.hasOwnProperty;var q2=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of z2(t))!W2.call(e,o)&&o!==n&&Cf(e,o,{get:()=>t[o],enumerable:!(r=U2(t,o))||r.enumerable});return e};var ju=(e,t,n)=>(n=e!=null?H2(V2(e)):{},q2(t||!e||!e.__esModule?Cf(n,"default",{value:e,enumerable:!0}):n,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),I=require("@mui/material"),W=require("react"),Br=require("@tanstack/react-query"),it=require("./ServerProvider-EILsjA_b.cjs.js"),Y2=require("axios"),An=require("@mui/icons-material"),ct=require("@mui/system"),G2=require("@emotion/styled"),K2=require("@emotion/react"),ms=require("react-dom"),pl=require("markdown-to-jsx"),i0=require("@react-spring/web"),Q2=require("react-router-dom");function l0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const k=l0(W),X2=l0(ms),Ef=e=>e,Z2=()=>{let e=Ef;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Ef}}},u0=Z2();function Nr(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function ke(e){if(typeof e!="string")throw new Error(Nr(7));return e.charAt(0).toUpperCase()+e.slice(1)}function vf(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hu={exports:{}},Uu,Tf;function J2(){if(Tf)return Uu;Tf=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Uu=e,Uu}var zu,Sf;function eC(){if(Sf)return zu;Sf=1;var e=J2();function t(){}function n(){}return n.resetWarningCache=t,zu=function(){function r(s,i,l,u,c,d){if(d!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function o(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},zu}var kf;function tC(){return kf||(kf=1,Hu.exports=eC()()),Hu.exports}var nC=tC();const ce=tr(nC);function c0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=c0(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function De(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=c0(e))&&(r&&(r+=" "),r+=t);return r}function Le(e,t,n=void 0){const r={};for(const o in e){const a=e[o];let s="",i=!0;for(let l=0;l<a.length;l+=1){const u=a[l];u&&(s+=(i===!0?"":" ")+t(u),i=!1,n&&n[u]&&(s+=" "+n[u]))}r[o]=s}return r}var Vu={exports:{}},gt={};/**
2
2
  * @license React
3
3
  * react-is.production.js
4
4
  *
package/dist/index.es.js CHANGED
@@ -3,8 +3,8 @@ import { styled as sn, Card as Ra, CardContent as Na, CardMedia as yC, Box as He
3
3
  import * as k from "react";
4
4
  import ve, { useEffect as Ut, useImperativeHandle as W0, useContext as ti, Fragment as q0, useMemo as ft, useRef as pn, useReducer as kC, useState as Ye, Suspense as Cp, lazy as wC, createContext as _C, isValidElement as xl, cloneElement as Cl, Children as IC, useCallback as go, useLayoutEffect as AC } from "react";
5
5
  import { useQuery as DC, useMutation as PC, useQueryClient as aa } from "@tanstack/react-query";
6
- import { u as ht, g as Y0, C as G0 } from "./ServerProvider-B-rFU47r.es.js";
7
- import { S as oq } from "./ServerProvider-B-rFU47r.es.js";
6
+ import { u as ht, g as Y0, b as G0 } from "./ServerProvider-B75bEFYb.es.js";
7
+ import { S as oq } from "./ServerProvider-B75bEFYb.es.js";
8
8
  import RC from "axios";
9
9
  import { Warning as NC, Add as K0, Launch as MC, AddCircleRounded as OC, Delete as Ep, Edit as vp, MoreVert as Q0 } from "@mui/icons-material";
10
10
  import { unstable_createGetCssVar as LC, createSpacing as FC, useTheme as $C, GlobalStyles as BC, unstable_memoTheme as HC, createStack as UC, Stack as zC, Box as VC, keyframes as _s, css as X0, createBox as jC, shouldForwardProp as Z0, alpha as vn } from "@mui/system";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@malloy-publisher/sdk",
3
3
  "description": "Malloy Publisher SDK",
4
- "version": "0.0.165",
4
+ "version": "0.0.167",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",
@@ -108,6 +108,8 @@
108
108
  "eslint-plugin-react-hooks": "5.0.0",
109
109
  "eslint-plugin-storybook": "^0.11.4",
110
110
  "shiki": "^1.16.3",
111
+ "@shikijs/langs": "^1.16.3",
112
+ "@shikijs/themes": "^1.16.3",
111
113
  "vite": "^6.3.2",
112
114
  "vite-plugin-dts": "^4.5.3",
113
115
  "vite-plugin-svgr": "^4.3.0"
@@ -1 +0,0 @@
1
- "use strict";const q=require("react/jsx-runtime"),B=require("@tanstack/react-query"),u=require("axios"),N=require("react"),m="http://localhost/api/v0".replace(/\/+$/,"");class A{constructor(a,e=m,r=u){this.basePath=e,this.axios=r,a&&(this.configuration=a,this.basePath=a.basePath??e)}configuration}class se 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 se(a,`Required parameter ${a} was null or undefined when calling ${c}.`)};function T(c,a,e=""){a!=null&&(typeof a=="object"?Array.isArray(a)?a.forEach(r=>T(c,r,e)):Object.keys(a).forEach(r=>T(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);T(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)}},ne={Bigquery:"bigquery",Snowflake:"snowflake",Postgres:"postgres",Gcs:"gcs",S3:"s3"},ce={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Mysql:"mysql",Duckdb:"duckdb",Motherduck:"motherduck"},le={Ok:"ok",Failed:"failed"},ie={Embedded:"embedded",Materialized:"materialized"},pe={Markdown:"markdown",Code:"code"},de={Markdown:"markdown",Code:"code"},he={Initializing:"initializing",Serving:"serving",Draining:"draining"},$=function(c){return{createConnection:async(a,e,r,t={})=>{d("createConnection","projectName",a),d("createConnection","connectionName",e),d("createConnection","connection",r);const o="/projects/{projectName}/connections/{connectionName}".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}},deleteConnection:async(a,e,r={})=>{d("deleteConnection","projectName",a),d("deleteConnection","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:"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}},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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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}},updateConnection:async(a,e,r,t={})=>{d("updateConnection","projectName",a),d("updateConnection","connectionName",e),d("updateConnection","updateConnectionRequest",r);const o="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",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}}}},y=function(c){const a=$(c);return{async createConnection(e,r,t,o){const s=await a.createConnection(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.createConnection"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async deleteConnection(e,r,t){const o=await a.deleteConnection(e,r,t),s=c?.serverIndex??0,n=P["ConnectionsApi.deleteConnection"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},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)},async updateConnection(e,r,t,o){const s=await a.updateConnection(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.updateConnection"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},ue=function(c,a,e){const r=y(c);return{createConnection(t,o,s,n){return r.createConnection(t,o,s,n).then(l=>l(e,a))},deleteConnection(t,o,s){return r.deleteConnection(t,o,s).then(n=>n(e,a))},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))},updateConnection(t,o,s,n){return r.updateConnection(t,o,s,n).then(l=>l(e,a))}}};class M extends A{createConnection(a,e,r,t){return y(this.configuration).createConnection(a,e,r,t).then(o=>o(this.axios,this.basePath))}deleteConnection(a,e,r){return y(this.configuration).deleteConnection(a,e,r).then(t=>t(this.axios,this.basePath))}getConnection(a,e,r){return y(this.configuration).getConnection(a,e,r).then(t=>t(this.axios,this.basePath))}getQuerydata(a,e,r,t,o){return y(this.configuration).getQuerydata(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getSqlsource(a,e,r,t){return y(this.configuration).getSqlsource(a,e,r,t).then(o=>o(this.axios,this.basePath))}getTable(a,e,r,t,o){return y(this.configuration).getTable(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getTablesource(a,e,r,t,o){return y(this.configuration).getTablesource(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getTemporarytable(a,e,r,t){return y(this.configuration).getTemporarytable(a,e,r,t).then(o=>o(this.axios,this.basePath))}listConnections(a,e){return y(this.configuration).listConnections(a,e).then(r=>r(this.axios,this.basePath))}listSchemas(a,e,r){return y(this.configuration).listSchemas(a,e,r).then(t=>t(this.axios,this.basePath))}listTables(a,e,r,t){return y(this.configuration).listTables(a,e,r,t).then(o=>o(this.axios,this.basePath))}postQuerydata(a,e,r,t,o){return y(this.configuration).postQuerydata(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}postSqlsource(a,e,r,t){return y(this.configuration).postSqlsource(a,e,r,t).then(o=>o(this.axios,this.basePath))}postTemporarytable(a,e,r,t){return y(this.configuration).postTemporarytable(a,e,r,t).then(o=>o(this.axios,this.basePath))}updateConnection(a,e,r,t){return y(this.configuration).updateConnection(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const E=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}}}},w=function(c){const a=E(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)}}},me=function(c,a,e){const r=w(c);return{testConnectionConfiguration(t,o){return r.testConnectionConfiguration(t,o).then(s=>s(e,a))}}};class Pe extends A{testConnectionConfiguration(a,e){return w(this.configuration).testConnectionConfiguration(a,e).then(r=>r(this.axios,this.basePath))}}const L=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}}}},Q=function(c){const a=L(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)}}},Ve=function(c,a,e){const r=Q(c);return{listDatabases(t,o,s,n){return r.listDatabases(t,o,s,n).then(l=>l(e,a))}}};class H extends A{listDatabases(a,e,r,t){return Q(this.configuration).listDatabases(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const W=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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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}}}},v=function(c){const a=W(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)}}},be=function(c,a,e){const r=v(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 D extends A{executeQueryModel(a,e,r,t,o){return v(this.configuration).executeQueryModel(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getModel(a,e,r,t,o){return v(this.configuration).getModel(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listModels(a,e,r,t){return v(this.configuration).listModels(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const f=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={},C={};o!==void 0&&(C.versionId=o),b(l,C);let k=i&&i.headers?i.headers:{};return p.headers={...h,...k,...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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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}}}},R=function(c){const a=f(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,C)=>g(l,u,m,c)(h,p||C)},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)}}},Oe=function(c,a,e){const r=R(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 G extends A{executeNotebookCell(a,e,r,t,o,s){return R(this.configuration).executeNotebookCell(a,e,r,t,o,s).then(n=>n(this.axios,this.basePath))}getNotebook(a,e,r,t,o){return R(this.configuration).getNotebook(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listNotebooks(a,e,r,t){return R(this.configuration).listNotebooks(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const z=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 C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...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=z(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)}}},ge=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 J extends A{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 K=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=K(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)}}},Ce=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 Y extends A{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 _=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}}}},F=function(c){const a=_(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)}}},ye=function(c,a,e){const r=F(c);return{getStatus(t){return r.getStatus(t).then(o=>o(e,a))}}};class X extends A{getStatus(a){return F(this.configuration).getStatus(a).then(e=>e(this.axios,this.basePath))}}const Z=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}}}},I=function(c){const a=Z(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)}}},Se=function(c,a,e){const r=I(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 ee extends A{getWatchStatus(a){return I(this.configuration).getWatchStatus(a).then(e=>e(this.axios,this.basePath))}startWatching(a,e){return I(this.configuration).startWatching(a,e).then(r=>r(this.axios,this.basePath))}stopWatching(a){return I(this.configuration).stopWatching(a).then(e=>e(this.axios,this.basePath))}}class te{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 ae=new B.QueryClient({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),re=N.createContext(void 0),Ae=(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 te({basePath:e});return{models:new D(t,e,r),publisher:new X(t,e,r),projects:new Y(t,e,r),packages:new J(t,e,r),notebooks:new G(t,e,r),connections:new M(t,e,r),databases:new H(t,e,r),watchMode:new ee(t,e,r)}},je=({children:c,getAccessToken:a,baseURL:e,mutable:r})=>{const t=N.useMemo(()=>Ae(e,a),[e,a]),o=e||`${window.location.protocol}//${window.location.host}/api/v0`,[s,n]=N.useState(r),[l,i]=N.useState(!0);N.useEffect(()=>{let h=!0;return(async()=>{try{const k=await t.publisher.getStatus();if(h){const oe=k.data?.frozenConfig;let U;oe?U=!1:r===void 0?U=!0:U=r,n(U),i(!1)}}catch(k){console.error("Failed to fetch publisher status:",k),h&&(n(r),i(!1))}})(),()=>{h=!1}},[t,r]);const p={server:o,getAccessToken:a,apiClients:t,mutable:s,isLoadingStatus:l};return q.jsx(B.QueryClientProvider,{client:ae,children:q.jsx(re.Provider,{value:p,children:c})})},xe=()=>{const c=N.useContext(re);if(c===void 0)throw new Error("useServer must be used within a ServerProvider");return c};exports.AttachedDatabaseTypeEnum=ne;exports.Configuration=te;exports.ConnectionStatusStatusEnum=le;exports.ConnectionTypeEnum=ce;exports.ConnectionsApi=M;exports.ConnectionsApiAxiosParamCreator=$;exports.ConnectionsApiFactory=ue;exports.ConnectionsApiFp=y;exports.ConnectionsTestApi=Pe;exports.ConnectionsTestApiAxiosParamCreator=E;exports.ConnectionsTestApiFactory=me;exports.ConnectionsTestApiFp=w;exports.DatabaseTypeEnum=ie;exports.DatabasesApi=H;exports.DatabasesApiAxiosParamCreator=L;exports.DatabasesApiFactory=Ve;exports.DatabasesApiFp=Q;exports.ModelsApi=D;exports.ModelsApiAxiosParamCreator=W;exports.ModelsApiFactory=be;exports.ModelsApiFp=v;exports.NotebookCellResultTypeEnum=de;exports.NotebookCellTypeEnum=pe;exports.NotebooksApi=G;exports.NotebooksApiAxiosParamCreator=f;exports.NotebooksApiFactory=Oe;exports.NotebooksApiFp=R;exports.PackagesApi=J;exports.PackagesApiAxiosParamCreator=z;exports.PackagesApiFactory=ge;exports.PackagesApiFp=j;exports.ProjectsApi=Y;exports.ProjectsApiAxiosParamCreator=K;exports.ProjectsApiFactory=Ce;exports.ProjectsApiFp=x;exports.PublisherApi=X;exports.PublisherApiAxiosParamCreator=_;exports.PublisherApiFactory=ye;exports.PublisherApiFp=F;exports.ServerProvider=je;exports.ServerStatusOperationalStateEnum=he;exports.WatchModeApi=ee;exports.WatchModeApiAxiosParamCreator=Z;exports.WatchModeApiFactory=Se;exports.WatchModeApiFp=I;exports.globalQueryClient=ae;exports.useServer=xe;