Skip to content

Commit 491910d

Browse files
committed
chore: Reorganize api interactions together
1 parent 71e4429 commit 491910d

File tree

179 files changed

+251
-252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+251
-252
lines changed

.github/CONTRIBUTING.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ If your change depends on updated Central Manager API types:
9393
pnpm update-sdk
9494
```
9595

96-
This fetches the OpenAPI spec into `dist/central-manager.json` and generates `src/lib/api.gen.d.ts`.
96+
This fetches the OpenAPI spec into `dist/central-manager.json` and generates `src/integrations/api/api.gen.d.ts`.
9797

9898

9999
## Branching and pull requests

.junie/guidelines.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Do:
7070
- Use `update-sdk` only if API types are part of the change.
7171

7272
Don’t:
73-
- Edit generated or build output (e.g., `web/`, `dist/`, `src/lib/api.gen.d.ts`).
73+
- Edit generated or build output (e.g., `web/`, `dist/`, `src/integrations/api/api.gen.d.ts`).
7474
- Introduce unused dependencies.
7575
- Commit large unrelated refactors.
7676

@@ -86,7 +86,6 @@ Don’t:
8686
If your work depends on updated API types:
8787
1. Ensure env vars are set (see above).
8888
2. Run `pnpm update-sdk`.
89-
3. Commit both `dist/central-manager.json` (if intended to vendor) and `src/lib/api.gen.d.ts` only when necessary.
9089

9190

9291
## Issue-type checklists

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Notes:
8080

8181
This repository can generate TypeScript definitions from the Central Manager OpenAPI schema.
8282

83-
- `pnpm update-sdk` — fetch the OpenAPI JSON and generate `src/lib/api.gen.d.ts`
83+
- `pnpm update-sdk` — fetch the OpenAPI JSON and generate `src/integrations/api/api.gen.d.ts`
8484

8585
Environment variables required (typically in `.env.local` when running the script locally):
8686

@@ -92,7 +92,7 @@ HDB_ADMIN_PASSWORD_FOR_OPENAPI=<password>
9292

9393
What the script does:
9494
1) Downloads `${VITE_CENTRAL_MANAGER_API_URL}/openapi` into `./dist/central-manager.json` using the admin credentials
95-
2) Runs `openapi-typescript` to generate `src/lib/api.gen.d.ts`
95+
2) Runs `openapi-typescript` to generate `src/integrations/api/api.gen.d.ts`
9696

9797

9898
## Linting, formatting, and type-checking

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import globals from 'globals';
55
import tseslint from 'typescript-eslint';
66

77
export default tseslint.config(
8-
{ ignores: ['coverage', 'dist', 'src/lib/api.gen.d.ts', 'vitest.config.ts'] },
8+
{ ignores: ['coverage', 'dist', 'src/integrations/api/api.gen.d.ts', 'vitest.config.ts'] },
99
{
1010
languageOptions: {
1111
parserOptions: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build:prod": "tsc -b && vite build --mode prod",
1515
"commitlint": "commitlint --edit",
1616
"release": "semantic-release",
17-
"update-sdk": "dotenv -e .env.local -- npm run update-sdk:fetch && npx -y openapi-typescript --root-types --alphabetize --enum ./dist/central-manager.json -o ./src/lib/api.gen.d.ts",
17+
"update-sdk": "dotenv -e .env.local -- npm run update-sdk:fetch && npx -y openapi-typescript --root-types --alphabetize --enum ./dist/central-manager.json -o src/integrations/api/api.gen.d.ts",
1818
"update-sdk:fetch": "mkdir -p dist && curl --location \"$VITE_CENTRAL_MANAGER_API_URL/openapi\" -u \"$HDB_ADMIN_USERNAME_FOR_OPENAPI:$HDB_ADMIN_PASSWORD_FOR_OPENAPI\" -o ./dist/central-manager.json",
1919
"lint": "eslint .",
2020
"prepare": "husky",

src/components/ApplyLicensesButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Button } from '@/components/ui/button';
22
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
33
import { useApplyLicensesClick } from '@/hooks/useApplyLicensesClick';
4-
import { SchemaLicense } from '@/lib/api.gen';
4+
import { SchemaLicense } from '@/integrations/api/api.gen';
55
import { pluralize } from '@/lib/pluralize';
66
import { RotateCcwIcon } from 'lucide-react';
77

src/components/Breadcrumbs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { RestartButton } from '@/components/RestartButton';
22
import { isLocalStudio } from '@/config/constants';
33
import { useInstanceClientIdParams } from '@/config/useInstanceClient';
4-
import { Cluster, Instance, Organization } from '@/lib/api.patch';
4+
import { Cluster, Instance, Organization } from '@/integrations/api/api.patch';
55
import { capitalizeWords } from '@/lib/string/capitalizeWords';
66
import { Link, useLocation, useParams, useRouteContext } from '@tanstack/react-router';
77
import { HomeIcon } from 'lucide-react';

src/config/getInstanceClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { apiClient } from '@/config/apiClient';
22
import { authStore, EntityIds, OverallAppSignIn } from '@/features/auth/store/authStore';
3-
import { rejectReplicationFailures } from '@/lib/api/replication';
3+
import { rejectReplicationFailures } from '@/integrations/api/replication';
44
import axios from 'axios';
55

66
interface InstanceClient {

src/config/typedAxios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
2+
import type { paths } from '@/integrations/api/api.gen';
23
import type { Axios, AxiosRequestConfig, AxiosResponse } from 'axios';
3-
import type { paths } from '@/lib/api.gen';
44

55
export interface TypedAxios extends Axios {
66
get<

src/features/auth/ClusterInstanceSignIn.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { useInstanceClientIdParams } from '@/config/useInstanceClient';
1414
import { useClusterInstanceSignIn } from '@/features/auth/hooks/useClusterInstanceSignIn';
1515
import { authStore } from '@/features/auth/store/authStore';
1616
import { getClusterInfoQueryOptions } from '@/features/cluster/queries/getClusterInfoQuery';
17-
import { getInstanceHealthQueryOptions } from '@/features/instance/operations/queries/getInstanceHealth';
18-
import { UsernameSignInSchema } from '@/features/instance/operations/schemas/signInSchema';
19-
import { SchemaHdbInstance } from '@/lib/api.gen';
17+
import { SchemaHdbInstance } from '@/integrations/api/api.gen';
18+
import { UsernameSignInSchema } from '@/integrations/api/instance/auth/signInSchema';
19+
import { getInstanceHealthQueryOptions } from '@/integrations/api/instance/status/getInstanceHealth';
2020
import { CrossLocalhostIssueType, detectCrossLocalhostUrls } from '@/lib/urls/detectCrossLocalhostUrls';
2121
import { getOperationsUrlForCluster } from '@/lib/urls/getOperationsUrlForCluster';
2222
import { getOperationsUrlForInstance } from '@/lib/urls/getOperationsUrlForInstance';

0 commit comments

Comments
 (0)