diff --git a/src/providers/Session.tsx b/src/providers/Session.tsx index 1be8891b1..29d4d644a 100644 --- a/src/providers/Session.tsx +++ b/src/providers/Session.tsx @@ -12,10 +12,10 @@ import { useAppSelector } from 'redux/hooks' import { GetSessionApiResponse, GetSettingsInfoApiResponse, - useApiDocsQuery, useGetAppsQuery, useGetSessionQuery, useGetSettingsInfoQuery, + useV1ApiDocsQuery, } from 'redux/otomiApi' import { useSocket, useSocketEvent } from 'socket.io-react-hook' import { @@ -95,7 +95,7 @@ export default function SessionProvider({ children }: Props): React.ReactElement isLoading: isLoadingApps, refetch: refetchAppsEnabled, } = useGetAppsQuery({ teamId: oboTeamId, picks: ['id', 'enabled'] }, { skip: !oboTeamId }) - const { data: apiDocs, isLoading: isLoadingApiDocs, error: errorApiDocs } = useApiDocsQuery(skipFetch && skipToken) + const { data: apiDocs, isLoading: isLoadingApiDocs, error: errorApiDocs } = useV1ApiDocsQuery(skipFetch && skipToken) const { socket, error: errorSocket } = useSocket({ url, path }) // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const { lastMessage: lastDbMessage } = useSocketEvent(socket, 'db') diff --git a/src/redux/otomiApi.ts b/src/redux/otomiApi.ts index 82547d7ff..a4dc92949 100644 --- a/src/redux/otomiApi.ts +++ b/src/redux/otomiApi.ts @@ -488,7 +488,7 @@ const injectedRtkApi = api.injectEndpoints({ getSession: build.query({ query: () => ({ url: `/v1/session` }), }), - apiDocs: build.query({ + v1ApiDocs: build.query({ query: () => ({ url: `/v1/apiDocs` }), }), getSettingsInfo: build.query({ @@ -1320,9 +1320,6 @@ export type DeleteServiceApiArg = { export type GetAllAplServicesApiResponse = /** status 200 Successfully obtained all services */ ({ kind: 'AplTeamService' spec: { - id?: string - teamId?: string - name?: string namespace?: string port?: number ksvc?: { @@ -1385,9 +1382,6 @@ export type GetAllAplServicesApiArg = void export type GetTeamAplServicesApiResponse = /** status 200 Successfully obtained services */ ({ kind: 'AplTeamService' spec: { - id?: string - teamId?: string - name?: string namespace?: string port?: number ksvc?: { @@ -1453,9 +1447,6 @@ export type GetTeamAplServicesApiArg = { export type CreateAplServiceApiResponse = /** status 200 Successfully stored service configuration */ { kind: 'AplTeamService' spec: { - id?: string - teamId?: string - name?: string namespace?: string port?: number ksvc?: { @@ -1521,9 +1512,6 @@ export type CreateAplServiceApiArg = { body: { kind: 'AplTeamService' spec: { - id?: string - teamId?: string - name?: string namespace?: string port?: number ksvc?: { @@ -1572,9 +1560,6 @@ export type CreateAplServiceApiArg = { export type GetAplServiceApiResponse = /** status 200 Successfully obtained service configuration */ { kind: 'AplTeamService' spec: { - id?: string - teamId?: string - name?: string namespace?: string port?: number ksvc?: { @@ -1642,9 +1627,6 @@ export type GetAplServiceApiArg = { export type EditAplServiceApiResponse = /** status 200 Successfully edited service */ { kind: 'AplTeamService' spec: { - id?: string - teamId?: string - name?: string namespace?: string port?: number ksvc?: { @@ -1712,9 +1694,6 @@ export type EditAplServiceApiArg = { body: { kind: 'AplTeamService' spec: { - id?: string - teamId?: string - name?: string namespace?: string port?: number ksvc?: { @@ -2562,9 +2541,6 @@ export type DeleteNetpolApiArg = { export type GetAllAplNetpolsApiResponse = /** status 200 Successfully obtained all network policy configuration */ ({ kind: 'AplTeamNetworkControl' spec: { - id?: string - teamId?: string - name?: string ruleType?: { type?: 'ingress' | 'egress' ingress?: { @@ -2609,9 +2585,6 @@ export type GetAllAplNetpolsApiArg = void export type GetTeamAplNetpolsApiResponse = /** status 200 Successfully obtained team network policy configuration */ ({ kind: 'AplTeamNetworkControl' spec: { - id?: string - teamId?: string - name?: string ruleType?: { type?: 'ingress' | 'egress' ingress?: { @@ -2659,9 +2632,6 @@ export type GetTeamAplNetpolsApiArg = { export type CreateAplNetpolApiResponse = /** status 200 Successfully stored network policy configuration */ { kind: 'AplTeamNetworkControl' spec: { - id?: string - teamId?: string - name?: string ruleType?: { type?: 'ingress' | 'egress' ingress?: { @@ -2709,9 +2679,6 @@ export type CreateAplNetpolApiArg = { body: { kind: 'AplTeamNetworkControl' spec: { - id?: string - teamId?: string - name?: string ruleType?: { type?: 'ingress' | 'egress' ingress?: { @@ -2742,9 +2709,6 @@ export type CreateAplNetpolApiArg = { export type GetAplNetpolApiResponse = /** status 200 Successfully obtained network policy configuration */ { kind: 'AplTeamNetworkControl' spec: { - id?: string - teamId?: string - name?: string ruleType?: { type?: 'ingress' | 'egress' ingress?: { @@ -2794,9 +2758,6 @@ export type GetAplNetpolApiArg = { export type EditAplNetpolApiResponse = /** status 200 Successfully edited a team network policy */ { kind: 'AplTeamNetworkControl' spec: { - id?: string - teamId?: string - name?: string ruleType?: { type?: 'ingress' | 'egress' ingress?: { @@ -2846,9 +2807,6 @@ export type EditAplNetpolApiArg = { body: { kind: 'AplTeamNetworkControl' spec: { - id?: string - teamId?: string - name?: string ruleType?: { type?: 'ingress' | 'egress' ingress?: { @@ -3000,9 +2958,6 @@ export type EditBackupApiArg = { export type GetAllAplBackupsApiResponse = /** status 200 Successfully obtained all backups configuration */ ({ kind: 'AplTeamBackup' spec: { - id?: string - teamId?: string - name?: string schedule: string snapshotVolumes?: boolean labelSelector?: { @@ -3034,9 +2989,6 @@ export type GetAllAplBackupsApiArg = void export type GetTeamAplBackupsApiResponse = /** status 200 Successfully obtained team backups configuration */ ({ kind: 'AplTeamBackup' spec: { - id?: string - teamId?: string - name?: string schedule: string snapshotVolumes?: boolean labelSelector?: { @@ -3071,9 +3023,6 @@ export type GetTeamAplBackupsApiArg = { export type CreateAplBackupApiResponse = /** status 200 Successfully stored backup configuration */ { kind: 'AplTeamBackup' spec: { - id?: string - teamId?: string - name?: string schedule: string snapshotVolumes?: boolean labelSelector?: { @@ -3108,9 +3057,6 @@ export type CreateAplBackupApiArg = { body: { kind: 'AplTeamBackup' spec: { - id?: string - teamId?: string - name?: string schedule: string snapshotVolumes?: boolean labelSelector?: { @@ -3135,9 +3081,6 @@ export type DeleteAplBackupApiArg = { export type GetAplBackupApiResponse = /** status 200 Successfully obtained backup configuration */ { kind: 'AplTeamBackup' spec: { - id?: string - teamId?: string - name?: string schedule: string snapshotVolumes?: boolean labelSelector?: { @@ -3174,9 +3117,6 @@ export type GetAplBackupApiArg = { export type EditAplBackupApiResponse = /** status 200 Successfully edited a team backup */ { kind: 'AplTeamBackup' spec: { - id?: string - teamId?: string - name?: string schedule: string snapshotVolumes?: boolean labelSelector?: { @@ -3213,9 +3153,6 @@ export type EditAplBackupApiArg = { body: { kind: 'AplTeamBackup' spec: { - id?: string - teamId?: string - name?: string schedule: string snapshotVolumes?: boolean labelSelector?: { @@ -3520,9 +3457,6 @@ export type EditBuildApiArg = { export type GetAllAplBuildsApiResponse = /** status 200 Successfully obtained all builds configuration */ ({ kind: 'AplTeamBuild' spec: { - id?: string - teamId?: string - name?: string imageName?: string tag?: string mode?: @@ -3578,9 +3512,6 @@ export type GetAllAplBuildsApiArg = void export type GetTeamAplBuildsApiResponse = /** status 200 Successfully obtained team builds configuration */ ({ kind: 'AplTeamBuild' spec: { - id?: string - teamId?: string - name?: string imageName?: string tag?: string mode?: @@ -3639,9 +3570,6 @@ export type GetTeamAplBuildsApiArg = { export type CreateAplBuildApiResponse = /** status 200 Successfully stored build configuration */ { kind: 'AplTeamBuild' spec: { - id?: string - teamId?: string - name?: string imageName?: string tag?: string mode?: @@ -3700,9 +3628,6 @@ export type CreateAplBuildApiArg = { body: { kind: 'AplTeamBuild' spec: { - id?: string - teamId?: string - name?: string imageName?: string tag?: string mode?: @@ -3751,9 +3676,6 @@ export type DeleteAplBuildApiArg = { export type GetAplBuildApiResponse = /** status 200 Successfully obtained build configuration */ { kind: 'AplTeamBuild' spec: { - id?: string - teamId?: string - name?: string imageName?: string tag?: string mode?: @@ -3814,9 +3736,6 @@ export type GetAplBuildApiArg = { export type EditAplBuildApiResponse = /** status 200 Successfully edited a team build */ { kind: 'AplTeamBuild' spec: { - id?: string - teamId?: string - name?: string imageName?: string tag?: string mode?: @@ -3877,9 +3796,6 @@ export type EditAplBuildApiArg = { body: { kind: 'AplTeamBuild' spec: { - id?: string - teamId?: string - name?: string imageName?: string tag?: string mode?: @@ -5293,11 +5209,7 @@ export type EditProjectApiArg = { } export type GetAllAplProjectsApiResponse = /** status 200 Successfully obtained all projects configuration */ ({ kind: 'AplTeamProject' - spec: { - id?: string - teamId?: string - name?: string - } + spec: object } & { metadata: { name: string @@ -5450,11 +5362,7 @@ export type GetAllAplProjectsApiResponse = /** status 200 Successfully obtained export type GetAllAplProjectsApiArg = void export type GetTeamAplProjectsApiResponse = /** status 200 Successfully obtained team projects configuration */ ({ kind: 'AplTeamProject' - spec: { - id?: string - teamId?: string - name?: string - } + spec: object } & { metadata: { name: string @@ -5610,11 +5518,7 @@ export type GetTeamAplProjectsApiArg = { } export type CreateAplProjectApiResponse = /** status 200 Successfully stored project configuration */ { kind: 'AplTeamProject' - spec: { - id?: string - teamId?: string - name?: string - } + spec: object } & { metadata: { name: string @@ -5770,11 +5674,7 @@ export type CreateAplProjectApiArg = { /** Project object */ body: { kind: 'AplTeamProject' - spec: { - id?: string - teamId?: string - name?: string - } + spec: object } & { metadata: { name: string @@ -5920,11 +5820,7 @@ export type DeleteAplProjectApiArg = { } export type GetAplProjectApiResponse = /** status 200 Successfully obtained project configuration */ { kind: 'AplTeamProject' - spec: { - id?: string - teamId?: string - name?: string - } + spec: object } & { metadata: { name: string @@ -6176,9 +6072,6 @@ export type DeleteCodeRepoApiArg = { export type GetAllAplCodeReposApiResponse = /** status 200 Successfully obtained all code repositories */ ({ kind: 'AplTeamCodeRepo' spec: { - id?: string - teamId?: string - name?: string gitService: 'gitea' | 'github' | 'gitlab' repositoryUrl: string private?: boolean @@ -6207,9 +6100,6 @@ export type GetAllAplCodeReposApiArg = void export type GetTeamAplCodeReposApiResponse = /** status 200 Successfully obtained code repositories */ ({ kind: 'AplTeamCodeRepo' spec: { - id?: string - teamId?: string - name?: string gitService: 'gitea' | 'github' | 'gitlab' repositoryUrl: string private?: boolean @@ -6241,9 +6131,6 @@ export type GetTeamAplCodeReposApiArg = { export type CreateAplCodeRepoApiResponse = /** status 200 Successfully stored code repo configuration */ { kind: 'AplTeamCodeRepo' spec: { - id?: string - teamId?: string - name?: string gitService: 'gitea' | 'github' | 'gitlab' repositoryUrl: string private?: boolean @@ -6275,9 +6162,6 @@ export type CreateAplCodeRepoApiArg = { body: { kind: 'AplTeamCodeRepo' spec: { - id?: string - teamId?: string - name?: string gitService: 'gitea' | 'github' | 'gitlab' repositoryUrl: string private?: boolean @@ -6292,9 +6176,6 @@ export type CreateAplCodeRepoApiArg = { export type GetAplCodeRepoApiResponse = /** status 200 Successfully obtained code repo configuration */ { kind: 'AplTeamCodeRepo' spec: { - id?: string - teamId?: string - name?: string gitService: 'gitea' | 'github' | 'gitlab' repositoryUrl: string private?: boolean @@ -6328,9 +6209,6 @@ export type GetAplCodeRepoApiArg = { export type EditAplCodeRepoApiResponse = /** status 200 Successfully edited a team code repo */ { kind: 'AplTeamCodeRepo' spec: { - id?: string - teamId?: string - name?: string gitService: 'gitea' | 'github' | 'gitlab' repositoryUrl: string private?: boolean @@ -6364,9 +6242,6 @@ export type EditAplCodeRepoApiArg = { body: { kind: 'AplTeamCodeRepo' spec: { - id?: string - teamId?: string - name?: string gitService: 'gitea' | 'github' | 'gitlab' repositoryUrl: string private?: boolean @@ -6747,9 +6622,6 @@ export type EditWorkloadValuesApiArg = { export type GetAllAplWorkloadsApiResponse = /** status 200 Successfully obtained all workloads configuration */ ({ kind: 'AplTeamWorkload' spec: { - id?: string - teamId?: string - name?: string icon?: string url: string chartProvider?: 'helm' | 'git' @@ -6810,9 +6682,6 @@ export type GetAllAplWorkloadsApiArg = void export type GetTeamAplWorkloadsApiResponse = /** status 200 Successfully obtained team workloads configuration */ ({ kind: 'AplTeamWorkload' spec: { - id?: string - teamId?: string - name?: string icon?: string url: string chartProvider?: 'helm' | 'git' @@ -6876,9 +6745,6 @@ export type GetTeamAplWorkloadsApiArg = { export type CreateAplWorkloadApiResponse = /** status 200 Successfully stored workload configuration */ { kind: 'AplTeamWorkload' spec: { - id?: string - teamId?: string - name?: string icon?: string url: string chartProvider?: 'helm' | 'git' @@ -6942,9 +6808,6 @@ export type CreateAplWorkloadApiArg = { body: { kind: 'AplTeamWorkload' spec: { - id?: string - teamId?: string - name?: string icon?: string url: string chartProvider?: 'helm' | 'git' @@ -6998,9 +6861,6 @@ export type DeleteAplWorkloadApiArg = { export type GetAplWorkloadApiResponse = /** status 200 Successfully obtained workload configuration */ { kind: 'AplTeamWorkload' spec: { - id?: string - teamId?: string - name?: string icon?: string url: string chartProvider?: 'helm' | 'git' @@ -7066,9 +6926,6 @@ export type GetAplWorkloadApiArg = { export type EditAplWorkloadApiResponse = /** status 200 Successfully edited a team workload */ { kind: 'AplTeamWorkload' spec: { - id?: string - teamId?: string - name?: string icon?: string url: string chartProvider?: 'helm' | 'git' @@ -7134,9 +6991,6 @@ export type EditAplWorkloadApiArg = { body: { kind: 'AplTeamWorkload' spec: { - id?: string - teamId?: string - name?: string icon?: string url: string chartProvider?: 'helm' | 'git' @@ -7233,8 +7087,8 @@ export type GetSessionApiResponse = /** status 200 Get the session for the logge valuesSchema?: object } export type GetSessionApiArg = void -export type ApiDocsApiResponse = /** status 200 The requested apiDoc. */ object -export type ApiDocsApiArg = void +export type V1ApiDocsApiResponse = /** status 200 The requested apiDoc. */ object +export type V1ApiDocsApiArg = void export type GetSettingsInfoApiResponse = /** status 200 The request is successful. */ { cluster?: { name?: string @@ -7328,11 +7182,12 @@ export type GetSettingsApiResponse = /** status 200 The request is successful. * } } cluster?: { - name?: string + name: string domainSuffix?: string apiServer?: string k8sContext?: string - provider?: 'linode' | 'custom' + owner?: string + provider: 'linode' | 'custom' } platformBackups?: { gitea?: { @@ -7610,11 +7465,12 @@ export type EditSettingsApiArg = { } } cluster?: { - name?: string + name: string domainSuffix?: string apiServer?: string k8sContext?: string - provider?: 'linode' | 'custom' + owner?: string + provider: 'linode' | 'custom' } platformBackups?: { gitea?: { @@ -8017,7 +7873,7 @@ export const { useDownloadKubecfgQuery, useDownloadDockerConfigQuery, useGetSessionQuery, - useApiDocsQuery, + useV1ApiDocsQuery, useGetSettingsInfoQuery, useGetRepoBranchesQuery, useGetTestRepoConnectQuery,