From 16f1aba47bf4034adfabe3e31ff636befb8d80ef Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Sat, 23 Dec 2023 14:51:19 +0530 Subject: [PATCH 1/4] :sparkles: Added resource-watcher utility with websocket. --- lib/client/helpers/socket-context.jsx | 102 -------------- lib/client/helpers/socket-context.tsx | 194 ++++++++++++++++++++++++++ lib/configs/base-url.cjs | 2 + package.json | 1 + pnpm-lock.yaml | 70 +++++++++- src/apps/console/root.tsx | 9 +- src/apps/console/routes/test.tsx | 38 +++++ 7 files changed, 306 insertions(+), 110 deletions(-) delete mode 100644 lib/client/helpers/socket-context.jsx create mode 100644 lib/client/helpers/socket-context.tsx create mode 100644 src/apps/console/routes/test.tsx diff --git a/lib/client/helpers/socket-context.jsx b/lib/client/helpers/socket-context.jsx deleted file mode 100644 index 6a3851bf3..000000000 --- a/lib/client/helpers/socket-context.jsx +++ /dev/null @@ -1,102 +0,0 @@ -import { createContext, useContext, useEffect, useMemo } from 'react'; -import { io } from 'socket.io-client'; -import { v4 as uuid } from 'uuid'; -import { socketUrl } from '~/root/lib/base-url'; -import logger from './log'; -import { useReload } from './reloader'; - -const createSocketContext = () => { - const callbacks = {}; - const socket = io(socketUrl); - - socket.on('connect', () => { - logger.log('socket connected'); - }); - - socket.on('disconnect', () => { - logger.log('socket disconnected'); - }); - - socket.on('error', (error) => { - logger.error(error); - }); - - return { - subscribe: (topic, callback) => { - if (!callbacks[topic]) { - callbacks[topic] = {}; - // socket.emit('subscribe', topic); - socket.on(`pubsub_${topic}`, (msg = '{}') => { - // logger.log('message', topic); - const { message } = JSON.parse(msg); - logger.log('socket: ', topic); - if (callbacks[topic]) { - Object.values(callbacks[topic]).forEach((cb) => - cb({ topic, message }) - ); - } - }); - } - - const id = uuid(); - callbacks[topic][id] = callback; - return id; - }, - - unsubscribe: (topic, id) => { - delete callbacks[topic][id]; - if (Object.keys(callbacks[topic]).length === 0) { - // socket.emit('unsubscribe', topic); - socket.off(`pubsub_${topic}`).removeAllListeners(); - } - }, - }; -}; - -const SocketContext = createContext(null); - -const SocketProvider = ({ children }) => { - const socket = useMemo(() => { - // if (typeof window !== 'undefined') { - // return createSocketContext(); - // } - // - // return { - // subscribe: () => {}, - // unsubscribe: () => {}, - // }; - }, [typeof window]); - - return ( - {children} - ); -}; - -export const useSubscribe = (topics, callback, dependencies = []) => { - const t = typeof topics === 'string' ? [topics] : topics; - - const { subscribe, unsubscribe } = useContext(SocketContext); - - useEffect(() => { - const subscriptions = t.map((topic) => ({ - topic, - id: subscribe(topic, callback), - })); - return () => { - subscriptions.forEach(({ topic, id }) => unsubscribe(topic, id)); - }; - }, [...dependencies, ...t]); -}; - -export const useWatch = (...topics) => { - const reloadPage = useReload(); - useSubscribe( - topics, - () => { - reloadPage(); - }, - topics - ); -}; - -export default SocketProvider; diff --git a/lib/client/helpers/socket-context.tsx b/lib/client/helpers/socket-context.tsx new file mode 100644 index 000000000..aecf938b8 --- /dev/null +++ b/lib/client/helpers/socket-context.tsx @@ -0,0 +1,194 @@ +import { createContext, useContext, useEffect, useMemo } from 'react'; +import * as sock from 'websocket'; +import { v4 as uuid } from 'uuid'; +import { socketUrl } from '~/lib/configs/base-url.cjs'; +import { ChildrenProps } from '~/components/types'; +import logger from './log'; +import { NonNullableString } from '../../types/common'; +import { useReload } from './reloader'; + +type Ievent = 'subscribe' | 'unsubscribe' | NonNullableString; + +type IMessage = { + data: string; + event: Ievent; +}; + +const message = ({ event, data }: IMessage): string => { + return JSON.stringify({ event, data }); +}; + +const socketContextDefaultValue: { + subscribe: ( + topic: string, + callback: (arg: { topic: string; message: string }) => void + ) => string; + unsubscribe: (topic: string, id: string) => void; +} = { + subscribe: (): string => '', + unsubscribe: (): void => {}, +}; + +const createSocketContext = () => { + if (typeof window === 'undefined') { + return socketContextDefaultValue; + } + + const callbacks: { + [key: string]: { + [key: string]: (arg: { topic: string; message: string }) => void; + }; + } = {}; + + const wsclient = new Promise((res, rej) => { + try { + // eslint-disable-next-line new-cap + const w = new sock.w3cwebsocket(socketUrl, '', '', {}); + + w.onmessage = (msg) => { + try { + const m: { + topic: string; + message: string; + type: 'update' | 'error' | 'info'; + } = JSON.parse(msg.data as string); + + if (m.type === 'error') { + console.error(m.message); + return; + } + + if (m.type === 'info') { + console.log(m.message); + return; + } + + Object.values(callbacks[m.topic]).forEach((cb) => { + cb(m); + }); + } catch (err) { + console.error(err); + } + }; + + w.onopen = () => { + res(w); + }; + + w.onerror = (e) => { + rej(e); + }; + + w.onclose = () => { + // wsclient.send(newMessage({ event: 'unsubscribe', data: 'test' })); + logger.log('socket disconnected'); + }; + } catch (e) { + rej(e); + } + }); + + return { + subscribe: ( + topic: string, + callback: (arg: { topic: string; message: string }) => void + ): string => { + (async () => { + if (!callbacks[topic]) { + callbacks[topic] = {}; + + try { + const w = await wsclient; + + w.send( + message({ + event: 'subscribe', + data: topic, + }) + ); + + logger.log('subscribed to', topic); + } catch (err) { + logger.warn(err); + } + } + })(); + + const id = uuid(); + callbacks[topic][id] = callback; + return id; + }, + + unsubscribe: (topic: string, id: string) => { + (async () => { + delete callbacks[topic][id]; + + try { + const w = await wsclient; + + if (Object.keys(callbacks[topic]).length === 0) { + w.send( + message({ + event: 'unsubscribe', + data: topic, + }) + ); + } + } catch (err) { + logger.warn(err); + } + })(); + }, + }; +}; + +const SocketContext = createContext(socketContextDefaultValue); + +const SocketProvider = ({ children }: ChildrenProps) => { + const socket = useMemo(() => { + if (typeof window !== 'undefined') { + return createSocketContext(); + } + + return socketContextDefaultValue; + }, [typeof window]); + + return ( + {children} + ); +}; + +export const useSubscribe = ( + topics: string[], + callback: (arg: { topic: string; message: string }) => void, + dependencies: any[] = [] +) => { + const t = typeof topics === 'string' ? [topics] : topics; + + const { subscribe, unsubscribe } = useContext(SocketContext); + + useEffect(() => { + const subscriptions = t.map((topic) => ({ + topic, + id: subscribe(topic, callback), + })); + + return () => { + subscriptions.forEach(({ topic, id }) => unsubscribe(topic, id)); + }; + }, [...dependencies, ...t]); +}; + +export const useWatch = (...topics: string[]) => { + const reloadPage = useReload(); + useSubscribe( + topics, + () => { + console.log('hi'); + reloadPage(); + }, + topics + ); +}; + +export default SocketProvider; diff --git a/lib/configs/base-url.cjs b/lib/configs/base-url.cjs index c80fda6f8..296f99a5a 100644 --- a/lib/configs/base-url.cjs +++ b/lib/configs/base-url.cjs @@ -42,6 +42,7 @@ const baseUrls = () => { cookieDomain, baseUrl: bUrl, githubAppName: 'kloudlite-dev', + socketUrl: `wss://socket${postFix}.${bUrl}/ws`, }; }; @@ -52,6 +53,7 @@ const defaultConfig = { cookieDomain: baseUrls().cookieDomain, baseUrl: baseUrls().baseUrl, githubAppName: baseUrls().githubAppName, + socketUrl: baseUrls().socketUrl, }; module.exports = defaultConfig; diff --git a/package.json b/package.json index af083b7b2..d7b773bc8 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ "react-viewport-list": "^7.1.1", "remix": "^1.19.2", "search-in-json": "^1.0.5", + "socket.io-client": "^4.7.2", "swr": "^2.2.4", "use-immer": "^0.9.0", "uuid": "^9.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a82834b3d..dfabbb9a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -209,6 +209,9 @@ dependencies: search-in-json: specifier: ^1.0.5 version: 1.0.67 + socket.io-client: + specifier: ^4.7.2 + version: 4.7.2 swr: specifier: ^2.2.4 version: 2.2.4(react@18.2.0) @@ -3874,6 +3877,10 @@ packages: engines: {node: '>=10'} dev: true + /@socket.io/component-emitter@3.1.0: + resolution: {integrity: sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==} + dev: false + /@swc/helpers@0.5.3: resolution: {integrity: sha512-FaruWX6KdudYloq1AHD/4nU+UsMTdNE8CKyrseXWEcgjDAbvkwJg2QGPAnfIJLIWsjZOSPLOAykK6fuYp4vp4A==} dependencies: @@ -5192,7 +5199,6 @@ packages: optional: true dependencies: ms: 2.1.2 - dev: true /decode-named-character-reference@1.0.2: resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} @@ -5382,6 +5388,25 @@ packages: once: 1.4.0 dev: true + /engine.io-client@6.5.3: + resolution: {integrity: sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + engine.io-parser: 5.2.1 + ws: 8.11.0 + xmlhttprequest-ssl: 2.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + + /engine.io-parser@5.2.1: + resolution: {integrity: sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ==} + engines: {node: '>=10.0.0'} + dev: false + /enhanced-resolve@5.15.0: resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==} engines: {node: '>=10.13.0'} @@ -7946,7 +7971,6 @@ packages: /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -9471,6 +9495,30 @@ packages: engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} dev: true + /socket.io-client@4.7.2: + resolution: {integrity: sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==} + engines: {node: '>=10.0.0'} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + engine.io-client: 6.5.3 + socket.io-parser: 4.2.4 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + + /socket.io-parser@4.2.4: + resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==} + engines: {node: '>=10.0.0'} + dependencies: + '@socket.io/component-emitter': 3.1.0 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: false + /socks-proxy-agent@8.0.2: resolution: {integrity: sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==} engines: {node: '>= 14'} @@ -10499,6 +10547,19 @@ packages: optional: true dev: true + /ws@8.11.0: + resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: false + /xdm@2.1.0: resolution: {integrity: sha512-3LxxbxKcRogYY7cQSMy1tUuU1zKNK9YPqMT7/S0r7Cz2QpyF8O9yFySGD7caOZt+LWUOQioOIX+6ZzCoBCpcAA==} dependencies: @@ -10529,6 +10590,11 @@ packages: - supports-color dev: true + /xmlhttprequest-ssl@2.0.0: + resolution: {integrity: sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==} + engines: {node: '>=0.4.0'} + dev: false + /xtend@4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} diff --git a/src/apps/console/root.tsx b/src/apps/console/root.tsx index ff343fb7c..93548e154 100644 --- a/src/apps/console/root.tsx +++ b/src/apps/console/root.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/jsx-no-useless-fragment */ import Root, { links as baseLinks } from '~/lib/app-setup/root'; import { ChildrenProps } from '~/components/types'; import authStylesUrl from './styles/index.css'; @@ -17,12 +18,8 @@ export const links = () => { export { ErrorBoundary } from '~/lib/app-setup/root'; const Layout = ({ children }: ChildrenProps) => { - return ( - // - // eslint-disable-next-line react/jsx-no-useless-fragment - <>{children} - // - ); + // return {children}; + return <>{children}; }; const _Root = ({ ...props }) => { diff --git a/src/apps/console/routes/test.tsx b/src/apps/console/routes/test.tsx new file mode 100644 index 000000000..6c408999a --- /dev/null +++ b/src/apps/console/routes/test.tsx @@ -0,0 +1,38 @@ +import { useLoaderData } from '@remix-run/react'; +import SocketProvider, { + useSubscribe, + // useSubscribe, + useWatch, +} from '~/root/lib/client/helpers/socket-context'; + +export const loader = () => { + return { + data: Math.random(), + }; +}; + +const App = () => { + useSubscribe( + ['account:newteam.cluster'], + () => { + console.log('hi'); + }, + [] + ); + + // useWatch('account:newteam.cluster'); + // res-updates.account.acc-ruwibp-pf5jvcsew2rnl54kriv59.cluster.* + // res-updates.account.accid.project.projid.env.envid.app.* + + const { data } = useLoaderData(); + + return
{data}
; +}; + +export default () => { + return ( + + + + ); +}; From c5823a47cc83b6dc6ae4a423bdefe1570c5169da Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Sun, 24 Dec 2023 02:06:35 +0530 Subject: [PATCH 2/4] :sparkles: Added cli queries --- gql-queries-generator/doc/queries.graphql | 104 ++- lib/server/helpers/minimal-auth.ts | 3 + lib/server/helpers/rpc/index.ts | 8 +- src/apps/auth/routes/_a.cli-logged-in.tsx | 26 + src/apps/auth/routes/_auth.cli-login.tsx | 147 ++++ src/apps/auth/routes/_index.tsx | 6 +- src/apps/auth/server/gql/cli-queries.ts | 123 ++++ src/apps/auth/server/gql/saved-queries.ts | 22 + .../server/gql/queries/access-queries.ts | 2 +- .../gql/queries/managed-resource-queries.ts | 15 +- .../gql/queries/managed-service-queries.ts | 30 +- .../console/server/gql/queries/vpn-queries.ts | 2 - src/generated/gql/sdl.graphql | 671 ++++++++---------- src/generated/gql/server.ts | 301 ++++---- 14 files changed, 857 insertions(+), 603 deletions(-) create mode 100644 src/apps/auth/routes/_a.cli-logged-in.tsx create mode 100644 src/apps/auth/routes/_auth.cli-login.tsx create mode 100644 src/apps/auth/server/gql/cli-queries.ts diff --git a/gql-queries-generator/doc/queries.graphql b/gql-queries-generator/doc/queries.graphql index 0c3d585e7..f1810faa7 100644 --- a/gql-queries-generator/doc/queries.graphql +++ b/gql-queries-generator/doc/queries.graphql @@ -1446,7 +1446,6 @@ query consoleListVpnDevices($clusterName: String, $search: SearchVPNDevices, $pq spec { accountName clusterName - dns ports { port targetPort @@ -1516,7 +1515,6 @@ query consoleGetVpnDevice($clusterName: String!, $name: String!) { spec { accountName clusterName - dns ports { port targetPort @@ -1617,7 +1615,7 @@ mutation consoleRejectInvitation($accountName: String!, $inviteToken: String!) { accounts_rejectInvitation(accountName: $accountName, inviteToken: $inviteToken) } -mutation consoleUpdateAccountMembership($accountName: String!, $memberId: ID!, $role: Kloudlite__io___apps___iam___types__Role!) { +mutation consoleUpdateAccountMembership($accountName: String!, $memberId: ID!, $role: Github__com___kloudlite___api___apps___iam___types__Role!) { accounts_updateAccountMembership( accountName: $accountName memberId: $memberId @@ -1763,21 +1761,10 @@ query consoleGetManagedService($project: ProjectId!, $scope: WorkspaceOrEnvId!, } recordVersion spec { - inputs { - RawMessage - } - msvcKind { + serviceTemplate { apiVersion kind - } - nodeSelector - region - tolerations { - effect - key - operator - tolerationSeconds - value + spec } } status { @@ -1841,21 +1828,10 @@ query consoleListManagedServices($project: ProjectId!, $scope: WorkspaceOrEnvId! } recordVersion spec { - inputs { - RawMessage - } - msvcKind { + serviceTemplate { apiVersion kind - } - nodeSelector - region - tolerations { - effect - key - operator - tolerationSeconds - value + spec } } status { @@ -1931,16 +1907,15 @@ query consoleGetManagedResource($project: ProjectId!, $scope: WorkspaceOrEnvId!, } recordVersion spec { - inputs { - RawMessage - } - mresKind { - kind - } - msvcRef { + resourceTemplate { apiVersion kind - name + msvcRef { + name + kind + apiVersion + } + spec } } status { @@ -2703,6 +2678,61 @@ query consoleGetBuildRun($repoName: String!, $buildRunName: String!) { } } +query authCli_getKubeConfig($name: String!) { + infra_getCluster(name: $name) { + adminKubeconfig { + encoding + value + } + } +} + +query authCli_listClusters($pagination: CursorPaginationIn) { + infra_listClusters(pagination: $pagination) { + edges { + node { + displayName + metadata { + name + } + } + } + } +} + +query authCli_listAccounts { + accounts_listAccounts { + id + metadata { + name + } + displayName + } +} + +query authCli_getCurrentUser { + auth_me { + id + email + name + } +} + +mutation authCli_createRemoteLogin($secret: String) { + auth_createRemoteLogin(secret: $secret) +} + +query authCli_getRemoteLogin($loginId: String!, $secret: String!) { + auth_getRemoteLogin(loginId: $loginId, secret: $secret) { + authHeader + status + } +} + +mutation authSetRemoteAuthHeader($loginId: String!, $authHeader: String) { + auth_setRemoteAuthHeader(loginId: $loginId, authHeader: $authHeader) +} + query authCheckOauthEnabled { auth_listOAuthProviders { enabled diff --git a/lib/server/helpers/minimal-auth.ts b/lib/server/helpers/minimal-auth.ts index 5bcd8aaeb..43b049d49 100644 --- a/lib/server/helpers/minimal-auth.ts +++ b/lib/server/helpers/minimal-auth.ts @@ -24,6 +24,8 @@ export const minimalAuth = async (ctx: IExtRemixCtx) => { headers: ctx.request?.headers, }).whoAmI(); + console.log('whoAmI', whoAmI); + if ( whoAmI.errors && whoAmI.errors[0].message === 'input: auth_me user not logged in' @@ -32,6 +34,7 @@ export const minimalAuth = async (ctx: IExtRemixCtx) => { } if (!(whoAmI.data && whoAmI.data)) { + console.log('whoAmI', whoAmI, 'red'); if (new URL(ctx.request.url).host === new URL(consoleBaseUrl).host) { const { pathname } = new URL(ctx.request.url); const history = cookie.get('url_history'); diff --git a/lib/server/helpers/rpc/index.ts b/lib/server/helpers/rpc/index.ts index e27f1148a..bc2f60933 100644 --- a/lib/server/helpers/rpc/index.ts +++ b/lib/server/helpers/rpc/index.ts @@ -30,13 +30,19 @@ export const withRPC = ( try { if (!req.body.method) throw new Error('Handler Method not found'); - const method = req.body.method.split('.').reduce((acc: any, item) => { + const dt = req.body.method.split('.'); + + const method = dt.reduce((acc: any, item) => { return acc[item]; }, handler); + if (!method) + throw new Error(`Handler Method not found ${req.body.method}`); + const response = await method(...(req.body.args || [])); res.json(response); } catch (err) { + console.log('here'); next(err as Error); } }; diff --git a/src/apps/auth/routes/_a.cli-logged-in.tsx b/src/apps/auth/routes/_a.cli-logged-in.tsx new file mode 100644 index 000000000..80ae60e41 --- /dev/null +++ b/src/apps/auth/routes/_a.cli-logged-in.tsx @@ -0,0 +1,26 @@ +import { getCookie } from '~/root/lib/app-setup/cookies'; +import withContext from '~/root/lib/app-setup/with-contxt'; +import { IExtRemixCtx } from '~/root/lib/types/common'; + +const cliLoggedIn = () => { + return ( +
+
+

+ Logged in Successfully +

+
+ Visit your terminal. +
+
+
+ ); +}; + +export const loader = (ctx: IExtRemixCtx) => { + const cookie = getCookie(ctx); + cookie.remove('cliLogin'); + return withContext(ctx, {}); +}; + +export default cliLoggedIn; diff --git a/src/apps/auth/routes/_auth.cli-login.tsx b/src/apps/auth/routes/_auth.cli-login.tsx new file mode 100644 index 000000000..c81df7f8a --- /dev/null +++ b/src/apps/auth/routes/_auth.cli-login.tsx @@ -0,0 +1,147 @@ +import { Button, IconButton } from '~/components/atoms/button'; +import { IExtRemixCtx } from '~/root/lib/types/common'; +import getQueries from '~/root/lib/server/helpers/get-queries'; +import { getCookie } from '~/root/lib/app-setup/cookies'; +import withContext from '~/root/lib/app-setup/with-contxt'; +import { useLoaderData, useLocation, useNavigate } from '@remix-run/react'; +import md5 from '~/root/lib/client/helpers/md5'; +import { Avatar } from '~/components/atoms/avatar'; +import { cn } from '~/components/utils'; +import { Power } from '@jengaicons/react'; +import { GQLServerHandler } from '../server/gql/saved-queries'; + +function CliLogin() { + const { loginId, user } = useLoaderData(); + + const location = useLocation(); + const navigate = useNavigate(); + + const onAuthenticate = () => { + if (!loginId) return; + const cookie = getCookie(); + cookie.set('cliLogin', loginId); + navigate('/'); + }; + + if (!loginId) { + return ( +
+
+

+ Login id not provided +

+
+ Please wait try again. +
+
+
+ ); + } + + const { avatar, email, name } = user || {}; + + const profile = () => { + return ( +
+
+ {/* eslint-disable-next-line no-nested-ternary */} + {avatar ? ( + profile + ) : email ? ( + {email} + ) : ( + + )} +
+
+ + {name || email} + + + {/* {role.replace('-', ' ')} */} + {email} + +
+
+ ); + }; + + const logOut = async () => { + navigate( + `${ + location.pathname + + location.search + + (location.search.trim() ? '&' : '?') + }logout=yes`, + { replace: true } + ); + }; + + return ( +
+
+

+ Login to Kloudlite CLI +

+
+ {user ? ( +
+
{profile()}
+ +
+ ) : ( +
+
+
+ ); +} + +export const loader = async (ctx: IExtRemixCtx) => { + const { loginId, logout } = await getQueries(ctx); + if (logout) { + const cookie = getCookie(ctx); + + Object.keys(cookie.getAll()).forEach((key) => { + cookie.remove(key); + }); + + return withContext(ctx, { loginId }); + } + + const { data } = await GQLServerHandler(ctx.request).whoAmI(); + + return { + loginId: loginId || null, + user: data || null, + }; +}; + +export default CliLogin; diff --git a/src/apps/auth/routes/_index.tsx b/src/apps/auth/routes/_index.tsx index c38d31638..8bf612af5 100644 --- a/src/apps/auth/routes/_index.tsx +++ b/src/apps/auth/routes/_index.tsx @@ -6,20 +6,22 @@ import { getCookie } from '~/root/lib/app-setup/cookies'; import { IExtRemixCtx } from '~/root/lib/types/common'; import { GQLServerHandler } from '../server/gql/saved-queries'; -// @ts-ignore const restActions = async (ctx: IExtRemixCtx) => { const cookie = getCookie(ctx); if (cookie.get('cliLogin')) { try { + console.log('here', 'lskdfjsldfj'); + const { data, errors } = await GQLServerHandler( ctx.request - // @ts-ignore ).setRemoteAuthHeader({ loginId: cookie.get('cliLogin'), authHeader: ctx?.request?.headers?.get('cookie'), }); + logger.log(data, 'loggedin'); if (errors) { + console.log('here', errors); throw errors[0]; } diff --git a/src/apps/auth/server/gql/cli-queries.ts b/src/apps/auth/server/gql/cli-queries.ts new file mode 100644 index 000000000..f449dea96 --- /dev/null +++ b/src/apps/auth/server/gql/cli-queries.ts @@ -0,0 +1,123 @@ +/* eslint-disable camelcase */ +import gql from 'graphql-tag'; +import { IExecutor } from '~/root/lib/server/helpers/execute-query-with-context'; +import { + AuthCli_CreateRemoteLoginMutationVariables, + AuthCli_CreateRemoteLoginMutation, + AuthCli_GetRemoteLoginQueryVariables, + AuthCli_GetRemoteLoginQuery, + AuthCli_GetCurrentUserQuery, + AuthCli_GetCurrentUserQueryVariables, + AuthCli_ListAccountsQuery, + AuthCli_ListAccountsQueryVariables, + AuthCli_ListClustersQuery, + AuthCli_ListClustersQueryVariables, + AuthCli_GetKubeConfigQuery, + AuthCli_GetKubeConfigQueryVariables, +} from '~/root/src/generated/gql/server'; + +export const cliQueries = (executor: IExecutor) => ({ + cli_getKubeConfig: executor( + gql` + query Infra_getCluster($name: String!) { + infra_getCluster(name: $name) { + adminKubeconfig { + encoding + value + } + } + } + `, + { + transformer: (data: AuthCli_GetKubeConfigQuery) => data.infra_getCluster, + vars(_: AuthCli_GetKubeConfigQueryVariables) {}, + } + ), + cli_listClusters: executor( + gql` + query Node($pagination: CursorPaginationIn) { + infra_listClusters(pagination: $pagination) { + edges { + node { + displayName + metadata { + name + } + } + } + } + } + `, + { + transformer(data: AuthCli_ListClustersQuery) { + return data.infra_listClusters; + }, + vars(_: AuthCli_ListClustersQueryVariables) {}, + } + ), + cli_listAccounts: executor( + gql` + query Accounts_listAccounts { + accounts_listAccounts { + id + metadata { + name + } + displayName + } + } + `, + { + transformer(data: AuthCli_ListAccountsQuery) { + return data.accounts_listAccounts; + }, + vars(_: AuthCli_ListAccountsQueryVariables) {}, + } + ), + cli_getCurrentUser: executor( + gql` + query Auth_me { + auth_me { + id + email + name + } + } + `, + { + transformer(data: AuthCli_GetCurrentUserQuery) { + return data.auth_me; + }, + vars(_: AuthCli_GetCurrentUserQueryVariables) {}, + } + ), + + cli_createRemoteLogin: executor( + gql` + mutation Auth_createRemoteLogin($secret: String) { + auth_createRemoteLogin(secret: $secret) + } + `, + { + transformer: (data: AuthCli_CreateRemoteLoginMutation) => + data.auth_createRemoteLogin, + vars(_: AuthCli_CreateRemoteLoginMutationVariables) {}, + } + ), + + cli_getRemoteLogin: executor( + gql` + query Auth_getRemoteLogin($loginId: String!, $secret: String!) { + auth_getRemoteLogin(loginId: $loginId, secret: $secret) { + authHeader + status + } + } + `, + { + transformer: (data: AuthCli_GetRemoteLoginQuery) => + data.auth_getRemoteLogin, + vars(_: AuthCli_GetRemoteLoginQueryVariables) {}, + } + ), +}); diff --git a/src/apps/auth/server/gql/saved-queries.ts b/src/apps/auth/server/gql/saved-queries.ts index 644df2804..593767bd4 100644 --- a/src/apps/auth/server/gql/saved-queries.ts +++ b/src/apps/auth/server/gql/saved-queries.ts @@ -23,11 +23,33 @@ import { AuthWhoAmIQueryVariables, AuthCheckOauthEnabledQuery, AuthCheckOauthEnabledQueryVariables, + AuthSetRemoteAuthHeaderMutation, + AuthSetRemoteAuthHeaderMutationVariables, } from '~/root/src/generated/gql/server'; +import { cliQueries } from './cli-queries'; export const GQLServerHandler = ({ headers, cookies }: IGQLServerProps) => { const executor = ExecuteQueryWithContext(headers, cookies); return { + ...cliQueries(executor), + + setRemoteAuthHeader: executor( + gql` + mutation Auth_setRemoteAuthHeader( + $loginId: String! + $authHeader: String + ) { + auth_setRemoteAuthHeader(loginId: $loginId, authHeader: $authHeader) + } + `, + { + transformer(data: AuthSetRemoteAuthHeaderMutation) { + return data.auth_setRemoteAuthHeader; + }, + vars(_: AuthSetRemoteAuthHeaderMutationVariables) {}, + } + ), + checkOauthEnabled: executor( gql` query Auth_listOAuthProviders { diff --git a/src/apps/console/server/gql/queries/access-queries.ts b/src/apps/console/server/gql/queries/access-queries.ts index 8850096b2..c1b6a1c33 100644 --- a/src/apps/console/server/gql/queries/access-queries.ts +++ b/src/apps/console/server/gql/queries/access-queries.ts @@ -177,7 +177,7 @@ export const accessQueries = (executor: IExecutor) => ({ mutation Accounts_updateAccountMembership( $accountName: String! $memberId: ID! - $role: Kloudlite__io___apps___iam___types__Role! + $role: Github__com___kloudlite___api___apps___iam___types__Role! ) { accounts_updateAccountMembership( accountName: $accountName diff --git a/src/apps/console/server/gql/queries/managed-resource-queries.ts b/src/apps/console/server/gql/queries/managed-resource-queries.ts index 223c7a717..64e1d2327 100644 --- a/src/apps/console/server/gql/queries/managed-resource-queries.ts +++ b/src/apps/console/server/gql/queries/managed-resource-queries.ts @@ -52,16 +52,15 @@ export const managedResourceQueries = (executor: IExecutor) => ({ } recordVersion spec { - inputs { - RawMessage - } - mresKind { - kind - } - msvcRef { + resourceTemplate { apiVersion kind - name + msvcRef { + name + kind + apiVersion + } + spec } } status { diff --git a/src/apps/console/server/gql/queries/managed-service-queries.ts b/src/apps/console/server/gql/queries/managed-service-queries.ts index 567a6b100..96907a73d 100644 --- a/src/apps/console/server/gql/queries/managed-service-queries.ts +++ b/src/apps/console/server/gql/queries/managed-service-queries.ts @@ -188,21 +188,10 @@ export const managedServiceQueries = (executor: IExecutor) => ({ } recordVersion spec { - inputs { - RawMessage - } - msvcKind { + serviceTemplate { apiVersion kind - } - nodeSelector - region - tolerations { - effect - key - operator - tolerationSeconds - value + spec } } status { @@ -275,21 +264,10 @@ export const managedServiceQueries = (executor: IExecutor) => ({ } recordVersion spec { - inputs { - RawMessage - } - msvcKind { + serviceTemplate { apiVersion kind - } - nodeSelector - region - tolerations { - effect - key - operator - tolerationSeconds - value + spec } } status { diff --git a/src/apps/console/server/gql/queries/vpn-queries.ts b/src/apps/console/server/gql/queries/vpn-queries.ts index a164bf9dd..4723b578b 100644 --- a/src/apps/console/server/gql/queries/vpn-queries.ts +++ b/src/apps/console/server/gql/queries/vpn-queries.ts @@ -100,7 +100,6 @@ export const vpnQueries = (executor: IExecutor) => ({ spec { accountName clusterName - dns ports { port targetPort @@ -179,7 +178,6 @@ export const vpnQueries = (executor: IExecutor) => ({ spec { accountName clusterName - dns ports { port targetPort diff --git a/src/generated/gql/sdl.graphql b/src/generated/gql/sdl.graphql index 0fa1935ce..d6a5b8622 100644 --- a/src/generated/gql/sdl.graphql +++ b/src/generated/gql/sdl.graphql @@ -7,14 +7,14 @@ directive @specifiedBy( type Account { apiVersion: String! contactEmail: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! description: String displayName: String! id: String! isActive: Boolean kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! logo: String markedForDeletion: Boolean metadata: Metadata @@ -36,14 +36,14 @@ input AccountIn { type AccountMembership { accountName: String! - role: Kloudlite__io___apps___iam___types__Role! + role: Github__com___kloudlite___api___apps___iam___types__Role! user: User! userId: String! } input AccountMembershipIn { accountName: String! - role: Kloudlite__io___apps___iam___types__Role! + role: Github__com___kloudlite___api___apps___iam___types__Role! userId: String! } @@ -58,20 +58,20 @@ type App { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! enabled: Boolean id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__AppSpec! status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! workspaceName: String! } @@ -95,28 +95,28 @@ type AppPaginatedRecords { } type Build { - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! - credUser: Kloudlite__io___common__CreatedOrUpdatedBy! + credUser: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! errorMessages: Map! id: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean name: String! recordVersion: Int! - source: Kloudlite__io___apps___container____registry___internal___domain___entities__GitSource! + source: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource! spec: Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpec! - status: Kloudlite__io___apps___container____registry___internal___domain___entities__BuildStatus! + status: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus! updateTime: Date! } type BuildCacheKey { accountName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! id: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean name: String! recordVersion: Int! @@ -148,7 +148,7 @@ type BuildEdge { input BuildIn { name: String! - source: Kloudlite__io___apps___container____registry___internal___domain___entities__GitSourceIn! + source: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn! spec: Github__com___kloudlite___operator___apis___distribution___v1__BuildRunSpecIn! } @@ -184,45 +184,6 @@ type BuildRunPaginatedRecords { totalCount: Int! } -type BYOCCluster { - accountName: String! - apiVersion: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! - creationTime: Date! - displayName: String! - helmStatus: Map! - id: String! - incomingKafkaTopicName: String! - isConnected: Boolean! - kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! - markedForDeletion: Boolean - metadata: Metadata - recordVersion: Int! - spec: Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec! - status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! - updateTime: Date! -} - -type BYOCClusterEdge { - cursor: String! - node: BYOCCluster! -} - -input BYOCClusterIn { - accountName: String! - displayName: String! - metadata: MetadataIn - spec: Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpecIn! -} - -type BYOCClusterPaginatedRecords { - edges: [BYOCClusterEdge!]! - pageInfo: PageInfo! - totalCount: Int! -} - type CheckAwsAccessOutput { installationUrl: String result: Boolean! @@ -235,13 +196,13 @@ type CheckNameAvailabilityOutput { type CloudProviderSecret { accountName: String! - aws: Kloudlite__io___apps___infra___internal___entities__AWSSecretCredentials + aws: Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials cloudProviderName: Github__com___kloudlite___operator___apis___common____types__CloudProvider! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! id: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata! recordVersion: Int! @@ -254,7 +215,7 @@ type CloudProviderSecretEdge { } input CloudProviderSecretIn { - aws: Kloudlite__io___apps___infra___internal___entities__AWSSecretCredentialsIn + aws: Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn cloudProviderName: Github__com___kloudlite___operator___apis___common____types__CloudProvider! displayName: String! metadata: MetadataIn! @@ -270,18 +231,18 @@ type Cluster { accountName: String! adminKubeconfig: EncodedValue apiVersion: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec! status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! } @@ -306,19 +267,19 @@ type Config { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! data: Map displayName: String! enabled: Boolean id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata recordVersion: Int! status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! } @@ -363,13 +324,13 @@ type CRCheckNameAvailabilityOutput { } type Credential { - access: Kloudlite__io___apps___container____registry___internal___domain___entities__RepoAccess! + access: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess! accountName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! - expiration: Kloudlite__io___apps___container____registry___internal___domain___entities__Expiration! + expiration: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration! id: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean name: String! recordVersion: Int! @@ -383,8 +344,8 @@ type CredentialEdge { } input CredentialIn { - access: Kloudlite__io___apps___container____registry___internal___domain___entities__RepoAccess! - expiration: Kloudlite__io___apps___container____registry___internal___domain___entities__ExpirationIn! + access: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess! + expiration: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn! name: String! username: String! } @@ -452,12 +413,12 @@ type DigestPaginatedRecords { type DomainEntry { accountName: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! domainName: String! id: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean recordVersion: Int! updateTime: Date! @@ -504,6 +465,199 @@ type GitBranch { protected: Boolean } +type Github__com___kloudlite___api___apps___console___internal___entities__InputField { + defaultValue: Any + inputType: String! + label: String! + max: Float + min: Float + name: String! + required: Boolean + unit: String +} + +type Github__com___kloudlite___api___apps___console___internal___entities__MresTemplate { + apiVersion: String + description: String! + displayName: String! + fields: [Github__com___kloudlite___api___apps___console___internal___entities__InputField!]! + kind: String + name: String! + outputs: [Github__com___kloudlite___api___apps___console___internal___entities__OutputField!]! +} + +type Github__com___kloudlite___api___apps___console___internal___entities__MsvcTemplateEntry { + active: Boolean! + apiVersion: String + description: String! + displayName: String! + fields: [Github__com___kloudlite___api___apps___console___internal___entities__InputField!]! + kind: String + logoUrl: String! + name: String! + outputs: [Github__com___kloudlite___api___apps___console___internal___entities__OutputField!]! + resources: [Github__com___kloudlite___api___apps___console___internal___entities__MresTemplate!]! +} + +type Github__com___kloudlite___api___apps___console___internal___entities__OutputField { + description: String! + label: String! + name: String! +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__BuildStatus { + error + failed + idle + pending + queued + running + success +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__Expiration { + unit: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit! + value: Int! +} + +input Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationIn { + unit: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit! + value: Int! +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__ExpirationUnit { + d + h + m + w + y +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository { + archived: Boolean + cloneUrl: String + createdAt: Date + defaultBranch: String + description: String + disabled: Boolean + fullName: String + gitignoreTemplate: String + gitUrl: String + htmlUrl: String + id: Int + language: String + masterBranch: String + mirrorUrl: String + name: String + node_id: String + permissions: Map + private: Boolean + pushedAt: Date + size: Int + team_id: Int + updatedAt: Date + url: String + visibility: String +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount { + avatarUrl: String + id: Int + login: String + nodeId: String + type: String +} + +input Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccountIn { + avatarUrl: String + id: Int + login: String + nodeId: String + type: String +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider { + github + gitlab +} + +type Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSource { + branch: String! + provider: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider! + repository: String! + webhookId: Int +} + +input Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitSourceIn { + branch: String! + provider: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GitProvider! + repository: String! +} + +enum Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__RepoAccess { + read + read_write +} + +enum Github__com___kloudlite___api___apps___iam___types__Role { + account_admin + account_member + account_owner + project_admin + project_member + resource_owner +} + +type Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentials { + accessKey: String + awsAccountId: String + cfParamExternalID: String + cfParamInstanceProfileName: String + cfParamRoleName: String + cfParamStackName: String + cfParamTrustedARN: String + secretKey: String +} + +input Github__com___kloudlite___api___apps___infra___internal___entities__AWSSecretCredentialsIn { + accessKey: String + awsAccountId: String + secretKey: String +} + +type Github__com___kloudlite___api___common__CreatedOrUpdatedBy { + userEmail: String! + userId: String! + userName: String! +} + +type Github__com___kloudlite___api___pkg___types__EncodedString { + encoding: String! + value: String! +} + +type Github__com___kloudlite___api___pkg___types__SyncStatus { + action: Github__com___kloudlite___api___pkg___types__SyncStatusAction! + error: String + lastSyncedAt: Date + recordVersion: Int! + state: Github__com___kloudlite___api___pkg___types__SyncStatusState! + syncScheduledAt: Date +} + +enum Github__com___kloudlite___api___pkg___types__SyncStatusAction { + APPLY + DELETE +} + +enum Github__com___kloudlite___api___pkg___types__SyncStatusState { + APPLIED_AT_AGENT + ERRORED_AT_AGENT + IDLE + IN_QUEUE + RECEIVED_UPDATE_FROM_AGENT +} + type Github__com___kloudlite___operator___apis___clusters___v1__AWSClusterConfig { k3sMasters: Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfig nodePools: Map @@ -599,28 +753,6 @@ input Github__com___kloudlite___operator___apis___clusters___v1__AwsSpotPoolConf nodes: Map } -type Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpec { - accountName: String! - displayName: String - incomingKafkaTopic: String! - ingressClasses: [String!] - provider: String! - publicIps: [String!] - region: String! - storageClasses: [String!] -} - -input Github__com___kloudlite___operator___apis___clusters___v1__BYOCSpecIn { - accountName: String! - displayName: String - incomingKafkaTopic: String! - ingressClasses: [String!] - provider: String! - publicIps: [String!] - region: String! - storageClasses: [String!] -} - type Github__com___kloudlite___operator___apis___clusters___v1__CloudProviderCredentialKeys { keyAccessKey: String! keyAWSAccountId: String! @@ -953,13 +1085,11 @@ input Github__com___kloudlite___operator___apis___crds___v1__HttpGetProbeIn { } type Github__com___kloudlite___operator___apis___crds___v1__Https { - clusterIssuer: String enabled: Boolean! forceRedirect: Boolean } input Github__com___kloudlite___operator___apis___crds___v1__HttpsIn { - clusterIssuer: String enabled: Boolean! forceRedirect: Boolean } @@ -975,58 +1105,40 @@ input Github__com___kloudlite___operator___apis___crds___v1__InterceptIn { } type Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec { - inputs: Github__com___kloudlite___operator___pkg___raw____json__RawJson - mresKind: Github__com___kloudlite___operator___apis___crds___v1__mresKind! - msvcRef: Github__com___kloudlite___operator___apis___crds___v1__msvcNamedRefTT! + resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate! } input Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpecIn { - inputs: Github__com___kloudlite___operator___pkg___raw____json__RawJsonIn - mresKind: Github__com___kloudlite___operator___apis___crds___v1__mresKindIn! - msvcRef: Github__com___kloudlite___operator___apis___crds___v1__msvcNamedRefTTIn! + resourceTemplate: Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn! } type Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec { - inputs: Github__com___kloudlite___operator___pkg___raw____json__RawJson - msvcKind: Github__com___kloudlite___operator___apis___crds___v1__msvcKind! - nodeSelector: Map - region: String - tolerations: [K8s__io___api___core___v1__Toleration!] + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate! } input Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpecIn { - inputs: Github__com___kloudlite___operator___pkg___raw____json__RawJsonIn - msvcKind: Github__com___kloudlite___operator___apis___crds___v1__msvcKindIn! - nodeSelector: Map - region: String - tolerations: [K8s__io___api___core___v1__TolerationIn!] -} - -type Github__com___kloudlite___operator___apis___crds___v1__mresKind { - kind: String! + serviceTemplate: Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn! } -input Github__com___kloudlite___operator___apis___crds___v1__mresKindIn { - kind: String! -} - -type Github__com___kloudlite___operator___apis___crds___v1__msvcKind { +type Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplate { apiVersion: String! kind: String! + msvcRef: Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef! + spec: Map! } -input Github__com___kloudlite___operator___apis___crds___v1__msvcKindIn { - apiVersion: String! - kind: String! +input Github__com___kloudlite___operator___apis___crds___v1__MresResourceTemplateIn { + msvcRef: Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn! + spec: Map! } -type Github__com___kloudlite___operator___apis___crds___v1__msvcNamedRefTT { +type Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRef { apiVersion: String! kind: String! name: String! } -input Github__com___kloudlite___operator___apis___crds___v1__msvcNamedRefTTIn { +input Github__com___kloudlite___operator___apis___crds___v1__MsvcNamedRefIn { apiVersion: String! kind: String! name: String! @@ -1122,6 +1234,16 @@ input Github__com___kloudlite___operator___apis___crds___v1__RouterSpecIn { routes: [Github__com___kloudlite___operator___apis___crds___v1__RouteIn!] } +type Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplate { + apiVersion: String! + kind: String! + spec: Map! +} + +input Github__com___kloudlite___operator___apis___crds___v1__ServiceTemplateIn { + spec: Map! +} + type Github__com___kloudlite___operator___apis___crds___v1__ShellProbe { command: [String!] } @@ -1214,14 +1336,14 @@ input Github__com___kloudlite___operator___apis___distribution___v1__ResourceIn type Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec { accountName: String! clusterName: String! - dns: String + deviceNamespace: String ports: [Github__com___kloudlite___operator___apis___wireguard___v1__Port!] } input Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpecIn { accountName: String! clusterName: String! - dns: String + deviceNamespace: String ports: [Github__com___kloudlite___operator___apis___wireguard___v1__PortIn!] } @@ -1291,7 +1413,7 @@ type GithubBranch { } type GithubInstallation { - account: Kloudlite__io___apps___container____registry___internal___domain___entities__GithubUserAccount + account: Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubUserAccount appId: Int id: Int nodeId: String @@ -1301,13 +1423,13 @@ type GithubInstallation { } type GithubListRepository { - repositories: [Kloudlite__io___apps___container____registry___internal___domain___entities__GithubRepository]! + repositories: [Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository]! totalCount: Int } type GithubSearchRepository { incompleteResults: Boolean - repositories: [Kloudlite__io___apps___container____registry___internal___domain___entities__GithubRepository]! + repositories: [Github__com___kloudlite___api___apps___container____registry___internal___domain___entities__GithubRepository]! total: Int } @@ -1395,13 +1517,13 @@ type Invitation { updateTime: Date! userEmail: String userName: String - userRole: Kloudlite__io___apps___iam___types__Role! + userRole: Github__com___kloudlite___api___apps___iam___types__Role! } input InvitationIn { userEmail: String userName: String - userRole: Kloudlite__io___apps___iam___types__Role! + userRole: Github__com___kloudlite___api___apps___iam___types__Role! } scalar Json @@ -1466,19 +1588,19 @@ input K8s__io___api___core___v1__PersistentVolumeClaimSpecIn { type K8s__io___api___core___v1__PersistentVolumeClaimStatus { accessModes: [String!] allocatedResources: Map + allocatedResourceStatuses: Map capacity: Map conditions: [K8s__io___api___core___v1__PersistentVolumeClaimCondition!] phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase - resizeStatus: String } input K8s__io___api___core___v1__PersistentVolumeClaimStatusIn { accessModes: [String!] allocatedResources: Map + allocatedResourceStatuses: Map capacity: Map conditions: [K8s__io___api___core___v1__PersistentVolumeClaimConditionIn!] phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase - resizeStatus: String } type K8s__io___api___core___v1__ResourceClaim { @@ -1608,221 +1730,23 @@ input K8s__io___apimachinery___pkg___apis___meta___v1__LabelSelectorRequirementI values: [String!] } -type Kloudlite__io___apps___console___internal___entities__InputField { - defaultValue: Any - inputType: String! - label: String! - max: Float - min: Float - name: String! - required: Boolean - unit: String -} - -type Kloudlite__io___apps___console___internal___entities__MresTemplate { - apiVersion: String - description: String! - displayName: String! - fields: [Kloudlite__io___apps___console___internal___entities__InputField!]! - kind: String - name: String! - outputs: [Kloudlite__io___apps___console___internal___entities__OutputField!]! -} - -type Kloudlite__io___apps___console___internal___entities__MsvcTemplateEntry { - active: Boolean! - apiVersion: String - description: String! - displayName: String! - fields: [Kloudlite__io___apps___console___internal___entities__InputField!]! - kind: String - logoUrl: String! - name: String! - outputs: [Kloudlite__io___apps___console___internal___entities__OutputField!]! - resources: [Kloudlite__io___apps___console___internal___entities__MresTemplate!]! -} - -type Kloudlite__io___apps___console___internal___entities__OutputField { - description: String! - label: String! - name: String! -} - -enum Kloudlite__io___apps___container____registry___internal___domain___entities__BuildStatus { - error - failed - idle - pending - queued - running - success -} - -type Kloudlite__io___apps___container____registry___internal___domain___entities__Expiration { - unit: Kloudlite__io___apps___container____registry___internal___domain___entities__ExpirationUnit! - value: Int! -} - -input Kloudlite__io___apps___container____registry___internal___domain___entities__ExpirationIn { - unit: Kloudlite__io___apps___container____registry___internal___domain___entities__ExpirationUnit! - value: Int! -} - -enum Kloudlite__io___apps___container____registry___internal___domain___entities__ExpirationUnit { - d - h - m - w - y -} - -type Kloudlite__io___apps___container____registry___internal___domain___entities__GithubRepository { - archived: Boolean - cloneUrl: String - createdAt: Date - defaultBranch: String - description: String - disabled: Boolean - fullName: String - gitignoreTemplate: String - gitUrl: String - htmlUrl: String - id: Int - language: String - masterBranch: String - mirrorUrl: String - name: String - node_id: String - permissions: Map - private: Boolean - pushedAt: Date - size: Int - team_id: Int - updatedAt: Date - url: String - visibility: String -} - -type Kloudlite__io___apps___container____registry___internal___domain___entities__GithubUserAccount { - avatarUrl: String - id: Int - login: String - nodeId: String - type: String -} - -input Kloudlite__io___apps___container____registry___internal___domain___entities__GithubUserAccountIn { - avatarUrl: String - id: Int - login: String - nodeId: String - type: String -} - -enum Kloudlite__io___apps___container____registry___internal___domain___entities__GitProvider { - github - gitlab -} - -type Kloudlite__io___apps___container____registry___internal___domain___entities__GitSource { - branch: String! - provider: Kloudlite__io___apps___container____registry___internal___domain___entities__GitProvider! - repository: String! - webhookId: Int -} - -input Kloudlite__io___apps___container____registry___internal___domain___entities__GitSourceIn { - branch: String! - provider: Kloudlite__io___apps___container____registry___internal___domain___entities__GitProvider! - repository: String! -} - -enum Kloudlite__io___apps___container____registry___internal___domain___entities__RepoAccess { - read - read_write -} - -enum Kloudlite__io___apps___iam___types__Role { - account_admin - account_member - account_owner - project_admin - project_member - resource_owner -} - -type Kloudlite__io___apps___infra___internal___entities__AWSSecretCredentials { - accessKey: String - awsAccountId: String - cfParamExternalID: String - cfParamInstanceProfileName: String - cfParamRoleName: String - cfParamStackName: String - cfParamTrustedARN: String - secretKey: String -} - -input Kloudlite__io___apps___infra___internal___entities__AWSSecretCredentialsIn { - accessKey: String - awsAccountId: String - secretKey: String -} - -type Kloudlite__io___apps___infra___internal___entities__HelmStatusVal { - isReady: Boolean - message: String! -} - -type Kloudlite__io___common__CreatedOrUpdatedBy { - userEmail: String! - userId: String! - userName: String! -} - -type Kloudlite__io___pkg___types__EncodedString { - encoding: String! - value: String! -} - -type Kloudlite__io___pkg___types__SyncStatus { - action: Kloudlite__io___pkg___types__SyncStatusAction! - error: String - lastSyncedAt: Date - recordVersion: Int! - state: Kloudlite__io___pkg___types__SyncStatusState! - syncScheduledAt: Date -} - -enum Kloudlite__io___pkg___types__SyncStatusAction { - APPLY - DELETE -} - -enum Kloudlite__io___pkg___types__SyncStatusState { - APPLIED_AT_AGENT - ERRORED_AT_AGENT - IDLE - IN_QUEUE - RECEIVED_UPDATE_FROM_AGENT -} - type ManagedResource { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! enabled: Boolean id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedResourceSpec! status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! } @@ -1848,19 +1772,19 @@ type ManagedService { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! enabled: Boolean id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__ManagedServiceSpec! status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! } @@ -1904,18 +1828,6 @@ enum MatchFilterMatchType { regex } -type Membership { - accountName: String! - role: String! - userId: String! -} - -input MembershipIn { - accountName: String! - role: String! - userId: String! -} - type Metadata { annotations: Map creationTimestamp: Date! @@ -1936,7 +1848,7 @@ input MetadataIn { type MsvcTemplate { category: String! displayName: String! - items: [Kloudlite__io___apps___console___internal___entities__MsvcTemplateEntry!]! + items: [Github__com___kloudlite___api___apps___console___internal___entities__MsvcTemplateEntry!]! } type Mutation { @@ -1951,7 +1863,7 @@ type Mutation { accounts_removeAccountMembership(accountName: String!, memberId: ID!): Boolean! accounts_resendInviteMail(accountName: String!, invitationId: String!): Boolean! accounts_updateAccount(account: AccountIn!): Account! - accounts_updateAccountMembership(accountName: String!, memberId: ID!, role: Kloudlite__io___apps___iam___types__Role!): Boolean! + accounts_updateAccountMembership(accountName: String!, memberId: ID!, role: Github__com___kloudlite___api___apps___iam___types__Role!): Boolean! auth_changeEmail(email: String!): Boolean! auth_changePassword(currentPassword: String!, newPassword: String!): Boolean! auth_clearMetadata: User! @@ -2007,19 +1919,16 @@ type Mutation { cr_triggerBuild(id: ID!): Boolean! cr_updateBuild(build: BuildIn!, id: ID!): Build cr_updateBuildCacheKey(buildCacheKey: BuildCacheKeyIn!, id: ID!): BuildCacheKey - infra_createBYOCCluster(byocCluster: BYOCClusterIn!): BYOCCluster infra_createCluster(cluster: ClusterIn!): Cluster infra_createDomainEntry(domainEntry: DomainEntryIn!): DomainEntry infra_createNodePool(clusterName: String!, pool: NodePoolIn!): NodePool infra_createProviderSecret(secret: CloudProviderSecretIn!): CloudProviderSecret infra_createVPNDevice(clusterName: String!, vpnDevice: VPNDeviceIn!): VPNDevice - infra_deleteBYOCCluster(name: String!): Boolean! infra_deleteCluster(name: String!): Boolean! infra_deleteDomainEntry(domainName: String!): Boolean! infra_deleteNodePool(clusterName: String!, poolName: String!): Boolean! infra_deleteProviderSecret(secretName: String!): Boolean! infra_deleteVPNDevice(clusterName: String!, deviceName: String!): Boolean! - infra_updateBYOCCluster(byocCluster: BYOCClusterIn!): BYOCCluster infra_updateCluster(cluster: ClusterIn!): Cluster infra_updateDomainEntry(domainEntry: DomainEntryIn!): DomainEntry infra_updateNodePool(clusterName: String!, pool: NodePoolIn!): NodePool @@ -2041,7 +1950,7 @@ type Node { recordVersion: Int! spec: Github__com___kloudlite___operator___apis___clusters___v1__NodeSpec! status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! } @@ -2065,18 +1974,18 @@ type NodePool { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata recordVersion: Int! spec: Github__com___kloudlite___operator___apis___clusters___v1__NodePoolSpec! status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! } @@ -2149,18 +2058,18 @@ type Project { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__ProjectSpec! status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! } @@ -2201,7 +2110,7 @@ type Query { accounts_listAccounts: [Account] accounts_listInvitations(accountName: String!): [Invitation!] accounts_listInvitationsForUser(onlyPending: Boolean!): [Invitation!] - accounts_listMembershipsForAccount(accountName: String!, role: Kloudlite__io___apps___iam___types__Role): [AccountMembership!] + accounts_listMembershipsForAccount(accountName: String!, role: Github__com___kloudlite___api___apps___iam___types__Role): [AccountMembership!] accounts_listMembershipsForUser: [AccountMembership!] accounts_resyncAccount(accountName: String!): Boolean! auth_findByEmail(email: String!): User @@ -2215,7 +2124,7 @@ type Query { core_getImagePullSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId): ImagePullSecret core_getManagedResource(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): ManagedResource core_getManagedService(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): ManagedService - core_getManagedServiceTemplate(category: String!, name: String!): Kloudlite__io___apps___console___internal___entities__MsvcTemplateEntry + core_getManagedServiceTemplate(category: String!, name: String!): Github__com___kloudlite___api___apps___console___internal___entities__MsvcTemplateEntry core_getProject(name: String!): Project core_getRouter(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Router core_getSecret(name: String!, project: ProjectId!, scope: WorkspaceOrEnvId!): Secret @@ -2259,7 +2168,6 @@ type Query { infra_checkAwsAccess(cloudproviderName: String!): CheckAwsAccessOutput! infra_checkNameAvailability(clusterName: String, name: String!, resType: ResType!): CheckNameAvailabilityOutput! infra_getBuildRun(buildRunName: String!, repoName: String!): BuildRun - infra_getBYOCCluster(name: String!): BYOCCluster infra_getCluster(name: String!): Cluster infra_getDomainEntry(domainName: String!): DomainEntry infra_getNodePool(clusterName: String!, poolName: String!): NodePool @@ -2267,7 +2175,6 @@ type Query { infra_getPVC(clusterName: String!, name: String!): PersistentVolumeClaim infra_getVPNDevice(clusterName: String!, name: String!): VPNDevice infra_listBuildRuns(pq: CursorPaginationIn, repoName: String!, search: SearchBuildRuns): BuildRunPaginatedRecords - infra_listBYOCClusters(pagination: CursorPaginationIn, search: SearchCluster): BYOCClusterPaginatedRecords infra_listClusters(pagination: CursorPaginationIn, search: SearchCluster): ClusterPaginatedRecords infra_listDomainEntries(pagination: CursorPaginationIn, search: SearchDomainEntry): DomainEntryPaginatedRecords infra_listNodePools(clusterName: String!, pagination: CursorPaginationIn, search: SearchNodepool): NodePoolPaginatedRecords @@ -2284,10 +2191,10 @@ type RemoteLogin { type Repository { accountName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! id: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean name: String! recordVersion: Int! @@ -2320,19 +2227,19 @@ type Router { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! enabled: Boolean id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__RouterSpec! status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! } @@ -2472,20 +2379,20 @@ type Secret { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! data: Map displayName: String! enabled: Boolean id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata recordVersion: Int! status: Github__com___kloudlite___operator___pkg___operator__Status stringData: Map - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! type: K8s__io___api___core___v1__SecretType updateTime: Date! } @@ -2540,20 +2447,20 @@ type VPNDevice { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata recordVersion: Int! spec: Github__com___kloudlite___operator___apis___wireguard___v1__DeviceSpec status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! - wireguardConfig: Kloudlite__io___pkg___types__EncodedString + wireguardConfig: Github__com___kloudlite___api___pkg___types__EncodedString } type VPNDeviceEdge { @@ -2577,19 +2484,19 @@ type Workspace { accountName: String! apiVersion: String! clusterName: String! - createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! + createdBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! id: String! kind: String! - lastUpdatedBy: Kloudlite__io___common__CreatedOrUpdatedBy! + lastUpdatedBy: Github__com___kloudlite___api___common__CreatedOrUpdatedBy! markedForDeletion: Boolean metadata: Metadata projectName: String! recordVersion: Int! spec: Github__com___kloudlite___operator___apis___crds___v1__WorkspaceSpec status: Github__com___kloudlite___operator___pkg___operator__Status - syncStatus: Kloudlite__io___pkg___types__SyncStatus! + syncStatus: Github__com___kloudlite___api___pkg___types__SyncStatus! updateTime: Date! } diff --git a/src/generated/gql/server.ts b/src/generated/gql/server.ts index 8e9ffb682..224b1993e 100644 --- a/src/generated/gql/server.ts +++ b/src/generated/gql/server.ts @@ -33,7 +33,7 @@ export type Scalars = { URL: { input: any; output: any }; }; -export type Kloudlite__Io___Apps___Iam___Types__Role = +export type Github__Com___Kloudlite___Api___Apps___Iam___Types__Role = | 'account_admin' | 'account_member' | 'account_owner' @@ -80,9 +80,11 @@ export type K8s__Io___Api___Core___V1__TaintEffect = export type K8s__Io___Api___Core___V1__TolerationOperator = 'Equal' | 'Exists'; -export type Kloudlite__Io___Pkg___Types__SyncStatusAction = 'APPLY' | 'DELETE'; +export type Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction = + | 'APPLY' + | 'DELETE'; -export type Kloudlite__Io___Pkg___Types__SyncStatusState = +export type Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState = | 'APPLIED_AT_AGENT' | 'ERRORED_AT_AGENT' | 'IDLE' @@ -175,10 +177,10 @@ export type SearchSecrets = { text?: InputMaybe; }; -export type Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__GitProvider = +export type Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__GitProvider = 'github' | 'gitlab'; -export type Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__BuildStatus = +export type Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__BuildStatus = 'error' | 'failed' | 'idle' | 'pending' | 'queued' | 'running' | 'success'; export type SearchBuildCacheKeys = { @@ -193,10 +195,10 @@ export type SearchCreds = { text?: InputMaybe; }; -export type Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__RepoAccess = +export type Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__RepoAccess = 'read' | 'read_write'; -export type Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__ExpirationUnit = +export type Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__ExpirationUnit = 'd' | 'h' | 'm' | 'w' | 'y'; export type SearchRepos = { @@ -296,7 +298,7 @@ export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__AccountSpecIn export type InvitationIn = { userEmail?: InputMaybe; userName?: InputMaybe; - userRole: Kloudlite__Io___Apps___Iam___Types__Role; + userRole: Github__Com___Kloudlite___Api___Apps___Iam___Types__Role; }; export type AppIn = { @@ -475,22 +477,16 @@ export type ManagedResourceIn = { export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__ManagedResourceSpecIn = { - inputs?: InputMaybe; - mresKind: Github__Com___Kloudlite___Operator___Apis___Crds___V1__MresKindIn; - msvcRef: Github__Com___Kloudlite___Operator___Apis___Crds___V1__MsvcNamedRefTtIn; + resourceTemplate: Github__Com___Kloudlite___Operator___Apis___Crds___V1__MresResourceTemplateIn; }; -export type Github__Com___Kloudlite___Operator___Pkg___Raw____Json__RawJsonIn = +export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__MresResourceTemplateIn = { - RawMessage?: InputMaybe; + msvcRef: Github__Com___Kloudlite___Operator___Apis___Crds___V1__MsvcNamedRefIn; + spec: Scalars['Map']['input']; }; -export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__MresKindIn = - { - kind: Scalars['String']['input']; - }; - -export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__MsvcNamedRefTtIn = +export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__MsvcNamedRefIn = { apiVersion: Scalars['String']['input']; kind: Scalars['String']['input']; @@ -506,17 +502,12 @@ export type ManagedServiceIn = { export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__ManagedServiceSpecIn = { - inputs?: InputMaybe; - msvcKind: Github__Com___Kloudlite___Operator___Apis___Crds___V1__MsvcKindIn; - nodeSelector?: InputMaybe; - region?: InputMaybe; - tolerations?: InputMaybe>; + serviceTemplate: Github__Com___Kloudlite___Operator___Apis___Crds___V1__ServiceTemplateIn; }; -export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__MsvcKindIn = +export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__ServiceTemplateIn = { - apiVersion: Scalars['String']['input']; - kind: Scalars['String']['input']; + spec: Scalars['Map']['input']; }; export type ProjectIn = { @@ -569,7 +560,6 @@ export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__CorsIn = { }; export type Github__Com___Kloudlite___Operator___Apis___Crds___V1__HttpsIn = { - clusterIssuer?: InputMaybe; enabled: Scalars['Boolean']['input']; forceRedirect?: InputMaybe; }; @@ -601,14 +591,14 @@ export type SecretIn = { export type BuildIn = { name: Scalars['String']['input']; - source: Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__GitSourceIn; + source: Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__GitSourceIn; spec: Github__Com___Kloudlite___Operator___Apis___Distribution___V1__BuildRunSpecIn; }; -export type Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__GitSourceIn = +export type Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__GitSourceIn = { branch: Scalars['String']['input']; - provider: Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__GitProvider; + provider: Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__GitProvider; repository: Scalars['String']['input']; }; @@ -654,15 +644,15 @@ export type BuildCacheKeyIn = { }; export type CredentialIn = { - access: Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__RepoAccess; - expiration: Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__ExpirationIn; + access: Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__RepoAccess; + expiration: Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__ExpirationIn; name: Scalars['String']['input']; username: Scalars['String']['input']; }; -export type Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__ExpirationIn = +export type Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__ExpirationIn = { - unit: Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__ExpirationUnit; + unit: Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__ExpirationUnit; value: Scalars['Int']['input']; }; @@ -670,25 +660,6 @@ export type RepositoryIn = { name: Scalars['String']['input']; }; -export type ByocClusterIn = { - accountName: Scalars['String']['input']; - displayName: Scalars['String']['input']; - metadata?: InputMaybe; - spec: Github__Com___Kloudlite___Operator___Apis___Clusters___V1__ByocSpecIn; -}; - -export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__ByocSpecIn = - { - accountName: Scalars['String']['input']; - displayName?: InputMaybe; - incomingKafkaTopic: Scalars['String']['input']; - ingressClasses?: InputMaybe>; - provider: Scalars['String']['input']; - publicIps?: InputMaybe>; - region: Scalars['String']['input']; - storageClasses?: InputMaybe>; - }; - export type ClusterIn = { displayName: Scalars['String']['input']; metadata: MetadataIn; @@ -783,13 +754,13 @@ export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__AwsSpotGp }; export type CloudProviderSecretIn = { - aws?: InputMaybe; + aws?: InputMaybe; cloudProviderName: Github__Com___Kloudlite___Operator___Apis___Common____Types__CloudProvider; displayName: Scalars['String']['input']; metadata: MetadataIn; }; -export type Kloudlite__Io___Apps___Infra___Internal___Entities__AwsSecretCredentialsIn = +export type Github__Com___Kloudlite___Api___Apps___Infra___Internal___Entities__AwsSecretCredentialsIn = { accessKey?: InputMaybe; awsAccountId?: InputMaybe; @@ -806,7 +777,7 @@ export type Github__Com___Kloudlite___Operator___Apis___Wireguard___V1__DeviceSp { accountName: Scalars['String']['input']; clusterName: Scalars['String']['input']; - dns?: InputMaybe; + deviceNamespace?: InputMaybe; ports?: InputMaybe< Array >; @@ -820,7 +791,7 @@ export type Github__Com___Kloudlite___Operator___Apis___Wireguard___V1__PortIn = export type AccountMembershipIn = { accountName: Scalars['String']['input']; - role: Kloudlite__Io___Apps___Iam___Types__Role; + role: Github__Com___Kloudlite___Api___Apps___Iam___Types__Role; userId: Scalars['String']['input']; }; @@ -837,6 +808,15 @@ export type EnvOrWorkspaceOrProjectIdType = | 'workspaceName' | 'workspaceTargetNamespace'; +export type Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__GithubUserAccountIn = + { + avatarUrl?: InputMaybe; + id?: InputMaybe; + login?: InputMaybe; + nodeId?: InputMaybe; + type?: InputMaybe; + }; + export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__NodePropsIn = { lastRecreatedAt?: InputMaybe; @@ -870,6 +850,11 @@ export type Github__Com___Kloudlite___Operator___Pkg___Operator__StatusIn = { >; }; +export type Github__Com___Kloudlite___Operator___Pkg___Raw____Json__RawJsonIn = + { + RawMessage?: InputMaybe; + }; + export type K8s__Io___Api___Core___V1__PersistentVolumeClaimConditionIn = { lastProbeTime?: InputMaybe; lastTransitionTime?: InputMaybe; @@ -930,12 +915,12 @@ export type K8s__Io___Apimachinery___Pkg___Apis___Meta___V1__LabelSelectorRequir export type K8s__Io___Api___Core___V1__PersistentVolumeClaimStatusIn = { accessModes?: InputMaybe>; allocatedResources?: InputMaybe; + allocatedResourceStatuses?: InputMaybe; capacity?: InputMaybe; conditions?: InputMaybe< Array >; phase?: InputMaybe; - resizeStatus?: InputMaybe; }; export type K8s__Io___Apimachinery___Pkg___Api___Resource__Format = @@ -947,21 +932,6 @@ export type K8s__Io___Apimachinery___Pkg___Api___Resource__QuantityIn = { Format: K8s__Io___Apimachinery___Pkg___Api___Resource__Format; }; -export type Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__GithubUserAccountIn = - { - avatarUrl?: InputMaybe; - id?: InputMaybe; - login?: InputMaybe; - nodeId?: InputMaybe; - type?: InputMaybe; - }; - -export type MembershipIn = { - accountName: Scalars['String']['input']; - role: Scalars['String']['input']; - userId: Scalars['String']['input']; -}; - export type NodeIn = { metadata?: InputMaybe; spec: Github__Com___Kloudlite___Operator___Apis___Clusters___V1__NodeSpecIn; @@ -1136,11 +1106,11 @@ export type ConsoleGetProjectQuery = { }; syncStatus: { syncScheduledAt?: any; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; recordVersion: number; lastSyncedAt?: any; error?: string; - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; }; }; }; @@ -1197,11 +1167,11 @@ export type ConsoleListProjectsQuery = { }; syncStatus: { syncScheduledAt?: any; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; recordVersion: number; lastSyncedAt?: any; error?: string; - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; }; }; }>; @@ -1265,9 +1235,9 @@ export type ConsoleListClustersQuery = { syncScheduledAt?: any; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; error?: string; - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; }; status?: { lastReconcileTime?: any; @@ -1404,11 +1374,11 @@ export type ConsoleGetClusterQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -1578,11 +1548,11 @@ export type ConsoleGetNodePoolQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -1665,11 +1635,11 @@ export type ConsoleListNodePoolsQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -1802,11 +1772,11 @@ export type ConsoleGetEnvironmentQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -1880,11 +1850,11 @@ export type ConsoleListEnvironmentsQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -2008,11 +1978,11 @@ export type ConsoleGetAppQuery = { }; syncStatus: { syncScheduledAt?: any; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; recordVersion: number; lastSyncedAt?: any; error?: string; - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; }; }; }; @@ -2052,11 +2022,11 @@ export type ConsoleListAppsQuery = { }; syncStatus: { syncScheduledAt?: any; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; recordVersion: number; lastSyncedAt?: any; error?: string; - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; }; }; }>; @@ -2166,11 +2136,11 @@ export type ConsoleListConfigsQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -2243,11 +2213,11 @@ export type ConsoleListSecretsQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -2353,7 +2323,6 @@ export type ConsoleListVpnDevicesQuery = { spec?: { accountName: string; clusterName: string; - dns?: string; ports?: Array<{ port?: number; targetPort?: number }>; }; status?: { @@ -2370,11 +2339,11 @@ export type ConsoleListVpnDevicesQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -2414,7 +2383,6 @@ export type ConsoleGetVpnDeviceQuery = { spec?: { accountName: string; clusterName: string; - dns?: string; ports?: Array<{ port?: number; targetPort?: number }>; }; status?: { @@ -2431,11 +2399,11 @@ export type ConsoleGetVpnDeviceQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; wireguardConfig?: { value: string; encoding: string }; @@ -2467,7 +2435,7 @@ export type ConsoleListInvitationsForAccountQuery = { updateTime: any; userEmail?: string; userName?: string; - userRole: Kloudlite__Io___Apps___Iam___Types__Role; + userRole: Github__Com___Kloudlite___Api___Apps___Iam___Types__Role; }>; }; @@ -2477,7 +2445,7 @@ export type ConsoleListMembershipsForAccountQueryVariables = Exact<{ export type ConsoleListMembershipsForAccountQuery = { accounts_listMembershipsForAccount?: Array<{ - role: Kloudlite__Io___Apps___Iam___Types__Role; + role: Github__Com___Kloudlite___Api___Apps___Iam___Types__Role; user: { verified: boolean; name: string; joined: any; email: string }; }>; }; @@ -2534,7 +2502,7 @@ export type ConsoleRejectInvitationMutation = { export type ConsoleUpdateAccountMembershipMutationVariables = Exact<{ accountName: Scalars['String']['input']; memberId: Scalars['ID']['input']; - role: Kloudlite__Io___Apps___Iam___Types__Role; + role: Github__Com___Kloudlite___Api___Apps___Iam___Types__Role; }>; export type ConsoleUpdateAccountMembershipMutation = { @@ -2675,19 +2643,7 @@ export type ConsoleGetManagedServiceQuery = { name: string; namespace?: string; }; - spec: { - nodeSelector?: any; - region?: string; - inputs?: { RawMessage?: any }; - msvcKind: { apiVersion: string; kind: string }; - tolerations?: Array<{ - effect?: K8s__Io___Api___Core___V1__TaintEffect; - key?: string; - operator?: K8s__Io___Api___Core___V1__TolerationOperator; - tolerationSeconds?: number; - value?: string; - }>; - }; + spec: { serviceTemplate: { apiVersion: string; kind: string; spec: any } }; status?: { checks?: any; isReady: boolean; @@ -2701,11 +2657,11 @@ export type ConsoleGetManagedServiceQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -2745,17 +2701,7 @@ export type ConsoleListManagedServicesQuery = { namespace?: string; }; spec: { - nodeSelector?: any; - region?: string; - inputs?: { RawMessage?: any }; - msvcKind: { apiVersion: string; kind: string }; - tolerations?: Array<{ - effect?: K8s__Io___Api___Core___V1__TaintEffect; - key?: string; - operator?: K8s__Io___Api___Core___V1__TolerationOperator; - tolerationSeconds?: number; - value?: string; - }>; + serviceTemplate: { apiVersion: string; kind: string; spec: any }; }; status?: { checks?: any; @@ -2770,11 +2716,11 @@ export type ConsoleListManagedServicesQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -2827,9 +2773,12 @@ export type ConsoleGetManagedResourceQuery = { namespace?: string; }; spec: { - inputs?: { RawMessage?: any }; - mresKind: { kind: string }; - msvcRef: { apiVersion: string; kind: string; name: string }; + resourceTemplate: { + apiVersion: string; + kind: string; + spec: any; + msvcRef: { name: string; kind: string; apiVersion: string }; + }; }; status?: { checks?: any; @@ -2844,11 +2793,11 @@ export type ConsoleGetManagedResourceQuery = { }>; }; syncStatus: { - action: Kloudlite__Io___Pkg___Types__SyncStatusAction; + action: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction; error?: string; lastSyncedAt?: any; recordVersion: number; - state: Kloudlite__Io___Pkg___Types__SyncStatusState; + state: Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState; syncScheduledAt?: any; }; }; @@ -2910,7 +2859,7 @@ export type ConsoleListCredQuery = { edges: Array<{ cursor: string; node: { - access: Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__RepoAccess; + access: Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__RepoAccess; accountName: string; creationTime: any; id: string; @@ -2921,7 +2870,7 @@ export type ConsoleListCredQuery = { username: string; createdBy: { userEmail: string; userId: string; userName: string }; expiration: { - unit: Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__ExpirationUnit; + unit: Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__ExpirationUnit; value: number; }; lastUpdatedBy: { userEmail: string; userId: string; userName: string }; @@ -3228,14 +3177,14 @@ export type ConsoleListBuildsQuery = { id: string; markedForDeletion?: boolean; name: string; - status: Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__BuildStatus; + status: Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__BuildStatus; updateTime: any; createdBy: { userEmail: string; userId: string; userName: string }; credUser: { userEmail: string; userId: string; userName: string }; lastUpdatedBy: { userEmail: string; userId: string; userName: string }; source: { branch: string; - provider: Kloudlite__Io___Apps___Container____Registry___Internal___Domain___Entities__GitProvider; + provider: Github__Com___Kloudlite___Api___Apps___Container____Registry___Internal___Domain___Entities__GitProvider; repository: string; webhookId?: number; }; @@ -3590,6 +3539,70 @@ export type ConsoleGetBuildRunQuery = { }; }; +export type AuthCli_GetKubeConfigQueryVariables = Exact<{ + name: Scalars['String']['input']; +}>; + +export type AuthCli_GetKubeConfigQuery = { + infra_getCluster?: { adminKubeconfig?: { encoding: string; value: string } }; +}; + +export type AuthCli_ListClustersQueryVariables = Exact<{ + pagination?: InputMaybe; +}>; + +export type AuthCli_ListClustersQuery = { + infra_listClusters?: { + edges: Array<{ node: { displayName: string; metadata: { name: string } } }>; + }; +}; + +export type AuthCli_ListAccountsQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type AuthCli_ListAccountsQuery = { + accounts_listAccounts?: Array<{ + id: string; + displayName: string; + metadata?: { name: string }; + }>; +}; + +export type AuthCli_GetCurrentUserQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type AuthCli_GetCurrentUserQuery = { + auth_me?: { id: string; email: string; name: string }; +}; + +export type AuthCli_CreateRemoteLoginMutationVariables = Exact<{ + secret?: InputMaybe; +}>; + +export type AuthCli_CreateRemoteLoginMutation = { + auth_createRemoteLogin: string; +}; + +export type AuthCli_GetRemoteLoginQueryVariables = Exact<{ + loginId: Scalars['String']['input']; + secret: Scalars['String']['input']; +}>; + +export type AuthCli_GetRemoteLoginQuery = { + auth_getRemoteLogin?: { authHeader?: string; status: string }; +}; + +export type AuthSetRemoteAuthHeaderMutationVariables = Exact<{ + loginId: Scalars['String']['input']; + authHeader?: InputMaybe; +}>; + +export type AuthSetRemoteAuthHeaderMutation = { + auth_setRemoteAuthHeader: boolean; +}; + export type AuthCheckOauthEnabledQueryVariables = Exact<{ [key: string]: never; }>; From 522f1c290742078f511e7eb31d566cb9f0fc2236 Mon Sep 17 00:00:00 2001 From: Abdhesh Nayak Date: Sun, 24 Dec 2023 02:22:00 +0530 Subject: [PATCH 3/4] :bug: Fixed bugs with typescript --- src/apps/auth/routes/_index.tsx | 2 +- src/apps/console/components/commons.tsx | 4 ++-- .../_.$account.settings.user-management/handle-user.tsx | 2 +- .../console/routes/_a.onboarding.$a.invite-team-members.tsx | 2 +- src/apps/console/server/r-utils/common.ts | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/apps/auth/routes/_index.tsx b/src/apps/auth/routes/_index.tsx index 8bf612af5..6e9f186b6 100644 --- a/src/apps/auth/routes/_index.tsx +++ b/src/apps/auth/routes/_index.tsx @@ -15,7 +15,7 @@ const restActions = async (ctx: IExtRemixCtx) => { const { data, errors } = await GQLServerHandler( ctx.request ).setRemoteAuthHeader({ - loginId: cookie.get('cliLogin'), + loginId: cookie.get('cliLogin') || '', authHeader: ctx?.request?.headers?.get('cookie'), }); diff --git a/src/apps/console/components/commons.tsx b/src/apps/console/components/commons.tsx index f4e32ac69..70e5ecdcc 100644 --- a/src/apps/console/components/commons.tsx +++ b/src/apps/console/components/commons.tsx @@ -5,8 +5,8 @@ import { WorkspacesLogo } from '~/components/branding/workspace-logo'; import useClipboard from '~/root/lib/client/hooks/use-clipboard'; import { generateKey, titleCase } from '~/components/utils'; import { - Kloudlite__Io___Pkg___Types__SyncStatusState as SyncState, - Kloudlite__Io___Pkg___Types__SyncStatusAction as SyncAction, + Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState as SyncState, + Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction as SyncAction, } from '~/root/src/generated/gql/server'; import Tooltip from '~/components/atoms/tooltip'; import { Link } from '@remix-run/react'; diff --git a/src/apps/console/routes/_.$account.settings.user-management/handle-user.tsx b/src/apps/console/routes/_.$account.settings.user-management/handle-user.tsx index 2b109580d..487e47def 100644 --- a/src/apps/console/routes/_.$account.settings.user-management/handle-user.tsx +++ b/src/apps/console/routes/_.$account.settings.user-management/handle-user.tsx @@ -8,7 +8,7 @@ import { useConsoleApi } from '~/console/server/gql/api-provider'; import useForm from '~/root/lib/client/hooks/use-form'; import Yup from '~/root/lib/server/helpers/yup'; import { handleError } from '~/root/lib/utils/common'; -import { Kloudlite__Io___Apps___Iam___Types__Role as Role } from '~/root/src/generated/gql/server'; +import { Github__Com___Kloudlite___Api___Apps___Iam___Types__Role as Role } from '~/root/src/generated/gql/server'; import { parseName } from '~/console/server/r-utils/common'; import { IAccountContext } from '../_.$account'; diff --git a/src/apps/console/routes/_a.onboarding.$a.invite-team-members.tsx b/src/apps/console/routes/_a.onboarding.$a.invite-team-members.tsx index 3cf0e7290..cfa28d76d 100644 --- a/src/apps/console/routes/_a.onboarding.$a.invite-team-members.tsx +++ b/src/apps/console/routes/_a.onboarding.$a.invite-team-members.tsx @@ -10,7 +10,7 @@ import { titleCase, useMapper } from '~/components/utils'; import useForm from '~/root/lib/client/hooks/use-form'; import Yup from '~/root/lib/server/helpers/yup'; import { handleError } from '~/root/lib/utils/common'; -import { Kloudlite__Io___Apps___Iam___Types__Role as Role } from '~/root/src/generated/gql/server'; +import { Github__Com___Kloudlite___Api___Apps___Iam___Types__Role as Role } from '~/root/src/generated/gql/server'; import { ListBody, ListItem } from '../components/console-list-components'; import DynamicPagination from '../components/dynamic-pagination'; import List from '../components/list'; diff --git a/src/apps/console/server/r-utils/common.ts b/src/apps/console/server/r-utils/common.ts index 77f537cc1..23628d569 100644 --- a/src/apps/console/server/r-utils/common.ts +++ b/src/apps/console/server/r-utils/common.ts @@ -6,8 +6,8 @@ import { Github__Com___Kloudlite___Operator___Apis___Common____Types__CloudProvider as CloudProvider, Github__Com___Kloudlite___Operator___Apis___Clusters___V1__ClusterSpecAvailabilityMode as AvailabilityMode, ProjectId, - Kloudlite__Io___Pkg___Types__SyncStatusAction as SyncStatusAction, - Kloudlite__Io___Pkg___Types__SyncStatusState as SyncStatusState, + Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusAction as SyncStatusAction, + Github__Com___Kloudlite___Api___Pkg___Types__SyncStatusState as SyncStatusState, WorkspaceOrEnvId, } from '~/root/src/generated/gql/server'; From 41d79b729e2a7cedd5989c581e1f07ee70ad5f22 Mon Sep 17 00:00:00 2001 From: Karthik Th Date: Sun, 24 Dec 2023 13:21:13 +0530 Subject: [PATCH 4/4] ts compile fixes --- .../handle-backend-resources.tsx | 25 +++++++++++-------- .../route.tsx | 4 +-- .../backend-services-resources.tsx | 4 +-- .../handle-backend-service.tsx | 17 ++++++++----- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/handle-backend-resources.tsx b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/handle-backend-resources.tsx index 752dff2c7..49b0c8639 100644 --- a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/handle-backend-resources.tsx +++ b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/handle-backend-resources.tsx @@ -103,7 +103,7 @@ const HandleBackendResources = ({ }; }, {}), }), - onSubmit: async (val) => { + onSubmit: async (_) => { try { const { errors: e } = await api.createManagedResource({ mres: { @@ -113,17 +113,20 @@ const HandleBackendResources = ({ namespace: parseTargetNs(workspace), }, spec: { - mresKind: { - kind: selectedType?.resource.kind || '', - }, - msvcRef: { - apiVersion: template.apiVersion || '', - name: parseName(backendService), - kind: template.kind!, - }, - inputs: { - ...val, + resourceTemplate: { + spec: ``, + msvcRef: { + apiVersion: template.apiVersion || '', + name: parseName(backendService), + kind: template.kind!, + }, }, + // mresKind: { + // kind: selectedType?.resource.kind || '', + // }, + // inputs: { + // ...val, + // }, }, }, }); diff --git a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/route.tsx b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/route.tsx index e9d348d7e..ef1bc3d43 100644 --- a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/route.tsx +++ b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-service.$service.resources/route.tsx @@ -120,8 +120,8 @@ const BackingResources = () => { template={ getManagedTemplate({ templates: managedTemplates, - kind: backendService.spec.msvcKind.kind || '', - apiVersion: backendService.spec.msvcKind.apiVersion, + kind: backendService.spec.serviceTemplate.kind || '', + apiVersion: backendService.spec.serviceTemplate.apiVersion, })! } setShow={setShowBackendResourceDialog} diff --git a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/backend-services-resources.tsx b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/backend-services-resources.tsx index bd079f5d3..4b7a6f0d8 100644 --- a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/backend-services-resources.tsx +++ b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/backend-services-resources.tsx @@ -30,8 +30,8 @@ const parseItem = ( ) => { const template = getManagedTemplate({ templates, - kind: item.spec.msvcKind.kind || '', - apiVersion: item.spec.msvcKind.apiVersion, + kind: item.spec.serviceTemplate.kind || '', + apiVersion: item.spec.serviceTemplate.apiVersion, }); return { name: item?.displayName, diff --git a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/handle-backend-service.tsx b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/handle-backend-service.tsx index 05cf0c34c..e5454cbb1 100644 --- a/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/handle-backend-service.tsx +++ b/src/apps/console/routes/_.$account.$cluster.$project.$scope.$workspace.backing-services/handle-backend-service.tsx @@ -325,13 +325,18 @@ const HandleBackendService = ({ annotations: {}, }, spec: { - msvcKind: { - apiVersion: selectedService?.service.apiVersion || '', - kind: selectedService?.service.kind || '', - }, - inputs: { - ...tempVal, + serviceTemplate: { + spec: { + ...tempVal, + }, }, + // msvcKind: { + // apiVersion: selectedService?.service.apiVersion || '', + // kind: selectedService?.service.kind || '', + // }, + // inputs: { + // ...tempVal, + // }, }, }, });