@malloy-publisher/sdk 0.0.41 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/{RenderedResult-gQPXZIVQ.js → RenderedResult-D4wHWzQL.js} +2 -2
  2. package/dist/{RenderedResult-BX2zW03q.cjs → RenderedResult-DR4Ejhm0.cjs} +1 -1
  3. package/dist/components/Notebook/Notebook.d.ts +4 -3
  4. package/dist/hooks/useQueryWithApiError.d.ts +10 -0
  5. package/dist/{index-xo1oaGoD.cjs → index-C7HUzsul.cjs} +522 -522
  6. package/dist/{index-DCLrfHfE.js → index-wBKeSKqo.js} +21302 -21344
  7. package/dist/index.cjs.js +1 -1
  8. package/dist/index.es.js +16 -15
  9. package/dist/{vendor-BCM56_2K.js → vendor-BKsYdkmG.js} +5456 -5458
  10. package/dist/{vendor-Bg9-K32d.cjs → vendor-hHfbZ4ZT.cjs} +30 -30
  11. package/openapitools.json +1 -1
  12. package/package.json +2 -2
  13. package/src/components/ApiErrorDisplay.tsx +12 -12
  14. package/src/components/Home/Home.tsx +9 -14
  15. package/src/components/Model/Model.tsx +18 -45
  16. package/src/components/Model/NamedQueries.tsx +38 -42
  17. package/src/components/Model/SourcesExplorer.tsx +47 -51
  18. package/src/components/MutableNotebook/ModelPicker.tsx +12 -18
  19. package/src/components/Notebook/Notebook.tsx +37 -60
  20. package/src/components/Package/Config.tsx +28 -34
  21. package/src/components/Package/Connections.tsx +12 -18
  22. package/src/components/Package/Databases.tsx +12 -18
  23. package/src/components/Package/Models.tsx +12 -20
  24. package/src/components/Package/Notebooks.tsx +13 -12
  25. package/src/components/Package/Schedules.tsx +12 -18
  26. package/src/components/Project/About.tsx +12 -18
  27. package/src/components/Project/ConnectionExplorer.tsx +49 -65
  28. package/src/components/Project/Packages.tsx +12 -18
  29. package/src/components/QueryResult/QueryResult.tsx +24 -30
  30. package/src/hooks/useQueryWithApiError.ts +114 -0
  31. package/src/index.ts +5 -0
@@ -7,36 +7,30 @@ import {
7
7
  ListItemText,
8
8
  Typography,
9
9
  } from "@mui/material";
10
- import { QueryClient, useQuery } from "@tanstack/react-query";
11
10
  import { Configuration, PackagesApi } from "../../client";
12
11
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
13
12
  import { Loading } from "../Loading";
14
13
  import { StyledCard, StyledCardContent } from "../styles";
15
14
  import { usePackage } from "./PackageProvider";
15
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
16
16
 
17
17
  const packagesApi = new PackagesApi(new Configuration());
18
- const queryClient = new QueryClient();
19
18
 
20
19
  export default function Config() {
21
20
  const { server, projectName, packageName, versionId, accessToken } =
22
21
  usePackage();
23
22
 
24
- const { data, isSuccess, isError, error } = useQuery(
25
- {
26
- queryKey: ["package", server, projectName, packageName, versionId],
27
- queryFn: () =>
28
- packagesApi.getPackage(projectName, packageName, versionId, false, {
29
- baseURL: server,
30
- withCredentials: !accessToken,
31
- headers: {
32
- Authorization: accessToken && `Bearer ${accessToken}`,
33
- },
34
- }),
35
- retry: false,
36
- throwOnError: false,
37
- },
38
- queryClient,
39
- );
23
+ const { data, isSuccess, isError, error } = useQueryWithApiError({
24
+ queryKey: ["package", server, projectName, packageName, versionId],
25
+ queryFn: () =>
26
+ packagesApi.getPackage(projectName, packageName, versionId, false, {
27
+ baseURL: server,
28
+ withCredentials: !accessToken,
29
+ headers: {
30
+ Authorization: accessToken && `Bearer ${accessToken}`,
31
+ },
32
+ }),
33
+ });
40
34
 
41
35
  return (
42
36
  <StyledCard variant="outlined" sx={{ padding: "10px", width: "100%" }}>
@@ -57,9 +51,9 @@ export default function Config() {
57
51
  <ListItemText primary="Name" secondary={packageName} />
58
52
  </ListItem>
59
53
  {!isSuccess && !isError && (
60
- <Typography variant="body2" sx={{ p: "20px", m: "auto" }}>
54
+ <ListItem>
61
55
  <Loading text="Fetching Package Metadata..." />
62
- </Typography>
56
+ </ListItem>
63
57
  )}
64
58
  {isSuccess &&
65
59
  ((data.data && (
@@ -70,20 +64,20 @@ export default function Config() {
70
64
  />
71
65
  </ListItem>
72
66
  )) || (
73
- <ListItem
74
- disablePadding={true}
75
- dense={true}
76
- sx={{ mt: "20px" }}
77
- >
78
- <ErrorIcon
79
- sx={{
80
- color: "grey.600",
81
- mr: "10px",
82
- }}
83
- />
84
- <ListItemText primary={"No package manifest"} />
85
- </ListItem>
86
- ))}
67
+ <ListItem
68
+ disablePadding={true}
69
+ dense={true}
70
+ sx={{ mt: "20px" }}
71
+ >
72
+ <ErrorIcon
73
+ sx={{
74
+ color: "grey.600",
75
+ mr: "10px",
76
+ }}
77
+ />
78
+ <ListItemText primary={"No package manifest"} />
79
+ </ListItem>
80
+ ))}
87
81
  {isError && (
88
82
  <ApiErrorDisplay
89
83
  error={error}
@@ -7,15 +7,14 @@ import {
7
7
  TableRow,
8
8
  Typography,
9
9
  } from "@mui/material";
10
- import { QueryClient, useQuery } from "@tanstack/react-query";
11
10
  import { Configuration, ConnectionsApi } from "../../client";
12
11
  import { Connection as ApiConnection } from "../../client/api";
13
12
  import { StyledCard, StyledCardContent } from "../styles";
14
13
  import { usePackage } from "./PackageProvider";
15
14
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
15
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
16
16
 
17
17
  const connectionsApi = new ConnectionsApi(new Configuration());
18
- const queryClient = new QueryClient();
19
18
 
20
19
  // TODO(jjs) - Move this UI to the ConnectionExplorer component
21
20
  function Connection({ connection }: { connection: ApiConnection }) {
@@ -34,22 +33,17 @@ function Connection({ connection }: { connection: ApiConnection }) {
34
33
  export default function Connections() {
35
34
  const { server, projectName, accessToken } = usePackage();
36
35
 
37
- const { data, isSuccess, isError, error } = useQuery(
38
- {
39
- queryKey: ["connections", server, projectName],
40
- queryFn: () =>
41
- connectionsApi.listConnections(projectName, {
42
- baseURL: server,
43
- withCredentials: !accessToken,
44
- headers: {
45
- Authorization: accessToken && `Bearer ${accessToken}`,
46
- },
47
- }),
48
- retry: false,
49
- throwOnError: false,
50
- },
51
- queryClient,
52
- );
36
+ const { data, isSuccess, isError, error } = useQueryWithApiError({
37
+ queryKey: ["connections", server, projectName],
38
+ queryFn: () =>
39
+ connectionsApi.listConnections(projectName, {
40
+ baseURL: server,
41
+ withCredentials: !accessToken,
42
+ headers: {
43
+ Authorization: accessToken && `Bearer ${accessToken}`,
44
+ },
45
+ }),
46
+ });
53
47
 
54
48
  return (
55
49
  <StyledCard variant="outlined" sx={{ padding: "10px", width: "100%" }}>
@@ -12,16 +12,15 @@ import {
12
12
  TableRow,
13
13
  Typography,
14
14
  } from "@mui/material";
15
- import { QueryClient, useQuery } from "@tanstack/react-query";
16
15
  import React from "react";
17
16
  import { Configuration, Database, DatabasesApi } from "../../client";
18
17
  import { StyledCard, StyledCardContent } from "../styles";
19
18
  import { usePackage } from "./PackageProvider";
20
19
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
21
20
  import { Loading } from "../Loading";
21
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
22
22
 
23
23
  const databasesApi = new DatabasesApi(new Configuration());
24
- const queryClient = new QueryClient();
25
24
 
26
25
  export default function Databases() {
27
26
  const { server, projectName, packageName, versionId, accessToken } =
@@ -41,22 +40,17 @@ export default function Databases() {
41
40
  setSelectedDatabase(null);
42
41
  };
43
42
 
44
- const { data, isError, error, isSuccess } = useQuery(
45
- {
46
- queryKey: ["databases", server, projectName, packageName, versionId],
47
- queryFn: () =>
48
- databasesApi.listDatabases(projectName, packageName, versionId, {
49
- baseURL: server,
50
- withCredentials: !accessToken,
51
- headers: {
52
- Authorization: accessToken && `Bearer ${accessToken}`,
53
- },
54
- }),
55
- retry: false,
56
- throwOnError: false,
57
- },
58
- queryClient,
59
- );
43
+ const { data, isError, error, isSuccess } = useQueryWithApiError({
44
+ queryKey: ["databases", server, projectName, packageName, versionId],
45
+ queryFn: () =>
46
+ databasesApi.listDatabases(projectName, packageName, versionId, {
47
+ baseURL: server,
48
+ withCredentials: !accessToken,
49
+ headers: {
50
+ Authorization: accessToken && `Bearer ${accessToken}`,
51
+ },
52
+ }),
53
+ });
60
54
  const formatRowSize = (size: number) => {
61
55
  if (size >= 1024 * 1024 * 1024 * 1024) {
62
56
  return `${(size / (1024 * 1024 * 1024)).toFixed(2)} T`;
@@ -1,16 +1,13 @@
1
1
  import { Box, Divider, Typography } from "@mui/material";
2
- import { QueryClient, useQuery } from "@tanstack/react-query";
3
- import axios from "axios";
4
2
  import { Configuration, ModelsApi } from "../../client";
5
3
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
6
4
  import { Loading } from "../Loading";
7
5
  import { StyledCard, StyledCardContent } from "../styles";
8
6
  import { FileTreeView } from "./FileTreeView";
9
7
  import { usePackage } from "./PackageProvider";
8
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
10
9
 
11
- axios.defaults.baseURL = "http://localhost:4000";
12
10
  const modelsApi = new ModelsApi(new Configuration());
13
- const queryClient = new QueryClient();
14
11
 
15
12
  const DEFAULT_EXPANDED_FOLDERS = ["notebooks/", "models/"];
16
13
 
@@ -22,22 +19,17 @@ export default function Models({ navigate }: ModelsProps) {
22
19
  const { server, projectName, packageName, versionId, accessToken } =
23
20
  usePackage();
24
21
 
25
- const { data, isError, error, isSuccess } = useQuery(
26
- {
27
- queryKey: ["models", server, projectName, packageName, versionId],
28
- queryFn: () =>
29
- modelsApi.listModels(projectName, packageName, versionId, {
30
- baseURL: server,
31
- withCredentials: !accessToken,
32
- headers: {
33
- Authorization: accessToken && `Bearer ${accessToken}`,
34
- },
35
- }),
36
- throwOnError: false,
37
- retry: false,
38
- },
39
- queryClient,
40
- );
22
+ const { data, isError, error, isSuccess } = useQueryWithApiError({
23
+ queryKey: ["models", server, projectName, packageName, versionId],
24
+ queryFn: () =>
25
+ modelsApi.listModels(projectName, packageName, versionId, {
26
+ baseURL: server,
27
+ withCredentials: !accessToken,
28
+ headers: {
29
+ Authorization: accessToken && `Bearer ${accessToken}`,
30
+ },
31
+ }),
32
+ });
41
33
 
42
34
  return (
43
35
  <StyledCard variant="outlined" sx={{ padding: "10px", width: "100%" }}>
@@ -1,14 +1,13 @@
1
1
  import { Box, Divider, Typography } from "@mui/material";
2
- import { QueryClient, useQuery } from "@tanstack/react-query";
3
2
  import { Configuration, NotebooksApi } from "../../client";
4
3
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
5
4
  import { Loading } from "../Loading";
6
5
  import { StyledCard, StyledCardContent } from "../styles";
7
6
  import { FileTreeView } from "./FileTreeView";
8
7
  import { usePackage } from "./PackageProvider";
8
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
9
9
 
10
10
  const notebooksApi = new NotebooksApi(new Configuration());
11
- const queryClient = new QueryClient();
12
11
 
13
12
  const DEFAULT_EXPANDED_FOLDERS = ["notebooks/"];
14
13
 
@@ -20,22 +19,24 @@ export default function Notebooks({ navigate }: NotebooksProps) {
20
19
  const { server, projectName, packageName, versionId, accessToken } =
21
20
  usePackage();
22
21
 
23
- const { data, isError, error, isSuccess } = useQuery(
24
- {
25
- queryKey: ["notebooks", server, projectName, packageName, versionId],
26
- queryFn: () =>
27
- notebooksApi.listNotebooks(projectName, packageName, versionId, {
22
+ const { data, isError, error, isSuccess } = useQueryWithApiError({
23
+ queryKey: ["notebooks", server, projectName, packageName, versionId],
24
+ queryFn: async () => {
25
+ const response = await notebooksApi.listNotebooks(
26
+ projectName,
27
+ packageName,
28
+ versionId,
29
+ {
28
30
  baseURL: server,
29
31
  withCredentials: !accessToken,
30
32
  headers: {
31
33
  Authorization: accessToken && `Bearer ${accessToken}`,
32
34
  },
33
- }),
34
- throwOnError: false,
35
- retry: false,
35
+ },
36
+ );
37
+ return response;
36
38
  },
37
- queryClient,
38
- );
39
+ });
39
40
 
40
41
  return (
41
42
  <StyledCard variant="outlined" sx={{ padding: "10px", width: "100%" }}>
@@ -10,36 +10,30 @@ import {
10
10
  TableRow,
11
11
  Typography,
12
12
  } from "@mui/material";
13
- import { QueryClient, useQuery } from "@tanstack/react-query";
14
13
  import { Configuration, SchedulesApi } from "../../client";
15
14
  import { StyledCard, StyledCardContent } from "../styles";
16
15
  import { usePackage } from "./PackageProvider";
17
16
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
18
17
  import { Loading } from "../Loading";
18
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
19
19
 
20
20
  const schedulesApi = new SchedulesApi(new Configuration());
21
- const queryClient = new QueryClient();
22
21
 
23
22
  export default function Schedules() {
24
23
  const { server, projectName, packageName, versionId, accessToken } =
25
24
  usePackage();
26
25
 
27
- const { data, isError, isLoading, error } = useQuery(
28
- {
29
- queryKey: ["schedules", server, projectName, packageName, versionId],
30
- queryFn: () =>
31
- schedulesApi.listSchedules(projectName, packageName, versionId, {
32
- baseURL: server,
33
- withCredentials: !accessToken,
34
- headers: {
35
- Authorization: accessToken && `Bearer ${accessToken}`,
36
- },
37
- }),
38
- retry: false,
39
- throwOnError: false,
40
- },
41
- queryClient,
42
- );
26
+ const { data, isError, isLoading, error } = useQueryWithApiError({
27
+ queryKey: ["schedules", server, projectName, packageName, versionId],
28
+ queryFn: () =>
29
+ schedulesApi.listSchedules(projectName, packageName, versionId, {
30
+ baseURL: server,
31
+ withCredentials: !accessToken,
32
+ headers: {
33
+ Authorization: accessToken && `Bearer ${accessToken}`,
34
+ },
35
+ }),
36
+ });
43
37
 
44
38
  if (isLoading) {
45
39
  return <Loading text="Fetching Schedules..." />;
@@ -2,33 +2,27 @@ import { Divider, Typography } from "@mui/material";
2
2
  import { Configuration, ProjectsApi } from "../../client";
3
3
  import Markdown from "markdown-to-jsx";
4
4
  import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
5
- import { QueryClient, useQuery } from "@tanstack/react-query";
6
5
  import { useProject } from "./Project";
7
6
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
8
7
  import { Loading } from "../Loading";
8
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
9
9
 
10
10
  const projectsApi = new ProjectsApi(new Configuration());
11
- const queryClient = new QueryClient();
12
11
 
13
12
  export default function About() {
14
13
  const { server, projectName, accessToken } = useProject();
15
14
 
16
- const { data, isSuccess, isError, error } = useQuery(
17
- {
18
- queryKey: ["about", server, projectName],
19
- queryFn: () =>
20
- projectsApi.getProject(projectName, false, {
21
- baseURL: server,
22
- withCredentials: true,
23
- headers: {
24
- Authorization: accessToken && `Bearer ${accessToken}`,
25
- },
26
- }),
27
- retry: false,
28
- throwOnError: false,
29
- },
30
- queryClient,
31
- );
15
+ const { data, isSuccess, isError, error } = useQueryWithApiError({
16
+ queryKey: ["about", server, projectName],
17
+ queryFn: () =>
18
+ projectsApi.getProject(projectName, false, {
19
+ baseURL: server,
20
+ withCredentials: true,
21
+ headers: {
22
+ Authorization: accessToken && `Bearer ${accessToken}`,
23
+ },
24
+ }),
25
+ });
32
26
 
33
27
  return (
34
28
  <>
@@ -21,15 +21,14 @@ import {
21
21
  TableHead,
22
22
  TableRow,
23
23
  } from "@mui/material";
24
- import { QueryClient, useQuery } from "@tanstack/react-query";
25
24
  import { ConnectionsApi } from "../../client/api";
26
25
  import { Configuration } from "../../client/configuration";
27
26
  import { useProject } from "./Project";
28
27
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
29
28
  import { Loading } from "../Loading";
29
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
30
30
 
31
31
  const connectionsApi = new ConnectionsApi(new Configuration());
32
- const queryClient = new QueryClient();
33
32
 
34
33
  interface ConnectionExplorerProps {
35
34
  connectionName: string;
@@ -47,22 +46,17 @@ export default function ConnectionExplorer({
47
46
  null,
48
47
  );
49
48
  const [showHiddenSchemas, setShowHiddenSchemas] = React.useState(false);
50
- const { data, isSuccess, isError, error, isLoading } = useQuery(
51
- {
52
- queryKey: ["tablePath", server, projectName, connectionName],
53
- queryFn: () =>
54
- connectionsApi.listSchemas(projectName, connectionName, {
55
- baseURL: server,
56
- withCredentials: !accessToken,
57
- headers: {
58
- Authorization: accessToken && `Bearer ${accessToken}`,
59
- },
60
- }),
61
- retry: false,
62
- throwOnError: false,
63
- },
64
- queryClient,
65
- );
49
+ const { data, isSuccess, isError, error, isLoading } = useQueryWithApiError({
50
+ queryKey: ["tablePath", server, projectName, connectionName],
51
+ queryFn: () =>
52
+ connectionsApi.listSchemas(projectName, connectionName, {
53
+ baseURL: server,
54
+ withCredentials: !accessToken,
55
+ headers: {
56
+ Authorization: accessToken && `Bearer ${accessToken}`,
57
+ },
58
+ }),
59
+ });
66
60
 
67
61
  return (
68
62
  <Grid container spacing={2}>
@@ -174,35 +168,30 @@ function TableViewer({
174
168
  }: TableViewerProps) {
175
169
  const { server, projectName, accessToken } = useProject();
176
170
 
177
- const { data, isSuccess, isError, error, isLoading } = useQuery(
178
- {
179
- queryKey: [
180
- "tablePathSchema",
181
- server,
171
+ const { data, isSuccess, isError, error, isLoading } = useQueryWithApiError({
172
+ queryKey: [
173
+ "tablePathSchema",
174
+ server,
175
+ projectName,
176
+ connectionName,
177
+ schemaName,
178
+ tableName,
179
+ ],
180
+ queryFn: () =>
181
+ connectionsApi.getTablesource(
182
182
  projectName,
183
183
  connectionName,
184
- schemaName,
185
184
  tableName,
186
- ],
187
- queryFn: () =>
188
- connectionsApi.getTablesource(
189
- projectName,
190
- connectionName,
191
- tableName,
192
- `${schemaName}.${tableName}`,
193
- {
194
- baseURL: server,
195
- withCredentials: !accessToken,
196
- headers: {
197
- Authorization: accessToken && `Bearer ${accessToken}`,
198
- },
185
+ `${schemaName}.${tableName}`,
186
+ {
187
+ baseURL: server,
188
+ withCredentials: !accessToken,
189
+ headers: {
190
+ Authorization: accessToken && `Bearer ${accessToken}`,
199
191
  },
200
- ),
201
- retry: false,
202
- throwOnError: false,
203
- },
204
- queryClient,
205
- );
192
+ },
193
+ ),
194
+ });
206
195
 
207
196
  if (isSuccess && data) {
208
197
  console.log(data);
@@ -289,28 +278,23 @@ function TablesInSchema({
289
278
  }: TablesInSchemaProps) {
290
279
  const { server, projectName, accessToken } = useProject();
291
280
 
292
- const { data, isSuccess, isError, error, isLoading } = useQuery(
293
- {
294
- queryKey: [
295
- "tablesInSchema",
296
- server,
297
- projectName,
298
- connectionName,
299
- schemaName,
300
- ],
301
- queryFn: () =>
302
- connectionsApi.listTables(projectName, connectionName, schemaName, {
303
- baseURL: server,
304
- withCredentials: !accessToken,
305
- headers: {
306
- Authorization: accessToken && `Bearer ${accessToken}`,
307
- },
308
- }),
309
- retry: false,
310
- throwOnError: false,
311
- },
312
- queryClient,
313
- );
281
+ const { data, isSuccess, isError, error, isLoading } = useQueryWithApiError({
282
+ queryKey: [
283
+ "tablesInSchema",
284
+ server,
285
+ projectName,
286
+ connectionName,
287
+ schemaName,
288
+ ],
289
+ queryFn: () =>
290
+ connectionsApi.listTables(projectName, connectionName, schemaName, {
291
+ baseURL: server,
292
+ withCredentials: !accessToken,
293
+ headers: {
294
+ Authorization: accessToken && `Bearer ${accessToken}`,
295
+ },
296
+ }),
297
+ });
314
298
 
315
299
  return (
316
300
  <>
@@ -1,13 +1,12 @@
1
1
  import { Box, Divider, Grid, Typography } from "@mui/material";
2
2
  import { Configuration, PackagesApi } from "../../client";
3
3
  import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
4
- import { QueryClient, useQuery } from "@tanstack/react-query";
5
4
  import { useProject } from "./Project";
6
5
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
7
6
  import { Loading } from "../Loading";
7
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
8
8
 
9
9
  const packagesApi = new PackagesApi(new Configuration());
10
- const queryClient = new QueryClient();
11
10
 
12
11
  interface PackagesProps {
13
12
  navigate: (to: string, event?: React.MouseEvent) => void;
@@ -16,22 +15,17 @@ interface PackagesProps {
16
15
  export default function Packages({ navigate }: PackagesProps) {
17
16
  const { server, projectName, accessToken } = useProject();
18
17
 
19
- const { data, isSuccess, isError, error } = useQuery(
20
- {
21
- queryKey: ["packages", server, projectName],
22
- queryFn: () =>
23
- packagesApi.listPackages(projectName, {
24
- baseURL: server,
25
- withCredentials: !accessToken,
26
- headers: {
27
- Authorization: accessToken && `Bearer ${accessToken}`,
28
- },
29
- }),
30
- retry: false,
31
- throwOnError: false,
32
- },
33
- queryClient,
34
- );
18
+ const { data, isSuccess, isError, error } = useQueryWithApiError({
19
+ queryKey: ["packages", server, projectName],
20
+ queryFn: () =>
21
+ packagesApi.listPackages(projectName, {
22
+ baseURL: server,
23
+ withCredentials: !accessToken,
24
+ headers: {
25
+ Authorization: accessToken && `Bearer ${accessToken}`,
26
+ },
27
+ }),
28
+ });
35
29
 
36
30
  return (
37
31
  <>