| [ | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "204916b9-c6bb-4df0-a937-05b34a2aed2f", | |
| "name": "vite.config.ts", | |
| "imports": "[{'import_name': ['defineConfig'], 'import_path': 'vite'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/vite.config.ts", | |
| "code": "import { defineConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react-swc\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\n\n// https://vitejs.dev/config/\nexport default defineConfig((_env) => {\n return {\n plugins: [tsconfigPaths(), react()],\n server: {\n proxy: {\n \"/agent/api/v1\": {\n target: \"http://172.17.0.3:3333\",\n changeOrigin: true,\n rewrite: (path): string => path.replace(/^\\/agent/, \"\"),\n },\n },\n },\n };\n});\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "583f0ba4-2f3d-445b-9fb9-768f8b48e128", | |
| "name": "vite-env.d.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/@types/vite-env.d.ts", | |
| "code": "/// <reference types=\"vite/client\" />\n\ninterface ImportMetaEnv {\n readonly VITE_AGENT_BASEPATH: string;\n // Add other env variables here\n}\n\ninterface ImportMeta {\n readonly env: ImportMetaEnv;\n}\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "9ffcdba3-7983-49df-9e16-f2d94a0935e4", | |
| "name": "AbortSignal.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/common/AbortSignal.ts", | |
| "code": "export function newAbortSignal(\n delay?: number,\n abortMessage?: string\n): AbortSignal {\n const abortController = new AbortController();\n const signal = abortController.signal;\n\n if (delay) {\n window.setTimeout(() => {\n abortController.abort(abortMessage);\n }, delay);\n }\n\n return signal;\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "2f3b4474-196b-477b-a194-55bc34b3f4b2", | |
| "name": "newAbortSignal", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/common/AbortSignal.ts", | |
| "code": "function newAbortSignal(\n delay?: number,\n abortMessage?: string\n): AbortSignal {\n const abortController = new AbortController();\n const signal = abortController.signal;\n\n if (delay) {\n window.setTimeout(() => {\n abortController.abort(abortMessage);\n }, delay);\n }\n\n return signal;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "00061496-0d24-4a42-8ffd-590c36e6c394", | |
| "name": "AgentUIVersion.tsx", | |
| "imports": "[{'import_name': ['useState', 'useEffect'], 'import_path': 'react'}, {'import_name': ['AgentApiInterface'], 'import_path': '@migration-planner-ui/agent-client/apis'}, {'import_name': ['useInjection'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['Symbols'], 'import_path': '#/main/Symbols'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/common/AgentUIVersion.tsx", | |
| "code": "import React, { useState, useEffect } from 'react';\nimport type { AgentApiInterface } from \"@migration-planner-ui/agent-client/apis\";\nimport { useInjection } from '@migration-planner-ui/ioc';\nimport { Symbols } from '#/main/Symbols';\n\nexport const AgentUIVersion: React.FC = () => {\n const agentApi = useInjection<AgentApiInterface>(Symbols.AgentApi);\n const [versionInfo, setVersionInfo] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n const fetchVersion = async ():Promise<void> => {\n try {\n const statusReply = await agentApi.getAgentVersion();\n setVersionInfo(statusReply);\n } catch (err) {\n console.error('Error fetching agent version:', err);\n setError('Error fetching version');\n }\n };\n\n fetchVersion();\n }, [agentApi]);\n\n if (error) {\n return <div data-testid=\"agent-api-lib-version\" hidden>Error: {error}</div>;\n }\n\n if (!versionInfo) {\n return <div data-testid=\"agent-api-lib-version\" hidden>Loading...</div>;\n }\n\n return (\n <div data-testid=\"agent-api-lib-version\" hidden> \n {versionInfo}\n </div>\n );\n};" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ccb5eaf9-b7ca-4cc8-8516-ed9cfd92f44f", | |
| "name": "AgentUIVersion", | |
| "imports": "[{'import_name': ['useState', 'useEffect'], 'import_path': 'react'}, {'import_name': ['AgentApiInterface'], 'import_path': '@migration-planner-ui/agent-client/apis'}, {'import_name': ['useInjection'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['Symbols'], 'import_path': '#/main/Symbols'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/common/AgentUIVersion.tsx", | |
| "code": "AgentUIVersion: React.FC = () => {\n const agentApi = useInjection<AgentApiInterface>(Symbols.AgentApi);\n const [versionInfo, setVersionInfo] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n const fetchVersion = async ():Promise<void> => {\n try {\n const statusReply = await agentApi.getAgentVersion();\n setVersionInfo(statusReply);\n } catch (err) {\n console.error('Error fetching agent version:', err);\n setError('Error fetching version');\n }\n };\n\n fetchVersion();\n }, [agentApi]);\n\n if (error) {\n return <div data-testid=\"agent-api-lib-version\" hidden>Error: {error}</div>;\n }\n\n if (!versionInfo) {\n return <div data-testid=\"agent-api-lib-version\" hidden>Loading...</div>;\n }\n\n return (\n <div data-testid=\"agent-api-lib-version\" hidden> \n {versionInfo}\n </div>\n );\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "e95af887-9182-4b1e-90eb-72de9aa68059", | |
| "name": "Time.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/common/Time.ts", | |
| "code": "export type Duration = number;\n\nexport const enum Time {\n Millisecond = 1,\n Second = 1000 * Millisecond,\n Minute = 60 * Second,\n Hour = 60 * Minute,\n Day = 24 * Hour,\n Week = 7 * Day,\n}\n\nexport const sleep = (delayMs: Duration): Promise<void> =>\n new Promise((resolve) => {\n setTimeout(resolve, delayMs);\n });\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "71472f02-2f2a-407a-a208-4e8e29a9bf7c", | |
| "name": "sleep", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/common/Time.ts", | |
| "code": "sleep = (delayMs: Duration): Promise<void> =>\n new Promise((resolve) => {\n setTimeout(resolve, delayMs);\n })", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "be561bfa-7f0c-42a1-b79d-32a5b082d5fd", | |
| "name": "Aliases.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/login-form/Aliases.ts", | |
| "code": "export type FormControlValidatedStateVariant =\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"default\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "59eeeae1-fd4d-49ff-8476-7bf8d32faf85", | |
| "name": "Constants.ts", | |
| "imports": "[{'import_name': ['Time'], 'import_path': '#/common/Time'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/login-form/Constants.ts", | |
| "code": "import { Time } from \"#/common/Time\";\n\nexport const DATA_SHARING_ALLOWED_DEFAULT_STATE = true;\nexport const REQUEST_TIMEOUT_SECONDS = 30 * Time.Second;\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "da905da2-d184-480f-830e-bf4ffb621ffe", | |
| "name": "FormStates.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/login-form/FormStates.ts", | |
| "code": "export const enum FormStates {\n CheckingStatus = \"checkingStatus\",\n WaitingForCredentials = \"waitingForCredentials\",\n Submitting = \"submitting\",\n CredentialsAccepted = \"credentialsAccepted\",\n CredentialsRejected = \"credentialsRejected\",\n InvalidCredentials = \"invalidCredentials\",\n GatheringInventory = \"gatheringInventory\"\n}\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "16423ce3-8b8e-42b5-89f8-7f303ae310cb", | |
| "name": "LoginForm.tsx", | |
| "imports": "[{'import_name': ['Alert', 'AlertActionLink', 'Button', 'Card', 'CardBody', 'CardFooter', 'CardHeader', 'Checkbox', 'Form', 'FormGroup', 'FormHelperText', 'HelperText', 'HelperTextItem', 'List', 'ListItem', 'Text', 'TextContent', 'TextInput', 'Spinner', 'SplitItem', 'Split', 'Icon', 'Divider'], 'import_path': '@patternfly/react-core'}, {'import_name': ['LoginFormViewModelInterface'], 'import_path': './hooks/UseViewModel'}, {'import_name': ['FormStates'], 'import_path': './FormStates'}, {'import_name': ['CheckCircleIcon', 'InfoCircleIcon'], 'import_path': '@patternfly/react-icons'}, {'import_name': ['getConfigurationBasePath'], 'import_path': '#/main/Root'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/login-form/LoginForm.tsx", | |
| "code": "import React from \"react\";\nimport {\n Alert,\n AlertActionLink,\n Button,\n Card,\n CardBody,\n CardFooter,\n CardHeader,\n Checkbox,\n Form,\n FormGroup,\n FormHelperText,\n HelperText,\n HelperTextItem,\n List,\n ListItem,\n Text,\n TextContent,\n TextInput,\n Spinner,\n SplitItem,\n Split,\n Icon,\n Divider,\n} from \"@patternfly/react-core\";\nimport { LoginFormViewModelInterface } from \"./hooks/UseViewModel\";\nimport { FormStates } from \"./FormStates\";\nimport {\n CheckCircleIcon,\n InfoCircleIcon\n} from \"@patternfly/react-icons\";\nimport { getConfigurationBasePath } from \"#/main/Root\";\nimport globalSuccessColor100 from \"@patternfly/react-tokens/dist/esm/global_success_color_100\";\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LoginForm {\n export type Props = {\n vm: LoginFormViewModelInterface;\n };\n}\n\nexport const LoginForm: React.FC<LoginForm.Props> = (props) => {\n const { vm } = props;\n console.log(vm.formState);\n return (\n <Card\n style={{ width: \"36rem\" }}\n isFlat\n isRounded\n aria-labelledby=\"card-header-title\"\n aria-describedby=\"card-body-description\"\n >\n <CardHeader id=\"card-header-title\">\n <TextContent>\n <Text component=\"h2\">Migration Discovery VM</Text>\n <Text>\n The migration discovery VM requires access to your VMware\n environment to execute a discovery process that gathers essential\n data, including network topology, storage configuration, and VM\n inventory. The process leverages this information to provide\n recommendations for a seamless migration to OpenShift\n Virtualization.\n </Text>\n </TextContent>\n </CardHeader>\n\n <Divider style={{ backgroundColor: \"#f5f5f5\", height: \"10px\", border: \"none\" }} />\n\n <CardBody id=\"card-body-note\" style={{ backgroundColor: \"#ffffff\", border: \"1px solid #d2d2d2\", padding: \"1rem\" }}>\n <TextContent style={{ display: \"flex\", alignItems: \"center\", gap: \"0.5rem\" }}>\n <InfoCircleIcon color=\"#007bff\" />\n <Text component=\"p\" style={{ color: \"#002952\", fontWeight: \"bold\" }}>\n Access control\n </Text>\n </TextContent>\n <Text component=\"p\" style={{ marginTop: \"0.5rem\", marginLeft: \"1.5rem\" }}>\n To ensure secure access during the discovery process, we recommend creating a dedicated VMware user account with read-only permissions.\n </Text>\n </CardBody>\n\n <Divider style={{ backgroundColor: \"#f5f5f5\", height: \"10px\", border: \"none\" }} />\n\n <CardBody\n id=\"card-body-description\"\n \n >\n <Form ref={vm.formRef} onSubmit={vm.handleSubmit} id=\"login-form\">\n <FormGroup\n label=\"Environment URL\"\n isRequired\n fieldId=\"url-form-control\"\n hidden={\n vm.formState === FormStates.GatheringInventory ||\n vm.formState === FormStates.CredentialsAccepted\n }\n >\n <TextInput\n validated={vm.urlControlStateVariant}\n isDisabled={vm.shouldDisableFormControl}\n id=\"url-form-control\"\n type=\"url\"\n name=\"url\"\n isRequired\n placeholder=\"https://vcenter_server_ip_address_or_fqdn\"\n pattern=\"https://.*\"\n aria-describedby=\"url-helper-text\"\n />\n {vm.urlControlHelperText && (\n <FormHelperText>\n <HelperText>\n <HelperTextItem\n variant={vm.urlControlStateVariant}\n id=\"url-helper-text\"\n >\n {vm.urlControlHelperText}\n </HelperTextItem>\n </HelperText>\n </FormHelperText>\n )}\n </FormGroup>\n\n <FormGroup\n label=\"VMware Username\"\n isRequired\n fieldId=\"username-form-control\"\n hidden={\n vm.formState === FormStates.GatheringInventory ||\n vm.formState === FormStates.CredentialsAccepted\n }\n >\n <TextInput\n validated={vm.usernameControlStateVariant}\n isDisabled={vm.shouldDisableFormControl}\n id=\"username-form-control\"\n type=\"email\"\n name=\"username\"\n isRequired\n placeholder=\"su.do@redhat.com\"\n aria-describedby=\"username-helper-text\"\n />\n {vm.usernameControlHelperText && (\n <FormHelperText>\n <HelperText>\n <HelperTextItem\n variant={vm.usernameControlStateVariant}\n id=\"username-helper-text\"\n >\n {vm.usernameControlHelperText}\n </HelperTextItem>\n </HelperText>\n </FormHelperText>\n )}\n </FormGroup>\n\n <FormGroup\n label=\"Password\"\n isRequired\n fieldId=\"password-form-control\"\n hidden={\n vm.formState === FormStates.GatheringInventory ||\n vm.formState === FormStates.CredentialsAccepted\n }\n >\n <TextInput\n validated={vm.passwordControlStateVariant}\n isDisabled={vm.shouldDisableFormControl}\n id=\"password-form-control\"\n type=\"password\"\n name=\"password\"\n isRequired\n aria-describedby=\"password-helper-text\"\n />\n {vm.passwordControlHelperText && vm.passwordControlHelperText && (\n <FormHelperText>\n <HelperText>\n <HelperTextItem\n variant={vm.passwordControlStateVariant}\n id=\"password-helper-text\"\n >\n {vm.passwordControlHelperText}\n </HelperTextItem>\n </HelperText>\n </FormHelperText>\n )}\n </FormGroup>\n\n <FormGroup fieldId=\"checkbox-form-control\" hidden={\n vm.formState === FormStates.GatheringInventory ||\n vm.formState === FormStates.CredentialsAccepted\n }>\n <Checkbox\n isDisabled={vm.shouldDisableFormControl}\n id=\"checkbox-form-control\"\n name=\"isDataSharingAllowed\"\n label=\"I agree to share aggregated data about my environment with Red Hat.\"\n aria-label=\"Share aggregated data\"\n onChange={(_event,checked)=>vm.handleChangeDataSharingAllowed(checked)}\n isChecked={vm.isDataSharingChecked}\n />\n </FormGroup>\n \n {vm.shouldDisplayAlert && (\n <FormGroup>\n <Alert\n isInline\n variant={vm.alertVariant}\n title={vm.alertTitle}\n actionLinks={\n <AlertActionLink component=\"a\" href=\"#\">\n {vm.alertActionLinkText}\n </AlertActionLink>\n }\n >\n {vm.alertDescriptionList &&\n vm.alertDescriptionList.length > 0 && (\n <List>\n {vm.alertDescriptionList.map(({ id, text }) => (\n <ListItem key={id}>{text}</ListItem>\n ))}\n </List>\n )}\n </Alert>\n </FormGroup>\n )}\n </Form>\n </CardBody>\n\n <CardBody\n id=\"card-body-discovery-status\"\n hidden={\n vm.formState !== FormStates.GatheringInventory &&\n vm.formState !== FormStates.CredentialsAccepted\n }\n >\n {vm.formState === FormStates.GatheringInventory && (\n <Text component=\"p\" style={{ textAlign: \"center\" }}>\n <Icon size=\"xl\" >\n <Spinner />\n </Icon>\n <br/>Gathering inventory...\n </Text>\n \n )}\n {vm.formState === FormStates.CredentialsAccepted && (\n <Text component=\"p\" style={{ textAlign: \"center\" }}>\n <Icon size=\"xl\" isInline>\n <CheckCircleIcon color={globalSuccessColor100.value} />\n </Icon>\n <br/>Discovery completed\n </Text>\n \n )}\n </CardBody>\n <CardFooter>\n <Split style={{ alignItems: \"flex-end\" }}>\n <SplitItem>\n {vm.formState !== FormStates.CredentialsAccepted && vm.formState !== FormStates.GatheringInventory && (\n <Button\n type=\"submit\"\n variant=\"primary\"\n isDisabled={vm.shouldDisableFormControl || !vm.isDataSharingChecked}\n form=\"login-form\"\n >\n Log in\n </Button>)}\n {(vm.formState === FormStates.CredentialsAccepted || vm.formState === FormStates.GatheringInventory) && (\n <>\n <Button\n variant=\"primary\"\n onClick={vm.handleReturnToAssistedMigration}\n style={{ marginLeft: \"16px\" }}\n >\n Go back to assessment wizard\n </Button>\n <Button\n variant=\"secondary\"\n onClick={() => window.open(getConfigurationBasePath() + \"/inventory\", \"_blank\")}\n style={{ marginLeft: \"16px\" }}\n >\n Download Inventory\n </Button>\n </>\n )}\n </SplitItem>\n <SplitItem isFilled></SplitItem>\n <SplitItem style={{ paddingRight: \"2rem\" }}>\n {vm.formState === FormStates.CheckingStatus && (\n <TextContent>\n <Text component=\"p\">\n <Spinner isInline /> Checking status...\n </Text>\n </TextContent>\n )}\n </SplitItem>\n </Split>\n </CardFooter>\n </Card>\n );\n};\n\nLoginForm.displayName = \"LoginForm\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "eabece8e-2c25-48b2-bb14-2e0dd65935c4", | |
| "name": "UseViewModel.ts", | |
| "imports": "[{'import_name': ['useState', 'useRef', 'useCallback', 'useMemo'], 'import_path': 'react'}, {'import_name': ['useAsync', 'useMount', 'useTitle'], 'import_path': 'react-use'}, {'import_name': ['useNavigate'], 'import_path': 'react-router-dom'}, {'import_name': ['AlertVariant'], 'import_path': '@patternfly/react-core'}, {'import_name': ['SourceStatus', 'Credentials'], 'import_path': '@migration-planner-ui/agent-client/models'}, {'import_name': ['AgentApiInterface'], 'import_path': '@migration-planner-ui/agent-client/apis'}, {'import_name': ['useInjection'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['newAbortSignal'], 'import_path': '#/common/AbortSignal'}, {'import_name': ['DATA_SHARING_ALLOWED_DEFAULT_STATE', 'REQUEST_TIMEOUT_SECONDS'], 'import_path': '#/login-form/Constants'}, {'import_name': ['FormStates'], 'import_path': '#/login-form/FormStates'}, {'import_name': ['FormControlValidatedStateVariant'], 'import_path': '#/login-form/Aliases'}, {'import_name': ['Symbols'], 'import_path': '#/main/Symbols'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/login-form/hooks/UseViewModel.ts", | |
| "code": "import { useState, useRef, useCallback, useMemo } from \"react\";\nimport { useAsync, useMount, useTitle } from \"react-use\";\nimport { useNavigate } from \"react-router-dom\";\nimport { AlertVariant } from \"@patternfly/react-core\";\nimport {\n SourceStatus,\n type Credentials,\n} from \"@migration-planner-ui/agent-client/models\";\nimport type { AgentApiInterface } from \"@migration-planner-ui/agent-client/apis\";\nimport { useInjection } from \"@migration-planner-ui/ioc\";\nimport { newAbortSignal } from \"#/common/AbortSignal\";\nimport {\n DATA_SHARING_ALLOWED_DEFAULT_STATE,\n REQUEST_TIMEOUT_SECONDS,\n} from \"#/login-form/Constants\";\nimport { FormStates } from \"#/login-form/FormStates\";\nimport { FormControlValidatedStateVariant } from \"#/login-form/Aliases\";\nimport { Symbols } from \"#/main/Symbols\";\n\nexport interface LoginFormViewModelInterface {\n formState: FormStates;\n formRef: React.MutableRefObject<HTMLFormElement | undefined>;\n urlControlStateVariant: FormControlValidatedStateVariant;\n urlControlHelperText?: string;\n usernameControlStateVariant: FormControlValidatedStateVariant;\n usernameControlHelperText?: string;\n passwordControlStateVariant: FormControlValidatedStateVariant;\n passwordControlHelperText?: string;\n shouldDisableFormControl: boolean;\n alertVariant?: AlertVariant;\n alertTitle?: string;\n alertDescriptionList?: Array<{ id: number; text: string }>;\n alertActionLinkText?: string;\n shouldDisplayAlert: boolean;\n handleSubmit: React.FormEventHandler<HTMLFormElement>;\n handleReturnToAssistedMigration: () => void;\n handleChangeDataSharingAllowed: (checked:boolean)=>void;\n isDataSharingChecked: boolean;\n}\n\nconst _computeFormControlVariant = (\n formState: FormStates\n): FormControlValidatedStateVariant => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return \"success\";\n case FormStates.InvalidCredentials:\n case FormStates.CredentialsRejected:\n return \"error\";\n default:\n return \"default\";\n }\n};\n\nexport const useViewModel = (): LoginFormViewModelInterface => {\n useTitle(\"Login\");\n const navigateTo = useNavigate();\n const [formState, setFormState] = useState<FormStates>(\n FormStates.CheckingStatus\n );\n const formRef = useRef<HTMLFormElement>();\n const agentApi = useInjection<AgentApiInterface>(Symbols.AgentApi);\n const [isDataSharingAllowed,setIsDataSharingAllowed] = useState<boolean>(DATA_SHARING_ALLOWED_DEFAULT_STATE);\n\n useMount(() => {\n const form = formRef.current;\n if (!form) {\n return;\n }\n\n form[\"isDataSharingAllowed\"].checked = isDataSharingAllowed;\n });\n\n useAsync(async () => {\n const res = await agentApi.getStatus();\n switch (res.status) {\n case SourceStatus.SourceStatusWaitingForCredentials:\n setFormState(FormStates.WaitingForCredentials);\n break;\n case SourceStatus.SourceStatusGatheringInitialInventory:\n setFormState(FormStates.GatheringInventory);\n break;\n case SourceStatus.SourceStatusUpToDate:\n setFormState(FormStates.CredentialsAccepted);\n break;\n\n default:\n break;\n }\n });\n\n return {\n formState,\n formRef,\n urlControlStateVariant: useMemo<FormControlValidatedStateVariant>(() => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return \"success\";\n case FormStates.InvalidCredentials:\n return \"success\";\n case FormStates.CredentialsRejected:\n return \"error\";\n default:\n return \"default\";\n }\n }, [formState]),\n usernameControlStateVariant: _computeFormControlVariant(formState),\n passwordControlStateVariant: _computeFormControlVariant(formState),\n shouldDisableFormControl: useMemo(\n () =>\n [\n FormStates.CheckingStatus,\n FormStates.Submitting,\n FormStates.CredentialsAccepted,\n ].includes(formState),\n [formState]\n ),\n alertVariant: useMemo(() => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return AlertVariant.success;\n case FormStates.InvalidCredentials:\n case FormStates.CredentialsRejected:\n return AlertVariant.danger;\n }\n }, [formState]),\n alertTitle: useMemo(() => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return \"Connected\";\n case FormStates.InvalidCredentials:\n return \"Invalid Credentials\";\n case FormStates.CredentialsRejected:\n return \"Error\";\n }\n }, [formState]),\n alertDescriptionList: useMemo(() => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return [\n {\n id: 1,\n text: \"The migration discovery VM is connected to your VMware environment\",\n },\n ];\n case FormStates.InvalidCredentials:\n return [\n { id: 1, text: \"Please double-check your entry for any typos.\" },\n {\n id: 2,\n text: \"Verify your account has not been temporarily locked for security reasons.\",\n },\n ];\n case FormStates.CredentialsRejected:\n return [\n {\n id: 1,\n text: \"Please double-check the URL is correct and reachable from within the VM.\",\n },\n ];\n }\n }, [formState]),\n shouldDisplayAlert: useMemo(\n () =>\n ![\n FormStates.CheckingStatus,\n FormStates.WaitingForCredentials,\n FormStates.Submitting,\n FormStates.GatheringInventory\n ].includes(formState),\n [formState]\n ),\n handleSubmit: useCallback<React.FormEventHandler<HTMLFormElement>>(\n async (event) => {\n event.preventDefault();\n const form = formRef.current;\n if (!form) {\n return;\n }\n\n const ok = form.reportValidity();\n if (ok) {\n setFormState(FormStates.Submitting);\n } else {\n return;\n }\n\n const credentials: Credentials = {\n url: form[\"url\"].value,\n username: form[\"username\"].value,\n password: form[\"password\"].value,\n isDataSharingAllowed: form[\"isDataSharingAllowed\"].checked,\n };\n const signal = newAbortSignal(\n REQUEST_TIMEOUT_SECONDS,\n \"The server didn't respond in a timely fashion.\"\n );\n const [statusCodeOK, error] = await agentApi.putCredentials(\n credentials,\n {\n signal,\n }\n );\n\n const status = statusCodeOK ?? error.code;\n switch (status) {\n case 204:\n setFormState(FormStates.CredentialsAccepted);\n break;\n case 400:\n setFormState(FormStates.CredentialsRejected);\n break;\n case 401:\n setFormState(FormStates.InvalidCredentials);\n break;\n case 422:\n setFormState(FormStates.CredentialsRejected);\n break;\n default:\n navigateTo(`/error/${error!.code}`, {\n state: { message: error!.message },\n });\n break;\n }\n },\n [agentApi, navigateTo]\n ),\n handleReturnToAssistedMigration: useCallback(async () => {\n const serviceUrl = await agentApi.getServiceUiUrl() || \"http://localhost:3000/migrate/wizard\";\n window.open(serviceUrl, '_blank', 'noopener,noreferrer');\n }, []),\n handleChangeDataSharingAllowed: useCallback((checked)=>{\n console.log(checked);\n setIsDataSharingAllowed(checked);\n },[]),\n isDataSharingChecked: isDataSharingAllowed\n };\n};\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "0fcdb6d5-2259-4a98-87f4-f975ea4ac4f7", | |
| "name": "_computeFormControlVariant", | |
| "imports": "[{'import_name': ['Credentials'], 'import_path': '@migration-planner-ui/agent-client/models'}, {'import_name': ['FormStates'], 'import_path': '#/login-form/FormStates'}, {'import_name': ['FormControlValidatedStateVariant'], 'import_path': '#/login-form/Aliases'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/login-form/hooks/UseViewModel.ts", | |
| "code": "_computeFormControlVariant = (\n formState: FormStates\n): FormControlValidatedStateVariant => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return \"success\";\n case FormStates.InvalidCredentials:\n case FormStates.CredentialsRejected:\n return \"error\";\n default:\n return \"default\";\n }\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "e2593dcd-b962-4fc7-85ca-502f24d21a88", | |
| "name": "useViewModel", | |
| "imports": "[{'import_name': ['useState', 'useRef', 'useCallback', 'useMemo'], 'import_path': 'react'}, {'import_name': ['useAsync', 'useMount', 'useTitle'], 'import_path': 'react-use'}, {'import_name': ['useNavigate'], 'import_path': 'react-router-dom'}, {'import_name': ['AlertVariant'], 'import_path': '@patternfly/react-core'}, {'import_name': ['SourceStatus', 'Credentials'], 'import_path': '@migration-planner-ui/agent-client/models'}, {'import_name': ['AgentApiInterface'], 'import_path': '@migration-planner-ui/agent-client/apis'}, {'import_name': ['useInjection'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['newAbortSignal'], 'import_path': '#/common/AbortSignal'}, {'import_name': ['DATA_SHARING_ALLOWED_DEFAULT_STATE', 'REQUEST_TIMEOUT_SECONDS'], 'import_path': '#/login-form/Constants'}, {'import_name': ['FormStates'], 'import_path': '#/login-form/FormStates'}, {'import_name': ['FormControlValidatedStateVariant'], 'import_path': '#/login-form/Aliases'}, {'import_name': ['Symbols'], 'import_path': '#/main/Symbols'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/login-form/hooks/UseViewModel.ts", | |
| "code": "useViewModel = (): LoginFormViewModelInterface => {\n useTitle(\"Login\");\n const navigateTo = useNavigate();\n const [formState, setFormState] = useState<FormStates>(\n FormStates.CheckingStatus\n );\n const formRef = useRef<HTMLFormElement>();\n const agentApi = useInjection<AgentApiInterface>(Symbols.AgentApi);\n const [isDataSharingAllowed,setIsDataSharingAllowed] = useState<boolean>(DATA_SHARING_ALLOWED_DEFAULT_STATE);\n\n useMount(() => {\n const form = formRef.current;\n if (!form) {\n return;\n }\n\n form[\"isDataSharingAllowed\"].checked = isDataSharingAllowed;\n });\n\n useAsync(async () => {\n const res = await agentApi.getStatus();\n switch (res.status) {\n case SourceStatus.SourceStatusWaitingForCredentials:\n setFormState(FormStates.WaitingForCredentials);\n break;\n case SourceStatus.SourceStatusGatheringInitialInventory:\n setFormState(FormStates.GatheringInventory);\n break;\n case SourceStatus.SourceStatusUpToDate:\n setFormState(FormStates.CredentialsAccepted);\n break;\n\n default:\n break;\n }\n });\n\n return {\n formState,\n formRef,\n urlControlStateVariant: useMemo<FormControlValidatedStateVariant>(() => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return \"success\";\n case FormStates.InvalidCredentials:\n return \"success\";\n case FormStates.CredentialsRejected:\n return \"error\";\n default:\n return \"default\";\n }\n }, [formState]),\n usernameControlStateVariant: _computeFormControlVariant(formState),\n passwordControlStateVariant: _computeFormControlVariant(formState),\n shouldDisableFormControl: useMemo(\n () =>\n [\n FormStates.CheckingStatus,\n FormStates.Submitting,\n FormStates.CredentialsAccepted,\n ].includes(formState),\n [formState]\n ),\n alertVariant: useMemo(() => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return AlertVariant.success;\n case FormStates.InvalidCredentials:\n case FormStates.CredentialsRejected:\n return AlertVariant.danger;\n }\n }, [formState]),\n alertTitle: useMemo(() => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return \"Connected\";\n case FormStates.InvalidCredentials:\n return \"Invalid Credentials\";\n case FormStates.CredentialsRejected:\n return \"Error\";\n }\n }, [formState]),\n alertDescriptionList: useMemo(() => {\n switch (formState) {\n case FormStates.CredentialsAccepted:\n return [\n {\n id: 1,\n text: \"The migration discovery VM is connected to your VMware environment\",\n },\n ];\n case FormStates.InvalidCredentials:\n return [\n { id: 1, text: \"Please double-check your entry for any typos.\" },\n {\n id: 2,\n text: \"Verify your account has not been temporarily locked for security reasons.\",\n },\n ];\n case FormStates.CredentialsRejected:\n return [\n {\n id: 1,\n text: \"Please double-check the URL is correct and reachable from within the VM.\",\n },\n ];\n }\n }, [formState]),\n shouldDisplayAlert: useMemo(\n () =>\n ![\n FormStates.CheckingStatus,\n FormStates.WaitingForCredentials,\n FormStates.Submitting,\n FormStates.GatheringInventory\n ].includes(formState),\n [formState]\n ),\n handleSubmit: useCallback<React.FormEventHandler<HTMLFormElement>>(\n async (event) => {\n event.preventDefault();\n const form = formRef.current;\n if (!form) {\n return;\n }\n\n const ok = form.reportValidity();\n if (ok) {\n setFormState(FormStates.Submitting);\n } else {\n return;\n }\n\n const credentials: Credentials = {\n url: form[\"url\"].value,\n username: form[\"username\"].value,\n password: form[\"password\"].value,\n isDataSharingAllowed: form[\"isDataSharingAllowed\"].checked,\n };\n const signal = newAbortSignal(\n REQUEST_TIMEOUT_SECONDS,\n \"The server didn't respond in a timely fashion.\"\n );\n const [statusCodeOK, error] = await agentApi.putCredentials(\n credentials,\n {\n signal,\n }\n );\n\n const status = statusCodeOK ?? error.code;\n switch (status) {\n case 204:\n setFormState(FormStates.CredentialsAccepted);\n break;\n case 400:\n setFormState(FormStates.CredentialsRejected);\n break;\n case 401:\n setFormState(FormStates.InvalidCredentials);\n break;\n case 422:\n setFormState(FormStates.CredentialsRejected);\n break;\n default:\n navigateTo(`/error/${error!.code}`, {\n state: { message: error!.message },\n });\n break;\n }\n },\n [agentApi, navigateTo]\n ),\n handleReturnToAssistedMigration: useCallback(async () => {\n const serviceUrl = await agentApi.getServiceUiUrl() || \"http://localhost:3000/migrate/wizard\";\n window.open(serviceUrl, '_blank', 'noopener,noreferrer');\n }, []),\n handleChangeDataSharingAllowed: useCallback((checked)=>{\n console.log(checked);\n setIsDataSharingAllowed(checked);\n },[]),\n isDataSharingChecked: isDataSharingAllowed\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d7dc47cc-7d42-4360-9839-895581049397", | |
| "name": "Root.tsx", | |
| "imports": "[{'import_name': ['RouterProvider'], 'import_path': 'react-router-dom'}, {'import_name': ['Configuration'], 'import_path': '@migration-planner-ui/api-client/runtime'}, {'import_name': ['AgentApi'], 'import_path': '@migration-planner-ui/agent-client/apis'}, {'import_name': ['Spinner'], 'import_path': '@patternfly/react-core'}, {'import_name': ['Container', 'Provider', 'DependencyInjectionProvider'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['router'], 'import_path': './Router'}, {'import_name': ['Symbols'], 'import_path': './Symbols'}, {'import_name': ['AgentUIVersion'], 'import_path': '#/common/AgentUIVersion'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/main/Root.tsx", | |
| "code": "import \"@patternfly/react-core/dist/styles/base.css\";\n\nimport React from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport { RouterProvider } from \"react-router-dom\";\nimport { Configuration } from \"@migration-planner-ui/api-client/runtime\";\nimport { AgentApi } from \"@migration-planner-ui/agent-client/apis\";\nimport { Spinner } from \"@patternfly/react-core\";\nimport {\n Container,\n Provider as DependencyInjectionProvider,\n} from \"@migration-planner-ui/ioc\";\nimport { router } from \"./Router\";\nimport { Symbols } from \"./Symbols\";\nimport { AgentUIVersion } from \"#/common/AgentUIVersion\";\n\nexport const getConfigurationBasePath = (): string => {\n if (import.meta.env.PROD) {\n return `${window.location.origin}/api/v1`;\n }\n\n return `${window.location.origin}/agent/api/v1`;\n};\n\nfunction getConfiguredContainer(): Container {\n const agentApiConfig = new Configuration({\n basePath: getConfigurationBasePath(),\n });\n const container = new Container();\n container.register(Symbols.AgentApi, new AgentApi(agentApiConfig));\n\n return container;\n}\n\nfunction main(): void {\n const root = document.getElementById(\"root\");\n if (root) {\n root.style.height = \"inherit\";\n const container = getConfiguredContainer();\n ReactDOM.createRoot(root).render(\n <React.StrictMode>\n <DependencyInjectionProvider container={container}>\n <React.Suspense fallback={<Spinner />}>\n <AgentUIVersion />\n <RouterProvider router={router} />\n </React.Suspense>\n </DependencyInjectionProvider>\n </React.StrictMode>\n );\n }\n}\n\nmain();\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "8fec76a1-132a-4504-a30b-0f294a548d68", | |
| "name": "getConfigurationBasePath", | |
| "imports": "[{'import_name': ['Configuration'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/main/Root.tsx", | |
| "code": "getConfigurationBasePath = (): string => {\n if (import.meta.env.PROD) {\n return `${window.location.origin}/api/v1`;\n }\n\n return `${window.location.origin}/agent/api/v1`;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "e02e25c4-0ef4-4a4d-b919-433270cf5c8b", | |
| "name": "getConfiguredContainer", | |
| "imports": "[{'import_name': ['Configuration'], 'import_path': '@migration-planner-ui/api-client/runtime'}, {'import_name': ['AgentApi'], 'import_path': '@migration-planner-ui/agent-client/apis'}, {'import_name': ['Container'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['Symbols'], 'import_path': './Symbols'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/main/Root.tsx", | |
| "code": "function getConfiguredContainer(): Container {\n const agentApiConfig = new Configuration({\n basePath: getConfigurationBasePath(),\n });\n const container = new Container();\n container.register(Symbols.AgentApi, new AgentApi(agentApiConfig));\n\n return container;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "898dfc8f-16a6-477c-8715-3b77ce9d9a43", | |
| "name": "main", | |
| "imports": "[{'import_name': ['RouterProvider'], 'import_path': 'react-router-dom'}, {'import_name': ['Spinner'], 'import_path': '@patternfly/react-core'}, {'import_name': ['Container', 'Provider', 'DependencyInjectionProvider'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['router'], 'import_path': './Router'}, {'import_name': ['AgentUIVersion'], 'import_path': '#/common/AgentUIVersion'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/main/Root.tsx", | |
| "code": "function main(): void {\n const root = document.getElementById(\"root\");\n if (root) {\n root.style.height = \"inherit\";\n const container = getConfiguredContainer();\n ReactDOM.createRoot(root).render(\n <React.StrictMode>\n <DependencyInjectionProvider container={container}>\n <React.Suspense fallback={<Spinner />}>\n <AgentUIVersion />\n <RouterProvider router={router} />\n </React.Suspense>\n </DependencyInjectionProvider>\n </React.StrictMode>\n );\n }\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "cf71a27d-6c03-4d66-822d-99398f5bbc72", | |
| "name": "Router.tsx", | |
| "imports": "[{'import_name': ['createBrowserRouter', 'Navigate'], 'import_path': 'react-router-dom'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/main/Router.tsx", | |
| "code": "/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport { createBrowserRouter, Navigate } from \"react-router-dom\";\n\nexport const router = createBrowserRouter([\n {\n path: \"/\",\n index: true,\n element: <Navigate to=\"/login\" />,\n },\n {\n path: \"/login\",\n lazy: async () => {\n const { default: AgentLoginPage } = await import(\n \"#/pages/AgentLoginPage\"\n );\n\n return {\n Component: AgentLoginPage,\n };\n },\n },\n {\n path: \"/error/:code\",\n lazy: async () => {\n const { default: ErrorPage } = await import(\"#/pages/ErrorPage\");\n\n return {\n Component: ErrorPage,\n };\n },\n },\n {\n path: \"*\",\n lazy: async () => {\n const { default: ErrorPage } = await import(\"#/pages/ErrorPage\");\n\n return {\n element: (\n <ErrorPage\n code=\"404\"\n message=\"We lost that page\"\n actions={[\n {\n children: \"Go back\",\n component: \"a\",\n onClick: (_event): void => {\n history.back();\n },\n },\n ]}\n />\n ),\n };\n },\n },\n]);\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d6845c1f-8d0a-4050-bea3-2f0708cd096e", | |
| "name": "Symbols.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/main/Symbols.ts", | |
| "code": "/** Symbols used by the DI container */\nexport const Symbols = Object.freeze({\n AgentApi: Symbol.for(\"AgentApi\"),\n});\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "7c80cf02-a61a-4ce9-a4ed-d7e5eb822c61", | |
| "name": "AgentLoginPage.tsx", | |
| "imports": "[{'import_name': ['Bullseye', 'Backdrop'], 'import_path': '@patternfly/react-core'}, {'import_name': ['LoginForm'], 'import_path': '#/login-form/LoginForm'}, {'import_name': ['useViewModel'], 'import_path': '#/login-form/hooks/UseViewModel'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/pages/AgentLoginPage.tsx", | |
| "code": "import React from \"react\";\nimport { Bullseye, Backdrop } from \"@patternfly/react-core\";\nimport { LoginForm } from \"#/login-form/LoginForm\";\nimport { useViewModel } from \"#/login-form/hooks/UseViewModel\";\n\nconst AgentLoginPage: React.FC = () => {\n const vm = useViewModel();\n\n return (\n <>\n <Backdrop style={{ zIndex: 0 }} />\n <Bullseye>\n <LoginForm vm={vm} />\n </Bullseye>\n </>\n );\n};\n\nAgentLoginPage.displayName = \"AgentLoginPage\";\n\nexport default AgentLoginPage;\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "9723bcf7-b418-4edd-a57f-64e225775de9", | |
| "name": "AgentLoginPage", | |
| "imports": "[{'import_name': ['Bullseye', 'Backdrop'], 'import_path': '@patternfly/react-core'}, {'import_name': ['LoginForm'], 'import_path': '#/login-form/LoginForm'}, {'import_name': ['useViewModel'], 'import_path': '#/login-form/hooks/UseViewModel'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/pages/AgentLoginPage.tsx", | |
| "code": "AgentLoginPage: React.FC = () => {\n const vm = useViewModel();\n\n return (\n <>\n <Backdrop style={{ zIndex: 0 }} />\n <Bullseye>\n <LoginForm vm={vm} />\n </Bullseye>\n </>\n );\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "23dd2b72-f1e8-4371-b259-7cc8d633af3a", | |
| "name": "ErrorPage.tsx", | |
| "imports": "[{'import_name': ['css', 'keyframes'], 'import_path': '@emotion/css'}, {'import_name': ['Bullseye', 'Card', 'Button', 'TextContent', 'Text', 'ButtonProps', 'Backdrop', 'EmptyStateIcon', 'EmptyState', 'EmptyStateBody', 'EmptyStateActions', 'EmptyStateFooter'], 'import_path': '@patternfly/react-core'}, {'import_name': ['WarningTriangleIcon', 'ErrorCircleOIcon'], 'import_path': '@patternfly/react-icons'}, {'import_name': ['useLocation', 'useParams'], 'import_path': 'react-router-dom'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/agent/src/pages/ErrorPage.tsx", | |
| "code": "import React from \"react\";\nimport { css, keyframes } from \"@emotion/css\";\nimport {\n Bullseye,\n Card,\n Button,\n TextContent,\n Text,\n ButtonProps,\n Backdrop,\n EmptyStateIcon,\n EmptyState,\n EmptyStateBody,\n EmptyStateActions,\n EmptyStateFooter,\n} from \"@patternfly/react-core\";\nimport { WarningTriangleIcon, ErrorCircleOIcon } from \"@patternfly/react-icons\";\nimport globalWarningColor100 from \"@patternfly/react-tokens/dist/esm/global_warning_color_100\";\nimport globalDangerColor100 from \"@patternfly/react-tokens/dist/esm/global_danger_color_100\";\nimport { useLocation, useParams } from \"react-router-dom\";\n\nconst bounce = keyframes`\n from, 20%, 53%, 80%, to {\n transform: translate3d(0,0,0);\n }\n\n 40%, 43% {\n transform: translate3d(0, -30px, 0);\n }\n\n 70% {\n transform: translate3d(0, -15px, 0);\n }\n\n 90% {\n transform: translate3d(0,-4px,0);\n }\n`;\n\nconst classes = {\n icon: css({\n fontSize: \"6rem\",\n animation: `${bounce} 1s ease infinite`,\n transformOrigin: \"center bottom\",\n }),\n} as const;\n\ntype Props = {\n code?: string;\n message?: string;\n additionalDetails?: string;\n /** A list of actions, the first entry is considered primary and the rest are secondary. */\n actions?: Array<Omit<ButtonProps, \"variant\">>;\n};\n\nconst ErrorPage: React.FC<Props> = (props) => {\n const params = useParams();\n const location = useLocation();\n\n const {\n code = params.code ?? \"500\",\n message = location.state?.message ?? \"That's on us...\",\n additionalDetails,\n actions = [],\n } = props;\n const [primaryAction, ...otherActions] = actions;\n\n return (\n <>\n <Backdrop style={{ zIndex: 0 }} />\n <Bullseye>\n <Card\n style={{ width: \"36rem\", height: \"38rem\", justifyContent: \"center\" }}\n isFlat\n isRounded\n >\n <EmptyState>\n <EmptyStateBody>\n <EmptyStateIcon\n className={classes.icon}\n icon={\n parseInt(code) < 500 ? WarningTriangleIcon : ErrorCircleOIcon\n }\n color={\n parseInt(code) < 500\n ? globalWarningColor100.value\n : globalDangerColor100.value\n }\n />\n <TextContent>\n <Text component=\"h1\">{code}</Text>\n <Text component=\"h2\">{message}</Text>\n {additionalDetails ?? <Text>{additionalDetails}</Text>}\n </TextContent>\n </EmptyStateBody>\n\n {actions.length > 0 && (\n <EmptyStateFooter>\n <EmptyStateActions>\n <Button variant=\"primary\" {...primaryAction} />\n </EmptyStateActions>\n <EmptyStateActions>\n {otherActions.map(({ key, ...props }) => (\n <Button key={key} variant=\"secondary\" {...props} />\n ))}\n </EmptyStateActions>\n </EmptyStateFooter>\n )}\n </EmptyState>\n </Card>\n </Bullseye>\n </>\n );\n};\n\nErrorPage.displayName = \"ErrorPage\";\n\nexport default ErrorPage;\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1df4fd3e-bcc6-449b-ad21-4385d5ed5639", | |
| "name": "vite.config.ts", | |
| "imports": "[{'import_name': ['defineConfig'], 'import_path': 'vite'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/vite.config.ts", | |
| "code": "import { defineConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react-swc\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\nimport dotenv from 'dotenv';\n\n// https://vitejs.dev/config/\nexport default defineConfig((_env) => {\n return {\n define: {\n 'process.env': dotenv.config().parsed\n },\n plugins: [tsconfigPaths(), react()],\n server: {\n proxy: {\n \"/planner/api\": {\n target: \"http://172.17.0.3:3443\",\n changeOrigin: true,\n rewrite: (path): string => path.replace(/^\\/planner/, \"\"),\n },\n \"/agent/api/v1\": {\n target: \"http://172.17.0.3:3333\",\n changeOrigin: true,\n rewrite: (path): string => path.replace(/^\\/agent/, \"\"),\n },\n },\n },\n };\n});\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "3bda9410-e038-4b8d-82a3-d7f3ab8ec7f1", | |
| "name": "vite-env.d.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/@types/vite-env.d.ts", | |
| "code": "/// <reference types=\"vite/client\" />\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "4eb3f08c-25b6-4e65-bf2d-be156c684931", | |
| "name": "MockAgentApi.ts", | |
| "imports": "[{'import_name': ['AgentApiInterface', 'DeleteAgentRequest'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Agent'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction', 'ApiResponse', 'ConfigurationParameters'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockAgentApi.ts", | |
| "code": "import { AgentApiInterface, DeleteAgentRequest } from \"@migration-planner-ui/api-client/apis\";\nimport { Agent } from \"@migration-planner-ui/api-client/models\";\nimport { InitOverrideFunction, ApiResponse, ConfigurationParameters } from \"@migration-planner-ui/api-client/runtime\";\n\nexport class MockAgentApi implements AgentApiInterface {\n constructor(_configuration: ConfigurationParameters) {\n console.warn(\"#### CAUTION: Using MockAgentApi ####\");\n }\n \n deleteAgentRaw(_requestParameters: DeleteAgentRequest, _initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<Agent>> {\n throw new Error(\"Method not implemented.\");\n }\n deleteAgent(_requestParameters: DeleteAgentRequest, _initOverrides?: RequestInit | InitOverrideFunction): Promise<Agent> {\n throw new Error(\"Method not implemented.\");\n }\n listAgentsRaw(_initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<Array<Agent>>> {\n throw new Error(\"Method not implemented.\");\n }\n async listAgents(_initOverrides?: RequestInit | InitOverrideFunction): Promise<Array<Agent>> {\n const { default: json } = await import(\"./responses/agents.json\");\n return json as unknown as Array<Agent>;\n }\n \n}" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "591a1991-244f-48f6-8b83-6bb309f4bb26", | |
| "name": "constructor", | |
| "imports": "[{'import_name': ['Agent'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['ConfigurationParameters'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockAgentApi.ts", | |
| "code": "constructor(_configuration: ConfigurationParameters) {\n console.warn(\"#### CAUTION: Using MockAgentApi ####\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockAgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a8729d2c-eac6-4f09-81a7-8fdca69491a3", | |
| "name": "deleteAgentRaw", | |
| "imports": "[{'import_name': ['DeleteAgentRequest'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Agent'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction', 'ApiResponse'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockAgentApi.ts", | |
| "code": "deleteAgentRaw(_requestParameters: DeleteAgentRequest, _initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<Agent>> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockAgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "413c233d-d1ec-4cfc-8896-85dcb8a12775", | |
| "name": "deleteAgent", | |
| "imports": "[{'import_name': ['DeleteAgentRequest'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Agent'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockAgentApi.ts", | |
| "code": "deleteAgent(_requestParameters: DeleteAgentRequest, _initOverrides?: RequestInit | InitOverrideFunction): Promise<Agent> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockAgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "0c51e5b5-a4e8-4323-9b96-725232ca24e2", | |
| "name": "listAgentsRaw", | |
| "imports": "[{'import_name': ['Agent'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction', 'ApiResponse'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockAgentApi.ts", | |
| "code": "listAgentsRaw(_initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<Array<Agent>>> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockAgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "5eee20f2-9102-4609-bc31-9fa3a05ebfd0", | |
| "name": "listAgents", | |
| "imports": "[{'import_name': ['Agent'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockAgentApi.ts", | |
| "code": "async listAgents(_initOverrides?: RequestInit | InitOverrideFunction): Promise<Array<Agent>> {\n const { default: json } = await import(\"./responses/agents.json\");\n return json as unknown as Array<Agent>;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockAgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "63c566c1-7ac2-4eff-a0b3-f405aa92483b", | |
| "name": "MockSourceApi.ts", | |
| "imports": "[{'import_name': ['DeleteSourceRequest', 'GetImageRequest', 'ReadSourceRequest', 'SourceApiInterface'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Source', 'Status'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction', 'ApiResponse', 'ConfigurationParameters'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "// import { sleep, Time } from \"#/common/Time\";\nimport {\n DeleteSourceRequest,\n GetImageRequest,\n ReadSourceRequest,\n SourceApiInterface,\n} from \"@migration-planner-ui/api-client/apis\";\nimport { Source, Status } from \"@migration-planner-ui/api-client/models\";\nimport {\n InitOverrideFunction,\n ApiResponse,\n ConfigurationParameters,\n} from \"@migration-planner-ui/api-client/runtime\";\n\nexport class MockSourceApi implements SourceApiInterface {\n constructor(_configuration: ConfigurationParameters) {\n console.warn(\"#### CAUTION: Using MockSourceApi ####\");\n }\n\n async deleteSourceRaw(\n _requestParameters: DeleteSourceRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Source>> {\n throw new Error(\"Method not implemented.\");\n }\n async deleteSource(\n _requestParameters: DeleteSourceRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Source> {\n throw new Error(\"Method not implemented.\");\n }\n async deleteSourcesRaw(\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Status>> {\n throw new Error(\"Method not implemented.\");\n }\n async deleteSources(\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Status> {\n throw new Error(\"Method not implemented.\");\n }\n async getSourceImageRaw(\n _requestParameters: GetImageRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Blob>> {\n throw new Error(\"Method not implemented.\");\n }\n async getSourceImage(\n _requestParameters: GetImageRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Blob> {\n throw new Error(\"Method not implemented.\");\n }\n async listSourcesRaw(\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Array<Source>>> {\n throw new Error(\"Method not implemented.\");\n }\n async listSources(\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Array<Source>> {\n // await sleep(3 * Time.Second);\n const { default: json } = await import(\"./responses/up-to-date.json\");\n return json as unknown as Array<Source>;\n }\n async readSourceRaw(\n _requestParameters: ReadSourceRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Source>> {\n throw new Error(\"Method not implemented.\");\n }\n async readSource(\n _requestParameters: ReadSourceRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Source> {\n throw new Error(\"Method not implemented.\");\n }\n async headSourceImage(\n _requestParameters: { id: string },\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Response> {\n // Different scenarios\n const errorScenarios = [\n { status: 404, statusText: \"Not Found\" },\n { status: 500, statusText: \"Internal Server Error\" },\n { status: 403, statusText: \"Forbidden\" },\n { status: 401, statusText: \"Unautorized\" },\n ];\n \n // Choose one option randomly\n const randomError = errorScenarios[Math.floor(Math.random() * errorScenarios.length)];\n \n // Simulation of error response \n return new Response(null, {\n status: randomError.status,\n statusText: randomError.statusText,\n });\n }\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "74366186-a59f-41b1-9d46-dfd1f345102b", | |
| "name": "constructor", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['ConfigurationParameters'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "constructor(_configuration: ConfigurationParameters) {\n console.warn(\"#### CAUTION: Using MockSourceApi ####\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "7289892a-ba79-42b9-8f52-f7ee7a14ca9c", | |
| "name": "deleteSourceRaw", | |
| "imports": "[{'import_name': ['DeleteSourceRequest'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction', 'ApiResponse'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async deleteSourceRaw(\n _requestParameters: DeleteSourceRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Source>> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "4b797c05-fd07-4c5a-8867-c2441595d857", | |
| "name": "deleteSource", | |
| "imports": "[{'import_name': ['DeleteSourceRequest'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async deleteSource(\n _requestParameters: DeleteSourceRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Source> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f58613c9-b755-44f9-8127-56ecc15dd36a", | |
| "name": "deleteSourcesRaw", | |
| "imports": "[{'import_name': ['Source', 'Status'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction', 'ApiResponse'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async deleteSourcesRaw(\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Status>> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "3ae43ca6-bc4c-444e-9821-bacab8069b21", | |
| "name": "deleteSources", | |
| "imports": "[{'import_name': ['Source', 'Status'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async deleteSources(\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Status> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "23eca121-10f3-479c-96d9-b9bcc340fe90", | |
| "name": "getSourceImageRaw", | |
| "imports": "[{'import_name': ['GetImageRequest'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction', 'ApiResponse'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async getSourceImageRaw(\n _requestParameters: GetImageRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Blob>> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ef25084c-ee7c-45c9-b67e-beda6b2c50d2", | |
| "name": "getSourceImage", | |
| "imports": "[{'import_name': ['GetImageRequest'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async getSourceImage(\n _requestParameters: GetImageRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Blob> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "4a8745e1-e2f6-4a86-b052-a38cb1783d23", | |
| "name": "listSourcesRaw", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction', 'ApiResponse'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async listSourcesRaw(\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Array<Source>>> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ea8fb8a2-ca24-4be4-8210-55542329fdc2", | |
| "name": "listSources", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async listSources(\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Array<Source>> {\n // await sleep(3 * Time.Second);\n const { default: json } = await import(\"./responses/up-to-date.json\");\n return json as unknown as Array<Source>;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ca932206-14ce-4b48-b198-5bbc14f94bbf", | |
| "name": "readSourceRaw", | |
| "imports": "[{'import_name': ['ReadSourceRequest'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction', 'ApiResponse'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async readSourceRaw(\n _requestParameters: ReadSourceRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<ApiResponse<Source>> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "17f808b2-c6df-44b7-b0e8-a3e80c490f21", | |
| "name": "readSource", | |
| "imports": "[{'import_name': ['ReadSourceRequest'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async readSource(\n _requestParameters: ReadSourceRequest,\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Source> {\n throw new Error(\"Method not implemented.\");\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c8045e61-67f4-4dae-8af9-f793dced632b", | |
| "name": "headSourceImage", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['InitOverrideFunction'], 'import_path': '@migration-planner-ui/api-client/runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/apis/MockSourceApi.ts", | |
| "code": "async headSourceImage(\n _requestParameters: { id: string },\n _initOverrides?: RequestInit | InitOverrideFunction\n ): Promise<Response> {\n // Different scenarios\n const errorScenarios = [\n { status: 404, statusText: \"Not Found\" },\n { status: 500, statusText: \"Internal Server Error\" },\n { status: 403, statusText: \"Forbidden\" },\n { status: 401, statusText: \"Unautorized\" },\n ];\n \n // Choose one option randomly\n const randomError = errorScenarios[Math.floor(Math.random() * errorScenarios.length)];\n \n // Simulation of error response \n return new Response(null, {\n status: randomError.status,\n statusText: randomError.statusText,\n });\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "MockSourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "64345d79-3a8b-4345-8dc8-039597f96d74", | |
| "name": "Time.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/common/Time.ts", | |
| "code": "export type Duration = number;\n\nexport const enum Time {\n Millisecond = 1,\n Second = 1000 * Millisecond,\n Minute = 60 * Second,\n Hour = 60 * Minute,\n Day = 24 * Hour,\n Week = 7 * Day,\n}\n\nexport const sleep = (delayMs: Duration): Promise<void> =>\n new Promise((resolve) => {\n setTimeout(resolve, delayMs);\n });\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "6d53fe27-aae0-4bc3-a00f-004876349542", | |
| "name": "sleep", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/common/Time.ts", | |
| "code": "sleep = (delayMs: Duration): Promise<void> =>\n new Promise((resolve) => {\n setTimeout(resolve, delayMs);\n })", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "7c852e9c-8dc6-47ba-88e8-24ba6501876f", | |
| "name": "version.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/common/version.ts", | |
| "code": "import buildManifest from 'demo/package.json';\n\n/**\n * The function returns the build-time generated version.\n * It can be overriden via the MIGRATION_PLANNER_UI_VERSION environment variable.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const getMigrationPlannerUiVersion = () => {\n \n return process.env.MIGRATION_PLANNER_UI_VERSION || buildManifest.version;\n };" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ada6a790-de15-487d-bf21-47128c38b7a8", | |
| "name": "getMigrationPlannerUiVersion", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/common/version.ts", | |
| "code": "getMigrationPlannerUiVersion = () => {\n \n return process.env.MIGRATION_PLANNER_UI_VERSION || buildManifest.version;\n }", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "0d02a904-5cf3-4d92-8c74-9df3631c2f94", | |
| "name": "AppPage.tsx", | |
| "imports": "[{'import_name': ['Divider', 'PageSection', 'PageBreadcrumb', 'Breadcrumb', 'BreadcrumbItem', 'BreadcrumbItemProps', 'TextContent', 'Text', 'Page'], 'import_path': '@patternfly/react-core'}, {'import_name': ['PageHeader', 'PageHeaderTitle'], 'import_path': '@redhat-cloud-services/frontend-components/PageHeader'}, {'import_name': ['getMigrationPlannerUiVersion'], 'import_path': '#/common/version'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/components/AppPage.tsx", | |
| "code": "import React from \"react\";\nimport {\n Divider,\n PageSection,\n PageBreadcrumb,\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbItemProps,\n TextContent,\n Text,\n Page,\n} from \"@patternfly/react-core\";\nimport {\n PageHeader,\n PageHeaderTitle,\n} from \"@redhat-cloud-services/frontend-components/PageHeader\";\nimport { getMigrationPlannerUiVersion } from \"#/common/version\";\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace AppPage {\n export type Props = {\n title: React.ReactNode;\n caption?: React.ReactNode;\n breadcrumbs?: Array<BreadcrumbItemProps>;\n };\n}\n\nexport const AppPage: React.FC<React.PropsWithChildren<AppPage.Props>> = (\n props\n) => {\n const { title, caption, breadcrumbs, children } = props;\n\n return (\n <Page>\n <div id=\"base-page__header\">\n <PageBreadcrumb>\n <Breadcrumb>\n {breadcrumbs?.map(({ key, children, ...bcProps }) => (\n <BreadcrumbItem key={key} {...bcProps}>\n {children}\n </BreadcrumbItem>\n ))}\n </Breadcrumb>\n <div data-testid=\"migration-planner-ui-version\" hidden>\n {getMigrationPlannerUiVersion()}\n </div>\n </PageBreadcrumb>\n <PageHeader>\n <PageHeaderTitle title={title} />\n <TextContent\n style={{ paddingBlockStart: \"var(--pf-v5-global--spacer--md)\" }}\n >\n <Text component=\"small\">{caption}</Text>\n </TextContent>\n </PageHeader>\n <Divider />\n </div>\n <PageSection>{children}</PageSection>\n </Page>\n );\n};\n\nAppPage.displayName = \"BasePage\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "8d74a655-31ea-4541-826b-51ae6989268f", | |
| "name": "ConfirmationModal.tsx", | |
| "imports": "[{'import_name': ['Button'], 'import_path': '@patternfly/react-core'}, {'import_name': ['Modal', 'ModalBody', 'ModalFooter', 'ModalHeader'], 'import_path': '@patternfly/react-core/next'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/components/ConfirmationModal.tsx", | |
| "code": "import React from \"react\";\nimport { Button } from \"@patternfly/react-core\";\nimport {\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n} from \"@patternfly/react-core/next\";\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ConfirmationModal {\n export type Props = {\n onClose?: (event: KeyboardEvent | React.MouseEvent) => void;\n onCancel?: React.MouseEventHandler<HTMLButtonElement> | undefined;\n onConfirm?: React.MouseEventHandler<HTMLButtonElement> | undefined;\n isOpen?: boolean;\n isDisabled?: boolean;\n titleIconVariant?: \"warning\" | \"success\" | \"danger\" | \"info\" | \"custom\";\n variant?: \"default\" | \"small\" | \"medium\" | \"large\";\n primaryButtonVariant?:\n | \"warning\"\n | \"danger\"\n | \"link\"\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"plain\"\n | \"control\";\n title: string;\n };\n}\n\nexport const ConfirmationModal: React.FC<\n React.PropsWithChildren<ConfirmationModal.Props>\n> = (props) => {\n const {\n isOpen = false,\n isDisabled = false,\n onClose,\n onConfirm,\n onCancel,\n variant = \"small\",\n titleIconVariant = \"info\",\n primaryButtonVariant = \"primary\",\n title,\n children,\n } = props;\n\n return (\n <Modal\n width=\"24rem\"\n isOpen={isOpen}\n variant={variant}\n aria-describedby=\"modal-title-icon-description\"\n aria-labelledby=\"title-icon-modal-title\"\n onClose={onClose}\n >\n <ModalHeader\n title={title}\n titleIconVariant={titleIconVariant}\n labelId=\"title-icon-modal-title\"\n />\n <ModalBody>{children}</ModalBody>\n <ModalFooter>\n <Button\n key=\"confirm\"\n variant={primaryButtonVariant}\n isDisabled={isDisabled}\n onClick={onConfirm}\n >\n Confirm\n </Button>\n {onCancel && (\n <Button key=\"cancel\" variant=\"link\" onClick={onCancel}>\n Cancel\n </Button>\n )}\n </ModalFooter>\n </Modal>\n );\n};\n\nConfirmationModal.displayName = \"ConfirmationModal\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d44f9161-8b90-47a2-927b-48e2f40b6c2e", | |
| "name": "CustomEnterpriseIcon.tsx", | |
| "imports": "[{'import_name': ['SVGIcon'], 'import_path': '#/components/SVGIcon'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/components/CustomEnterpriseIcon.tsx", | |
| "code": "import React from \"react\";\nimport { SVGIcon } from \"#/components/SVGIcon\";\n\nexport const CustomEnterpriseIcon: React.FC = () => (\n <SVGIcon viewBox=\"0 0 54 54\">\n <path d=\"M22.7165 0L0 5.78496V46.5275L30.2835 54H34.0722L53 46.285V5.78496L26.5052 0H22.7165ZM3.78867 43.5111V10.5943L29.8125 16.4848V49.7971L26.4793 48.9902V43.2105L6.6457 38.3221V44.1809L3.78867 43.5111ZM33.125 17.2441L49.6875 10.7104V43.4637L46.3698 44.8084V40.2627L36.4375 44.2652V48.8584L33.125 50.2295V17.2441ZM6.6457 22.8973L26.4793 27.6961V19.865L6.6457 15.3404V22.8973ZM36.4375 21.1201V28.8352L46.375 24.8379V17.1281L36.4375 21.1201ZM6.6457 34.4672L26.4793 39.2977V31.5193L6.6457 26.7521V34.4672ZM36.4375 32.6953V40.4104L46.3802 36.4131V28.698L36.4375 32.6953Z\" />\n <ellipse cx=\"43\" cy=\"41\" rx=\"13\" ry=\"13\" fill=\"#F0F0F0\" />\n <path d=\"M52.8258 51.7238L53.7655 50.7665C54.0776 50.4485 54.0776 49.9344 53.7688 49.6164L50.4582 46.2439C50.3088 46.0917 50.1062 46.0071 49.8937 46.0071H49.3525C50.2689 44.8131 50.8135 43.3112 50.8135 41.6774C50.8135 37.7907 47.7221 34.6415 43.9068 34.6415C40.0914 34.6415 37 37.7907 37 41.6774C37 45.564 40.0914 48.7132 43.9068 48.7132C45.5106 48.7132 46.9849 48.1585 48.1571 47.2249V47.7762C48.1571 47.9928 48.2401 48.1991 48.3895 48.3513L51.7001 51.7238C52.0122 52.0418 52.517 52.0418 52.8258 51.7238ZM43.9068 46.0071C41.5591 46.0071 39.6564 44.0723 39.6564 41.6774C39.6564 39.2859 41.5558 37.3476 43.9068 37.3476C46.2544 37.3476 48.1571 39.2825 48.1571 41.6774C48.1571 44.0689 46.2577 46.0071 43.9068 46.0071Z\" />\n </SVGIcon>\n);\n\nCustomEnterpriseIcon.displayName = \"CustomEnterpriseIcon\";\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "87c430b0-58aa-43ab-b0b1-78564bd0b140", | |
| "name": "CustomEnterpriseIcon", | |
| "imports": "[{'import_name': ['SVGIcon'], 'import_path': '#/components/SVGIcon'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/components/CustomEnterpriseIcon.tsx", | |
| "code": "CustomEnterpriseIcon: React.FC = () => (\n <SVGIcon viewBox=\"0 0 54 54\">\n <path d=\"M22.7165 0L0 5.78496V46.5275L30.2835 54H34.0722L53 46.285V5.78496L26.5052 0H22.7165ZM3.78867 43.5111V10.5943L29.8125 16.4848V49.7971L26.4793 48.9902V43.2105L6.6457 38.3221V44.1809L3.78867 43.5111ZM33.125 17.2441L49.6875 10.7104V43.4637L46.3698 44.8084V40.2627L36.4375 44.2652V48.8584L33.125 50.2295V17.2441ZM6.6457 22.8973L26.4793 27.6961V19.865L6.6457 15.3404V22.8973ZM36.4375 21.1201V28.8352L46.375 24.8379V17.1281L36.4375 21.1201ZM6.6457 34.4672L26.4793 39.2977V31.5193L6.6457 26.7521V34.4672ZM36.4375 32.6953V40.4104L46.3802 36.4131V28.698L36.4375 32.6953Z\" />\n <ellipse cx=\"43\" cy=\"41\" rx=\"13\" ry=\"13\" fill=\"#F0F0F0\" />\n <path d=\"M52.8258 51.7238L53.7655 50.7665C54.0776 50.4485 54.0776 49.9344 53.7688 49.6164L50.4582 46.2439C50.3088 46.0917 50.1062 46.0071 49.8937 46.0071H49.3525C50.2689 44.8131 50.8135 43.3112 50.8135 41.6774C50.8135 37.7907 47.7221 34.6415 43.9068 34.6415C40.0914 34.6415 37 37.7907 37 41.6774C37 45.564 40.0914 48.7132 43.9068 48.7132C45.5106 48.7132 46.9849 48.1585 48.1571 47.2249V47.7762C48.1571 47.9928 48.2401 48.1991 48.3895 48.3513L51.7001 51.7238C52.0122 52.0418 52.517 52.0418 52.8258 51.7238ZM43.9068 46.0071C41.5591 46.0071 39.6564 44.0723 39.6564 41.6774C39.6564 39.2859 41.5558 37.3476 43.9068 37.3476C46.2544 37.3476 48.1571 39.2825 48.1571 41.6774C48.1571 44.0689 46.2577 46.0071 43.9068 46.0071Z\" />\n </SVGIcon>\n)", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "b8597da1-6a36-48e7-9837-597458586fb5", | |
| "name": "ErrorPage.tsx", | |
| "imports": "[{'import_name': ['css', 'keyframes'], 'import_path': '@emotion/css'}, {'import_name': ['Bullseye', 'Card', 'Button', 'TextContent', 'Text', 'ButtonProps', 'Backdrop', 'EmptyStateIcon', 'EmptyState', 'EmptyStateBody', 'EmptyStateActions', 'EmptyStateFooter'], 'import_path': '@patternfly/react-core'}, {'import_name': ['WarningTriangleIcon', 'ErrorCircleOIcon'], 'import_path': '@patternfly/react-icons'}, {'import_name': ['useLocation', 'useParams'], 'import_path': 'react-router-dom'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/components/ErrorPage.tsx", | |
| "code": "import React from \"react\";\nimport { css, keyframes } from \"@emotion/css\";\nimport {\n Bullseye,\n Card,\n Button,\n TextContent,\n Text,\n ButtonProps,\n Backdrop,\n EmptyStateIcon,\n EmptyState,\n EmptyStateBody,\n EmptyStateActions,\n EmptyStateFooter,\n} from \"@patternfly/react-core\";\nimport { WarningTriangleIcon, ErrorCircleOIcon } from \"@patternfly/react-icons\";\nimport globalWarningColor100 from \"@patternfly/react-tokens/dist/esm/global_warning_color_100\";\nimport globalDangerColor100 from \"@patternfly/react-tokens/dist/esm/global_danger_color_100\";\nimport { useLocation, useParams } from \"react-router-dom\";\n\nconst bounce = keyframes`\n from, 20%, 53%, 80%, to {\n transform: translate3d(0,0,0);\n }\n\n 40%, 43% {\n transform: translate3d(0, -30px, 0);\n }\n\n 70% {\n transform: translate3d(0, -15px, 0);\n }\n\n 90% {\n transform: translate3d(0,-4px,0);\n }\n`;\n\nconst classes = {\n icon: css({\n fontSize: \"6rem\",\n animation: `${bounce} 1s ease infinite`,\n transformOrigin: \"center bottom\",\n }),\n} as const;\n\ntype Props = {\n code?: string;\n message?: string;\n additionalDetails?: string;\n /** A list of actions, the first entry is considered primary and the rest are secondary. */\n actions?: Array<Omit<ButtonProps, \"variant\">>;\n};\n\nconst ErrorPage: React.FC<Props> = (props) => {\n const params = useParams();\n const location = useLocation();\n\n const {\n code = params.code ?? \"500\",\n message = location.state?.message ?? \"That's on us...\",\n additionalDetails,\n actions = [],\n } = props;\n const [primaryAction, ...otherActions] = actions;\n\n return (\n <>\n <Backdrop style={{ zIndex: 0 }} />\n <Bullseye>\n <Card\n style={{ width: \"36rem\", height: \"38rem\", justifyContent: \"center\" }}\n isFlat\n isRounded\n >\n <EmptyState>\n <EmptyStateBody>\n <EmptyStateIcon\n className={classes.icon}\n icon={\n parseInt(code) < 500 ? WarningTriangleIcon : ErrorCircleOIcon\n }\n color={\n parseInt(code) < 500\n ? globalWarningColor100.value\n : globalDangerColor100.value\n }\n />\n <TextContent>\n <Text component=\"h1\">{code}</Text>\n <Text component=\"h2\">{message}</Text>\n {additionalDetails ?? <Text>{additionalDetails}</Text>}\n </TextContent>\n </EmptyStateBody>\n\n {actions.length > 0 && (\n <EmptyStateFooter>\n <EmptyStateActions>\n <Button variant=\"primary\" {...primaryAction} />\n </EmptyStateActions>\n <EmptyStateActions>\n {otherActions.map(({ key, ...props }) => (\n <Button key={key} variant=\"secondary\" {...props} />\n ))}\n </EmptyStateActions>\n </EmptyStateFooter>\n )}\n </EmptyState>\n </Card>\n </Bullseye>\n </>\n );\n};\n\nErrorPage.displayName = \"ErrorPage\";\n\nexport default ErrorPage;\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d59354a0-81b8-4075-b943-96ddf0a38fdd", | |
| "name": "SVGIcon.tsx", | |
| "imports": "[{'import_name': ['PropsWithChildren', 'useEffect'], 'import_path': 'react'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/components/SVGIcon.tsx", | |
| "code": "import React, { PropsWithChildren, useEffect } from \"react\";\n\nexport type SVGIconProps = PropsWithChildren<\n Omit<React.SVGProps<SVGElement>, \"ref\" | \"role\">\n> & {\n title?: string;\n className?: string;\n};\n\ntype SVGIconState = {\n title: `svg-icon-title-${number}`;\n};\n\nlet currentId = 0;\n\nexport const SVGIcon = React.forwardRef<SVGSVGElement, SVGIconProps>(\n (props, ref) => {\n const { current: state } = React.useRef<SVGIconState>({\n title: `svg-icon-title-${currentId}`,\n });\n const { children, className, title, viewBox = \"0 0 1024 1024\" } = props;\n const hasTitle = Boolean(title);\n const classes = className ? `pf-v5-svg ${className}` : \"pf-v5-svg\";\n\n useEffect(() => {\n currentId++;\n }, []);\n\n return (\n <svg\n ref={ref}\n role=\"img\"\n width=\"1em\"\n height=\"1em\"\n fill=\"currentColor\"\n viewBox={viewBox}\n className={classes}\n {...(hasTitle && { [\"aria-labelledby\"]: title })}\n {...(!hasTitle && { [\"aria-hidden\"]: \"true\" })}\n {...props}\n >\n {hasTitle && <title id={state.title}>{title}</title>}\n {children}\n </svg>\n );\n }\n);\n\nSVGIcon.displayName = `SVGIcon`;\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "448835cb-7aac-4dec-b518-865783435468", | |
| "name": "Root.tsx", | |
| "imports": "[{'import_name': ['RouterProvider'], 'import_path': 'react-router-dom'}, {'import_name': ['Configuration'], 'import_path': '@migration-planner-ui/api-client/runtime'}, {'import_name': ['AgentApi', 'SourceApi'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Spinner'], 'import_path': '@patternfly/react-core'}, {'import_name': ['Container', 'Provider', 'DependencyInjectionProvider'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['router'], 'import_path': './Router'}, {'import_name': ['Symbols'], 'import_path': './Symbols'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/main/Root.tsx", | |
| "code": "import \"@patternfly/react-core/dist/styles/base.css\";\n\nimport React from \"react\";\nimport ReactDOM from \"react-dom/client\";\nimport { RouterProvider } from \"react-router-dom\";\nimport { Configuration } from \"@migration-planner-ui/api-client/runtime\";\nimport { AgentApi, SourceApi } from \"@migration-planner-ui/api-client/apis\";\nimport { Spinner } from \"@patternfly/react-core\";\nimport {\n Container,\n Provider as DependencyInjectionProvider,\n} from \"@migration-planner-ui/ioc\";\nimport { router } from \"./Router\";\nimport { Symbols } from \"./Symbols\";\n\nfunction getConfiguredContainer(): Container {\n const plannerApiConfig = new Configuration({\n basePath: `/planner`\n });\n const container = new Container();\n container.register(Symbols.SourceApi, new SourceApi(plannerApiConfig));\n container.register(Symbols.AgentApi, new AgentApi(plannerApiConfig));\n\n //For UI testing we can use the mock Apis\n //container.register(Symbols.SourceApi, new MockSourceApi(plannerApiConfig));\n //container.register(Symbols.AgentApi, new MockAgentApi(plannerApiConfig));\n return container;\n}\n\nfunction main(): void {\n const root = document.getElementById(\"root\");\n if (root) {\n root.style.height = \"inherit\";\n const container = getConfiguredContainer();\n ReactDOM.createRoot(root).render(\n <React.StrictMode>\n <DependencyInjectionProvider container={container}>\n <React.Suspense fallback={<Spinner />}>\n <RouterProvider router={router} />\n </React.Suspense>\n </DependencyInjectionProvider>\n </React.StrictMode>\n );\n }\n}\n\nmain();\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "6b00e88d-3fee-4142-a3ae-69fb0130d860", | |
| "name": "getConfiguredContainer", | |
| "imports": "[{'import_name': ['Configuration'], 'import_path': '@migration-planner-ui/api-client/runtime'}, {'import_name': ['AgentApi', 'SourceApi'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['Container'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['Symbols'], 'import_path': './Symbols'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/main/Root.tsx", | |
| "code": "function getConfiguredContainer(): Container {\n const plannerApiConfig = new Configuration({\n basePath: `/planner`\n });\n const container = new Container();\n container.register(Symbols.SourceApi, new SourceApi(plannerApiConfig));\n container.register(Symbols.AgentApi, new AgentApi(plannerApiConfig));\n\n //For UI testing we can use the mock Apis\n //container.register(Symbols.SourceApi, new MockSourceApi(plannerApiConfig));\n //container.register(Symbols.AgentApi, new MockAgentApi(plannerApiConfig));\n return container;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c363089a-045c-4239-a041-bb85a5866359", | |
| "name": "main", | |
| "imports": "[{'import_name': ['RouterProvider'], 'import_path': 'react-router-dom'}, {'import_name': ['Spinner'], 'import_path': '@patternfly/react-core'}, {'import_name': ['Container', 'Provider', 'DependencyInjectionProvider'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['router'], 'import_path': './Router'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/main/Root.tsx", | |
| "code": "function main(): void {\n const root = document.getElementById(\"root\");\n if (root) {\n root.style.height = \"inherit\";\n const container = getConfiguredContainer();\n ReactDOM.createRoot(root).render(\n <React.StrictMode>\n <DependencyInjectionProvider container={container}>\n <React.Suspense fallback={<Spinner />}>\n <RouterProvider router={router} />\n </React.Suspense>\n </DependencyInjectionProvider>\n </React.StrictMode>\n );\n }\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "24d64534-1312-443d-8f81-93799bbd592a", | |
| "name": "Router.tsx", | |
| "imports": "[{'import_name': ['createBrowserRouter', 'Navigate'], 'import_path': 'react-router-dom'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/main/Router.tsx", | |
| "code": "/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport { createBrowserRouter, Navigate } from \"react-router-dom\";\n\nexport const router = createBrowserRouter([\n {\n path: \"/\",\n index: true,\n element: <Navigate to=\"/migrate\" />,\n },\n {\n path: \"/migrate\",\n lazy: async () => {\n const { default: MigrationAssessmentPage } = await import(\n \"#/pages/MigrationAssessmentPage\"\n );\n\n return {\n Component: MigrationAssessmentPage,\n };\n },\n },\n {\n path: \"/migrate/wizard\",\n lazy: async () => {\n const { default: MigrationWizardPage } = await import(\n \"#/pages/MigrationWizardPage\"\n );\n\n return {\n Component: MigrationWizardPage,\n };\n },\n },\n {\n path: \"/ocm\",\n lazy: async () => {\n const { default: OcmPreviewPage } = await import(\n \"#/pages/OcmPreviewPage\"\n );\n\n return {\n Component: OcmPreviewPage,\n };\n },\n },\n {\n path: \"/error/:code\",\n lazy: async () => {\n const { default: ErrorPage } = await import(\"../components/ErrorPage\");\n\n return {\n Component: ErrorPage,\n };\n },\n },\n {\n path: \"*\",\n lazy: async () => {\n const { default: ErrorPage } = await import(\"../components/ErrorPage\");\n\n return {\n element: (\n <ErrorPage\n code=\"404\"\n message=\"We lost that page\"\n actions={[\n {\n children: \"Go back\",\n component: \"a\",\n onClick: (_event): void => {\n history.back();\n },\n },\n ]}\n />\n ),\n };\n },\n },\n]);\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "53227c69-0283-4b1c-a5ca-1cd880e40f68", | |
| "name": "Symbols.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/main/Symbols.ts", | |
| "code": "/** Symbols used by the DI container */\nexport const Symbols = Object.freeze({\n AgentApi: Symbol.for(\"AgentApi\"),\n ImageApi: Symbol.for(\"ImageApi\"),\n SourceApi: Symbol.for(\"SourceApi\"),\n});\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ef4f2c8d-e50a-4957-b6bf-5f18c5042e11", | |
| "name": "MigrationWizard.tsx", | |
| "imports": "[{'import_name': ['Button', 'useWizardContext', 'Wizard', 'WizardFooterWrapper', 'WizardStep'], 'import_path': '@patternfly/react-core'}, {'import_name': ['ConnectStep'], 'import_path': './steps/connect/ConnectStep'}, {'import_name': ['DiscoveryStep'], 'import_path': './steps/discovery/DiscoveryStep'}, {'import_name': ['useComputedHeightFromPageHeader'], 'import_path': './hooks/UseComputedHeightFromPageHeader'}, {'import_name': ['useDiscoverySources'], 'import_path': './contexts/discovery-sources/Context'}, {'import_name': ['PrepareMigrationStep'], 'import_path': './steps/prepare-migration/PrepareMigrationStep'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/MigrationWizard.tsx", | |
| "code": "import React from \"react\";\nimport {\n Button,\n useWizardContext,\n Wizard,\n WizardFooterWrapper,\n WizardStep,\n} from \"@patternfly/react-core\";\nimport { ConnectStep } from \"./steps/connect/ConnectStep\";\nimport { DiscoveryStep } from \"./steps/discovery/DiscoveryStep\";\nimport { useComputedHeightFromPageHeader } from \"./hooks/UseComputedHeightFromPageHeader\";\nimport { useDiscoverySources } from \"./contexts/discovery-sources/Context\";\nimport { PrepareMigrationStep } from \"./steps/prepare-migration/PrepareMigrationStep\";\n\nconst openAssistedInstaller = (): void => {\n window.open(\n \"https://console.dev.redhat.com/openshift/assisted-installer/clusters/~new?source=assisted_migration\",\n \"_blank\"\n );\n};\n\ntype CustomWizardFooterPropType = {\n isCancelHidden?: boolean;\n isNextDisabled?: boolean;\n isBackDisabled?: boolean;\n nextButtonText?: string;\n onNext?: () => void;\n};\n\nexport const CustomWizardFooter: React.FC<CustomWizardFooterPropType> = ({\n isCancelHidden,\n isBackDisabled,\n isNextDisabled,\n nextButtonText,\n onNext,\n}): JSX.Element => {\n const { goToNextStep, goToPrevStep, goToStepById } = useWizardContext();\n return (\n <>\n <WizardFooterWrapper> \n <Button\n ouiaId=\"wizard-back-btn\"\n variant=\"secondary\"\n onClick={goToPrevStep}\n isDisabled={isBackDisabled}\n >\n Back\n </Button>\n <Button\n ouiaId=\"wizard-next-btn\"\n variant=\"primary\"\n onClick={() => {\n if (onNext) {\n onNext();\n } else {\n goToNextStep();\n }\n }}\n isDisabled={isNextDisabled}\n >\n {nextButtonText ?? \"Next\"}\n </Button>\n {!isCancelHidden && (\n <Button\n ouiaId=\"wizard-cancel-btn\"\n variant=\"link\"\n onClick={() => goToStepById(\"connect-step\")}\n >\n Cancel\n </Button>\n )}\n </WizardFooterWrapper>\n </>\n );\n};\n\nexport const MigrationWizard: React.FC = () => {\n const computedHeight = useComputedHeightFromPageHeader();\n const discoverSourcesContext = useDiscoverySources();\n const isDiscoverySourceUpToDate =\n discoverSourcesContext.agentSelected?.status === \"up-to-date\";\n\n return (\n <Wizard height={computedHeight}>\n <WizardStep\n name=\"Connect\"\n id=\"connect-step\"\n footer={\n <CustomWizardFooter\n isCancelHidden={true}\n isNextDisabled={\n !isDiscoverySourceUpToDate ||\n discoverSourcesContext.sourceSelected === null\n }\n isBackDisabled={true}\n />\n }\n >\n <ConnectStep />\n </WizardStep>\n <WizardStep\n name=\"Discover\"\n id=\"discover-step\"\n footer={<CustomWizardFooter isCancelHidden={true} />}\n isDisabled={\n discoverSourcesContext.agentSelected?.status !== \"up-to-date\" ||\n discoverSourcesContext.sourceSelected === null\n }\n >\n <DiscoveryStep />\n </WizardStep>\n <WizardStep\n name=\"Plan\"\n id=\"plan-step\"\n footer={\n <CustomWizardFooter\n nextButtonText={\"Let's create a new cluster\"}\n onNext={openAssistedInstaller}\n />\n }\n isDisabled={\n discoverSourcesContext.agentSelected?.status !== \"up-to-date\" ||\n discoverSourcesContext.sourceSelected === null\n }\n >\n <PrepareMigrationStep />\n </WizardStep>\n </Wizard>\n );\n};\n\nMigrationWizard.displayName = \"MigrationWizard\";\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ff4c09da-43b2-476e-8aaf-4d741dff28dd", | |
| "name": "openAssistedInstaller", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/MigrationWizard.tsx", | |
| "code": "openAssistedInstaller = (): void => {\n window.open(\n \"https://console.dev.redhat.com/openshift/assisted-installer/clusters/~new?source=assisted_migration\",\n \"_blank\"\n );\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "3403efb5-1bee-4093-a710-5a15be05ff8c", | |
| "name": "CustomWizardFooter", | |
| "imports": "[{'import_name': ['Button', 'useWizardContext', 'Wizard', 'WizardFooterWrapper'], 'import_path': '@patternfly/react-core'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/MigrationWizard.tsx", | |
| "code": "CustomWizardFooter: React.FC<CustomWizardFooterPropType> = ({\n isCancelHidden,\n isBackDisabled,\n isNextDisabled,\n nextButtonText,\n onNext,\n}): JSX.Element => {\n const { goToNextStep, goToPrevStep, goToStepById } = useWizardContext();\n return (\n <>\n <WizardFooterWrapper> \n <Button\n ouiaId=\"wizard-back-btn\"\n variant=\"secondary\"\n onClick={goToPrevStep}\n isDisabled={isBackDisabled}\n >\n Back\n </Button>\n <Button\n ouiaId=\"wizard-next-btn\"\n variant=\"primary\"\n onClick={() => {\n if (onNext) {\n onNext();\n } else {\n goToNextStep();\n }\n }", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "b2bd7cea-097a-476c-805e-c66188e1641d", | |
| "name": "MigrationWizard", | |
| "imports": "[{'import_name': ['Button', 'Wizard', 'WizardStep'], 'import_path': '@patternfly/react-core'}, {'import_name': ['ConnectStep'], 'import_path': './steps/connect/ConnectStep'}, {'import_name': ['DiscoveryStep'], 'import_path': './steps/discovery/DiscoveryStep'}, {'import_name': ['useComputedHeightFromPageHeader'], 'import_path': './hooks/UseComputedHeightFromPageHeader'}, {'import_name': ['useDiscoverySources'], 'import_path': './contexts/discovery-sources/Context'}, {'import_name': ['PrepareMigrationStep'], 'import_path': './steps/prepare-migration/PrepareMigrationStep'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/MigrationWizard.tsx", | |
| "code": "MigrationWizard: React.FC = () => {\n const computedHeight = useComputedHeightFromPageHeader();\n const discoverSourcesContext = useDiscoverySources();\n const isDiscoverySourceUpToDate =\n discoverSourcesContext.agentSelected?.status === \"up-to-date\";\n\n return (\n <Wizard height={computedHeight}>\n <WizardStep\n name=\"Connect\"\n id=\"connect-step\"\n footer={\n <CustomWizardFooter\n isCancelHidden={true}\n isNextDisabled={\n !isDiscoverySourceUpToDate ||\n discoverSourcesContext.sourceSelected === null\n }\n isBackDisabled={true}\n />\n }\n >\n <ConnectStep />\n </WizardStep>\n <WizardStep\n name=\"Discover\"\n id=\"discover-step\"\n footer={<CustomWizardFooter isCancelHidden={true} />}\n isDisabled={\n discoverSourcesContext.agentSelected?.status !== \"up-to-date\" ||\n discoverSourcesContext.sourceSelected === null\n }\n >\n <DiscoveryStep />\n </WizardStep>\n <WizardStep\n name=\"Plan\"\n id=\"plan-step\"\n footer={\n <CustomWizardFooter\n nextButtonText={\"Let's create a new cluster\"}\n onNext={openAssistedInstaller}\n />\n }\n isDisabled={\n discoverSourcesContext.agentSelected?.status !== \"up-to-date\" ||\n discoverSourcesContext.sourceSelected === null\n }\n >\n <PrepareMigrationStep />\n </WizardStep>\n </Wizard>\n );\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "9836465f-5fe7-4ce8-ad2c-e74b81002106", | |
| "name": "Context.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/contexts/discovery-sources/Context.ts", | |
| "code": "import React from \"react\";\n\nexport const Context = React.createContext<DiscoverySources.Context | null>(\n null\n);\n\nexport function useDiscoverySources(): DiscoverySources.Context {\n const ctx = React.useContext(Context);\n if (!ctx) {\n throw new Error(\n \"useDiscoverySources must be used within a <DiscoverySourceProvider />\"\n );\n }\n\n return ctx;\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "28458a1f-5a2a-4cd4-b176-399a77cd5708", | |
| "name": "useDiscoverySources", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/contexts/discovery-sources/Context.ts", | |
| "code": "function useDiscoverySources(): DiscoverySources.Context {\n const ctx = React.useContext(Context);\n if (!ctx) {\n throw new Error(\n \"useDiscoverySources must be used within a <DiscoverySourceProvider />\"\n );\n }\n\n return ctx;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a76d21cd-84ce-4c00-aa0c-ebbe926b1560", | |
| "name": "Provider.tsx", | |
| "imports": "[{'import_name': ['useCallback', 'useState', 'PropsWithChildren'], 'import_path': 'react'}, {'import_name': ['useAsyncFn', 'useInterval'], 'import_path': 'react-use'}, {'import_name': ['SourceApiInterface', 'AgentApiInterface'], 'import_path': '@migration-planner-ui/api-client/apis'}, {'import_name': ['useInjection'], 'import_path': '@migration-planner-ui/ioc'}, {'import_name': ['Symbols'], 'import_path': '#/main/Symbols'}, {'import_name': ['Context'], 'import_path': './Context'}, {'import_name': ['Agent', 'Source'], 'import_path': '@migration-planner-ui/api-client/models'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/contexts/discovery-sources/Provider.tsx", | |
| "code": "import React, {\n useCallback,\n useState,\n type PropsWithChildren,\n} from \"react\";\nimport { useAsyncFn, useInterval } from \"react-use\";\nimport { type SourceApiInterface, type AgentApiInterface } from \"@migration-planner-ui/api-client/apis\";\nimport { useInjection } from \"@migration-planner-ui/ioc\";\nimport { Symbols } from \"#/main/Symbols\";\nimport { Context } from \"./Context\";\nimport { Agent, Source } from \"@migration-planner-ui/api-client/models\";\n\nexport const Provider: React.FC<PropsWithChildren> = (props) => {\n const { children } = props;\n\n const [sourceSelected, setSourceSelected] = useState<Source | null>(null)\n\n const [agentSelected, setAgentSelected] = useState<Agent | null>(null)\n\n const sourceApi = useInjection<SourceApiInterface>(Symbols.SourceApi);\n const agentsApi = useInjection<AgentApiInterface>(Symbols.AgentApi);\n\n const [listAgentsState, listAgents] = useAsyncFn(async () => {\n const agents = await agentsApi.listAgents();\n return agents;\n });\n\n const [listSourcesState, listSources] = useAsyncFn(async () => {\n const sources = await sourceApi.listSources();\n return sources;\n });\n\n const [deleteSourceState, deleteSource] = useAsyncFn(async (id: string) => {\n const deletedSource = await sourceApi.deleteSource({ id });\n return deletedSource;\n });\n\n\n const [downloadSourceState, downloadSource] = useAsyncFn(\n async (sshKey:string): Promise<void> => {\n const anchor = document.createElement(\"a\");\n anchor.download = 'image.ova';\n const imageUrl = `/planner/api/v1/image${sshKey ? '?sshKey=' + sshKey : ''}`; \n\n const response = await fetch(imageUrl, { method: 'HEAD' });\n \n if (!response.ok) {\n const error: Error = new Error(`Error downloading source: ${response.status} ${response.statusText}`);\n downloadSourceState.error = error;\n console.error(\"Error downloading source:\", error);\n throw error;\n }\n else {\n downloadSourceState.loading = true;\n }\n // TODO(jkilzi): See: ECOPROJECT-2192. \n // Then don't forget to remove the '/planner/' prefix in production.\n // const image = await sourceApi.getSourceImage({ id: newSource.id }); // This API is useless in production\n // anchor.href = URL.createObjectURL(image); // Don't do this...\n anchor.href = imageUrl;\n\n document.body.appendChild(anchor);\n anchor.click();\n anchor.remove();\n }\n );\n\n const [isPolling, setIsPolling] = useState(false);\n const [pollingDelay, setPollingDelay] = useState<number | null>(null);\n const startPolling = useCallback(\n (delay: number) => {\n if (!isPolling) {\n setPollingDelay(delay);\n setIsPolling(true);\n }\n },\n [isPolling]\n );\n const stopPolling = useCallback(() => {\n if (isPolling) {\n setPollingDelay(null);\n setIsPolling(false);\n }\n }, [isPolling]);\n useInterval(() => {\n listSources();\n listAgents();\n }, pollingDelay);\n\n const selectSource = useCallback((source: Source|null) => {\n setSourceSelected(source);\n }, []);\n\n const selectSourceById = useCallback((sourceId: string) => {\n const source = listSourcesState.value?.find(source => source.id === sourceId);\n setSourceSelected(source||null);\n }, [listSourcesState.value]);\n\n\n const selectAgent = useCallback(async (agent: Agent) => {\n setAgentSelected(agent);\n if (agent && agent.sourceId!==null) await selectSourceById(agent.sourceId ?? '');\n }, [selectSourceById]);\n\n\n const [deleteAgentState, deleteAgent] = useAsyncFn(async (agent: Agent) => {\n if (agent && agent.sourceId !== null) {\n await deleteSource(agent.sourceId ?? '');\n selectSource(null);\n }\n const deletedAgent = await agentsApi.deleteAgent({id: agent.id});\n return deletedAgent;\n });\n \n const ctx: DiscoverySources.Context = {\n sources: listSourcesState.value ?? [],\n isLoadingSources: listSourcesState.loading,\n errorLoadingSources: listSourcesState.error,\n isDeletingSource: deleteSourceState.loading,\n errorDeletingSource: deleteSourceState.error,\n isDownloadingSource: downloadSourceState.loading,\n errorDownloadingSource: downloadSourceState.error, \n isPolling,\n listSources,\n deleteSource,\n downloadSource,\n startPolling,\n stopPolling,\n sourceSelected: sourceSelected,\n selectSource,\n agents: listAgentsState.value ?? [],\n isLoadingAgents: listAgentsState.loading,\n errorLoadingAgents: listAgentsState.error,\n listAgents,\n deleteAgent,\n isDeletingAgent: deleteAgentState.loading,\n errorDeletingAgent: deleteAgentState.error,\n selectAgent,\n agentSelected: agentSelected,\n selectSourceById\n };\n\n return <Context.Provider value={ctx}>{children}</Context.Provider>;\n};\n\nProvider.displayName = \"DiscoverySourcesProvider\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "389d2af6-96e6-4f69-ace9-eb59245f40c3", | |
| "name": "DiscoverySources.d.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/contexts/discovery-sources/@types/DiscoverySources.d.ts", | |
| "code": "declare namespace DiscoverySources {\n type Context = {\n sources: Source[];\n isLoadingSources: boolean;\n errorLoadingSources?: Error;\n isDeletingSource: boolean;\n errorDeletingSource?: Error;\n isDownloadingSource: boolean;\n errorDownloadingSource?: Error;\n isPolling: boolean;\n sourceSelected: Source;\n listSources: () => Promise<Source[]>;\n deleteSource: (id: string) => Promise<Source>;\n downloadSource: (sourceSshKey: string) => Promise<void>;\n startPolling: (delay: number) => void;\n stopPolling: () => void;\n selectSource: (source:Source) => void;\n agents: Agent[]|undefined;\n isLoadingAgents: boolean;\n errorLoadingAgents?: Error;\n listAgents: () => Promise<Agent[]>;\n deleteAgent: (agent: Agent) => Promise<Agent>;\n isDeletingAgent: boolean;\n errorDeletingAgent?: Error;\n selectAgent: (agent:Agent) => void;\n agentSelected: Agent;\n selectSourceById: (sourceId:string)=>void;\n };\n}\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "5b7ec1db-756e-42bc-8988-641730416d82", | |
| "name": "UseComputedHeightFromPageHeader.ts", | |
| "imports": "[{'import_name': ['useState', 'useEffect'], 'import_path': 'react'}, {'import_name': ['useWindowSize'], 'import_path': 'react-use'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/hooks/UseComputedHeightFromPageHeader.ts", | |
| "code": "import { useState, useEffect } from \"react\";\nimport { useWindowSize } from \"react-use\";\n\nconst DEFAULT_HEIGHT = 635;\n\nfunction getMainPageSectionVerticalPadding(pageMainSection: Element): number {\n const { paddingTop, paddingBottom } = getComputedStyle(pageMainSection);\n const value =\n parseFloat(paddingTop.slice(0, -2)) +\n parseFloat(paddingBottom.slice(0, -2));\n\n return value;\n}\n\nexport function useComputedHeightFromPageHeader(): number {\n const { height: windowInnerHeight } = useWindowSize();\n const [height, setHeight] = useState(DEFAULT_HEIGHT);\n\n useEffect(() => {\n const basePageHeader = document.getElementById(\"base-page__header\");\n if (basePageHeader) {\n const pageMainSection = basePageHeader.nextElementSibling;\n if (pageMainSection) {\n const mainPageSectionVerticalPadding =\n getMainPageSectionVerticalPadding(pageMainSection);\n const { height: basePageHeaderHeight } =\n basePageHeader.getBoundingClientRect();\n setHeight(\n windowInnerHeight -\n basePageHeaderHeight -\n mainPageSectionVerticalPadding\n );\n }\n }\n }, [windowInnerHeight]);\n\n return height;\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "91a4188f-ecaf-4316-9000-12185e2d3bca", | |
| "name": "getMainPageSectionVerticalPadding", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/hooks/UseComputedHeightFromPageHeader.ts", | |
| "code": "function getMainPageSectionVerticalPadding(pageMainSection: Element): number {\n const { paddingTop, paddingBottom } = getComputedStyle(pageMainSection);\n const value =\n parseFloat(paddingTop.slice(0, -2)) +\n parseFloat(paddingBottom.slice(0, -2));\n\n return value;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c6b43112-85c9-4a6c-a10e-60054f404d3b", | |
| "name": "useComputedHeightFromPageHeader", | |
| "imports": "[{'import_name': ['useState', 'useEffect'], 'import_path': 'react'}, {'import_name': ['useWindowSize'], 'import_path': 'react-use'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/hooks/UseComputedHeightFromPageHeader.ts", | |
| "code": "function useComputedHeightFromPageHeader(): number {\n const { height: windowInnerHeight } = useWindowSize();\n const [height, setHeight] = useState(DEFAULT_HEIGHT);\n\n useEffect(() => {\n const basePageHeader = document.getElementById(\"base-page__header\");\n if (basePageHeader) {\n const pageMainSection = basePageHeader.nextElementSibling;\n if (pageMainSection) {\n const mainPageSectionVerticalPadding =\n getMainPageSectionVerticalPadding(pageMainSection);\n const { height: basePageHeaderHeight } =\n basePageHeader.getBoundingClientRect();\n setHeight(\n windowInnerHeight -\n basePageHeaderHeight -\n mainPageSectionVerticalPadding\n );\n }\n }\n }, [windowInnerHeight]);\n\n return height;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1b53edb2-097c-4dc0-9730-d3c970b1d784", | |
| "name": "ConnectStep.tsx", | |
| "imports": "[{'import_name': ['useCallback', 'useEffect', 'useState'], 'import_path': 'react'}, {'import_name': ['Stack', 'StackItem', 'TextContent', 'Text', 'Panel', 'PanelMain', 'PanelHeader', 'List', 'OrderType', 'ListItem', 'Icon', 'Alert', 'Button'], 'import_path': '@patternfly/react-core'}, {'import_name': ['chart_color_blue_300', 'blueColor'], 'import_path': '@patternfly/react-tokens/dist/esm/chart_color_blue_300'}, {'import_name': ['ClusterIcon', 'PlusCircleIcon'], 'import_path': '@patternfly/react-icons'}, {'import_name': ['SourcesTable'], 'import_path': '#/migration-wizard/steps/connect/sources-table/SourcesTable'}, {'import_name': ['useDiscoverySources'], 'import_path': '#/migration-wizard/contexts/discovery-sources/Context'}, {'import_name': ['DiscoverySourceSetupModal'], 'import_path': './sources-table/empty-state/DiscoverySourceSetupModal'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/connect/ConnectStep.tsx", | |
| "code": "import React, { useCallback, useEffect, useState } from \"react\";\nimport {\n Stack,\n StackItem,\n TextContent,\n Text,\n Panel,\n PanelMain,\n PanelHeader,\n List,\n OrderType,\n ListItem,\n Icon,\n Alert,\n Button,\n} from \"@patternfly/react-core\";\nimport { chart_color_blue_300 as blueColor } from \"@patternfly/react-tokens/dist/esm/chart_color_blue_300\";\nimport { ClusterIcon, PlusCircleIcon } from \"@patternfly/react-icons\";\nimport { SourcesTable } from \"#/migration-wizard/steps/connect/sources-table/SourcesTable\";\nimport { useDiscoverySources } from \"#/migration-wizard/contexts/discovery-sources/Context\";\nimport { DiscoverySourceSetupModal } from \"./sources-table/empty-state/DiscoverySourceSetupModal\";\n\nexport const ConnectStep: React.FC = () => {\n const discoverySourcesContext = useDiscoverySources();\n const [\n shouldShowDiscoverySourceSetupModal,\n setShouldShowDiscoverySetupModal,\n ] = useState(false);\n\n const toggleDiscoverySourceSetupModal = useCallback((): void => {\n setShouldShowDiscoverySetupModal((lastState) => !lastState);\n }, []);\n const hasAgents = discoverySourcesContext.agents && discoverySourcesContext.agents.length > 0;\n const [firstAgent, ..._otherAgents] = discoverySourcesContext.agents || [];\n \n useEffect(() => {\n if (!discoverySourcesContext.agentSelected && firstAgent) {\n discoverySourcesContext.selectAgent(firstAgent);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [firstAgent]);\n\n return (\n <Stack hasGutter>\n <StackItem>\n <TextContent>\n <Text component=\"h2\">Connect your VMware environment</Text>\n </TextContent>\n </StackItem>\n <StackItem>\n <TextContent style={{ paddingBlock: \"1rem\" }}>\n <Text component=\"h4\">\n Follow these steps to connect your environment and start the\n discovery process\n </Text>\n <List\n component=\"ol\"\n type={OrderType.number}\n style={{ marginInlineStart: 0 }}\n >\n <ListItem>\n To add a new source download and import a discovery OVA file to your VMware environment.\n </ListItem>\n <ListItem>\n A link will appear below once the VM is running. Use this link to\n enter credentials and connect your environment.\n </ListItem>\n <ListItem>\n When the connection is established, you will be able to proceed\n and see the discovery report.\n </ListItem>\n </List>\n </TextContent> \n </StackItem>\n <StackItem>\n <Panel variant=\"bordered\">\n <PanelMain>\n <PanelHeader style={{ paddingBlockEnd: 0 }}>\n <TextContent>\n <Text component=\"h3\">\n <Icon isInline style={{ marginRight: \"1rem\" }}>\n <ClusterIcon />\n </Icon>\n Environment\n </Text>\n </TextContent>\n </PanelHeader>\n <SourcesTable />\n </PanelMain>\n </Panel>\n </StackItem>\n <StackItem>\n {hasAgents && (\n <Button\n variant=\"secondary\"\n onClick={toggleDiscoverySourceSetupModal}\n style={{ marginTop: \"1rem\" }}\n icon={<PlusCircleIcon color={blueColor.value} />}\n >\n Add source\n </Button>\n )}\n {shouldShowDiscoverySourceSetupModal && (\n <DiscoverySourceSetupModal\n isOpen={shouldShowDiscoverySourceSetupModal}\n onClose={toggleDiscoverySourceSetupModal}\n isDisabled={discoverySourcesContext.isDownloadingSource}\n onSubmit={async (event) => {\n const form = event.currentTarget;\n const sshKey = form[\"discoverySourceSshKey\"].value as string;\n await discoverySourcesContext.downloadSource(sshKey);\n toggleDiscoverySourceSetupModal();\n //await discoverySourcesContext.listSources();\n await discoverySourcesContext.listAgents();\n }}\n />\n )}\n </StackItem>\n <StackItem>\n {discoverySourcesContext.isDownloadingSource && (\n <Alert isInline variant=\"info\" title=\"Download OVA image\">\n The OVA image is downloading\n </Alert>\n )}\n </StackItem>\n <StackItem>\n {discoverySourcesContext.errorDownloadingSource && (\n <Alert isInline variant=\"danger\" title=\"Download Source error\">\n {discoverySourcesContext.errorDownloadingSource.message}\n </Alert>\n )}\n </StackItem>\n </Stack>\n );\n};\n\nConnectStep.displayName = \"ConnectStep\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c6dfb082-2dab-4a3c-be8e-bc211d410f70", | |
| "name": "Columns.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/connect/sources-table/Columns.ts", | |
| "code": "export const enum Columns {\n CredentialsUrl = \"Credentials URL\",\n Status = \"Status\",\n Hosts = \"Hosts\",\n VMs = \"VMs\",\n Networks = \"Networks\",\n Datastores = \"Datastores\",\n Actions = \"Actions\",\n}\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ae92eef6-fd20-48ca-a4cf-4b8fd5c57159", | |
| "name": "Constants.ts", | |
| "imports": "[{'import_name': ['Time'], 'import_path': '#/common/Time'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/connect/sources-table/Constants.ts", | |
| "code": "import { Time } from \"#/common/Time\";\n\nexport const VALUE_NOT_AVAILABLE = \"-\";\nexport const DEFAULT_POLLING_DELAY = 3 * Time.Second;\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "0cf58daf-6ada-4c0e-a3df-07f2b2723e8e", | |
| "name": "SourceStatusView.tsx", | |
| "imports": "[{'import_name': ['useMemo'], 'import_path': 'react'}, {'import_name': ['Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['Button', 'Icon', 'Popover', 'Spinner', 'Split', 'SplitItem', 'TextContent', 'Text'], 'import_path': '@patternfly/react-core'}, {'import_name': ['DisconnectedIcon', 'ExclamationCircleIcon', 'CheckCircleIcon', 'InfoCircleIcon'], 'import_path': '@patternfly/react-icons'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/connect/sources-table/SourceStatusView.tsx", | |
| "code": "import React, { useMemo } from \"react\";\nimport type { Source } from \"@migration-planner-ui/api-client/models\";\nimport {\n Button,\n Icon,\n Popover,\n Spinner,\n Split,\n SplitItem,\n TextContent,\n Text,\n} from \"@patternfly/react-core\";\nimport {\n DisconnectedIcon,\n ExclamationCircleIcon,\n CheckCircleIcon,\n InfoCircleIcon,\n} from \"@patternfly/react-icons\";\nimport globalDangerColor200 from \"@patternfly/react-tokens/dist/esm/global_danger_color_200\";\nimport globalInfoColor100 from \"@patternfly/react-tokens/dist/esm/global_info_color_100\";\nimport globalSuccessColor100 from \"@patternfly/react-tokens/dist/esm/global_success_color_100\";\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace SourceStatusView {\n export type Props = {\n status: Source[\"status\"];\n statusInfo?: Source[\"statusInfo\"];\n };\n}\n\nexport const SourceStatusView: React.FC<SourceStatusView.Props> = (props) => {\n const { status, statusInfo } = props;\n\n const statusView = useMemo(() => {\n // eslint-disable-next-line prefer-const\n let fake: Source['status'] | null = null;\n // fake = \"not-connected\";\n // fake = \"waiting-for-credentials\";\n // fake = \"gathering-initial-inventory\";\n // fake = \"up-to-date\";\n // fake = \"error\";\n switch (fake ?? status) {\n case \"not-connected\":\n return {\n icon: (\n <Icon isInline>\n <DisconnectedIcon />\n </Icon>\n ),\n text: \"Not connected\",\n };\n case \"waiting-for-credentials\":\n return {\n icon: (\n <Icon size=\"md\" isInline>\n <InfoCircleIcon color={globalInfoColor100.value} />\n </Icon>\n ),\n text: \"Waiting for credentials\",\n };\n case \"gathering-initial-inventory\":\n return {\n icon: (\n <Icon size=\"md\" isInline>\n <Spinner />\n </Icon>\n ),\n text: \"Gathering inventory\",\n };\n case \"error\":\n return {\n icon: (\n <Icon size=\"md\" isInline>\n <ExclamationCircleIcon color={globalDangerColor200.value} />\n </Icon>\n ),\n text: \"Error\",\n };\n case \"up-to-date\":\n return {\n icon: (\n <Icon size=\"md\" isInline>\n <CheckCircleIcon color={globalSuccessColor100.value} />\n </Icon>\n ),\n text: \"Up to date\",\n };\n }\n }, [status]);\n\n return (\n <Split hasGutter style={{ gap: \"0.66rem\" }}>\n <SplitItem>{statusView.icon}</SplitItem>\n <SplitItem>\n {statusInfo ? (\n <Popover\n aria-label={statusView.text}\n headerContent={statusView.text}\n headerComponent=\"h1\"\n bodyContent={\n <TextContent>\n <Text>{statusInfo}</Text>\n </TextContent>\n }\n >\n <Button variant=\"link\" isInline>\n {statusView.text}\n </Button>\n </Popover>\n ) : (\n statusView.text\n )}\n </SplitItem>\n </Split>\n );\n};\n\nSourceStatusView.displayName = \"SourceStatusView\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "36f57882-d53b-4519-9461-27fbb80a35b1", | |
| "name": "SourcesTable.tsx", | |
| "imports": "[{'import_name': ['useEffect'], 'import_path': 'react'}, {'import_name': ['useMount', 'useUnmount'], 'import_path': 'react-use'}, {'import_name': ['Table', 'Thead', 'Tr', 'Th', 'Tbody', 'Td'], 'import_path': '@patternfly/react-table'}, {'import_name': ['EmptyState'], 'import_path': './empty-state/EmptyState'}, {'import_name': ['RemoveSourceAction'], 'import_path': './actions/RemoveSourceAction'}, {'import_name': ['Columns'], 'import_path': './Columns'}, {'import_name': ['DEFAULT_POLLING_DELAY', 'VALUE_NOT_AVAILABLE'], 'import_path': './Constants'}, {'import_name': ['SourceStatusView'], 'import_path': './SourceStatusView'}, {'import_name': ['useDiscoverySources'], 'import_path': '#/migration-wizard/contexts/discovery-sources/Context'}, {'import_name': ['Radio', 'Spinner'], 'import_path': '@patternfly/react-core'}, {'import_name': ['Link'], 'import_path': 'react-router-dom'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/connect/sources-table/SourcesTable.tsx", | |
| "code": "import React, { useEffect } from \"react\";\nimport { useMount, useUnmount } from \"react-use\";\nimport { Table, Thead, Tr, Th, Tbody, Td } from \"@patternfly/react-table\";\nimport { EmptyState } from \"./empty-state/EmptyState\";\nimport { RemoveSourceAction } from \"./actions/RemoveSourceAction\";\nimport { Columns } from \"./Columns\";\nimport { DEFAULT_POLLING_DELAY, VALUE_NOT_AVAILABLE } from \"./Constants\";\nimport { SourceStatusView } from \"./SourceStatusView\";\nimport { useDiscoverySources } from \"#/migration-wizard/contexts/discovery-sources/Context\";\nimport { Radio, Spinner } from \"@patternfly/react-core\";\nimport { Link } from \"react-router-dom\";\n\nexport const SourcesTable: React.FC = () => {\n const discoverySourcesContext = useDiscoverySources();\n const hasAgents = discoverySourcesContext.agents && discoverySourcesContext.agents.length > 0;\n const [firstAgent, ..._otherAgents] = discoverySourcesContext.agents ?? [];\n\n useMount(async () => {\n if (!discoverySourcesContext.isPolling) {\n await Promise.all([\n discoverySourcesContext.listSources(),\n discoverySourcesContext.listAgents()\n ]);\n }\n });\n\n useUnmount(() => {\n discoverySourcesContext.stopPolling();\n });\n\n useEffect(() => {\n if (\n [\"error\", \"up-to-date\"].includes(\n discoverySourcesContext.agentSelected?.status\n )\n ) {\n discoverySourcesContext.stopPolling();\n return;\n } else {\n discoverySourcesContext.startPolling(DEFAULT_POLLING_DELAY);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [discoverySourcesContext.agentSelected?.status]);\n\n if (\n (discoverySourcesContext.agentSelected === undefined || \n discoverySourcesContext.sourceSelected === undefined) &&\n !(discoverySourcesContext.agentSelected?.length === 0 || \n discoverySourcesContext.sourceSelected?.length === 0)\n ) {\n return <Spinner />; // Loading agent and source\n }\n return (\n <Table aria-label=\"Sources table\" variant=\"compact\" borders={false}>\n {hasAgents && (\n <Thead>\n <Tr>\n <Th>{Columns.CredentialsUrl}</Th>\n <Th>{Columns.Status}</Th>\n <Th>{Columns.Hosts}</Th>\n <Th>{Columns.VMs}</Th>\n <Th>{Columns.Networks}</Th>\n <Th>{Columns.Datastores}</Th>\n <Th>{Columns.Actions}</Th>\n </Tr>\n </Thead>\n )}\n <Tbody>\n {hasAgents ? (\n discoverySourcesContext.agents && discoverySourcesContext.agents.map((agent) => {\n const source = discoverySourcesContext.sourceSelected;\n return(\n \n <Tr key={agent.id}>\n <Td dataLabel={Columns.CredentialsUrl}>\n {\" \"}\n <Radio\n id={agent.id}\n name=\"source-selection\"\n label={\n agent.credentialUrl !== \"Example report\" ? (\n <Link to={agent.credentialUrl} target=\"_blank\">\n {agent.credentialUrl}\n </Link>\n ) : (\n agent.credentialUrl\n )\n }\n isChecked={\n discoverySourcesContext.agentSelected\n ? discoverySourcesContext.agentSelected?.id === agent.id\n : firstAgent.id === agent.id\n }\n onChange={() => discoverySourcesContext.selectAgent(agent)}\n />\n </Td>\n <Td dataLabel={Columns.Status}>\n <SourceStatusView\n status={agent.status}\n statusInfo={agent.statusInfo}\n />\n </Td>\n <Td dataLabel={Columns.Hosts}>\n {source!==null && source.inventory?.infra.totalHosts || VALUE_NOT_AVAILABLE}\n </Td>\n <Td dataLabel={Columns.VMs}>\n {source!==null && source.inventory?.vms.total || VALUE_NOT_AVAILABLE}\n </Td>\n <Td dataLabel={Columns.Networks}>\n {((source!==null && source.inventory?.infra.networks) ?? []).length ||\n VALUE_NOT_AVAILABLE}\n </Td>\n <Td dataLabel={Columns.Datastores}>\n {((source!==null && source.inventory?.infra.datastores) ?? []).length ||\n VALUE_NOT_AVAILABLE}\n </Td>\n <Td dataLabel={Columns.Actions}>\n {agent.credentialUrl !== \"Example report\" && (<RemoveSourceAction\n sourceId={agent.id}\n isDisabled={discoverySourcesContext.isDeletingSource}\n onConfirm={async (event) => {\n event.stopPropagation();\n await discoverySourcesContext.deleteAgent(agent); \n event.dismissConfirmationModal(); \n await discoverySourcesContext.listAgents();\n await discoverySourcesContext.listSources();\n }}\n />)}\n </Td>\n </Tr>\n )})\n ) : (\n <Tr>\n <Td colSpan={12}>\n <EmptyState />\n </Td>\n </Tr>\n )}\n </Tbody>\n </Table>\n );\n};\n\nSourcesTable.displayName = \"SourcesTable\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c895fa70-c667-4b87-9cda-dc3b15fef0d3", | |
| "name": "RemoveSourceAction.tsx", | |
| "imports": "[{'import_name': ['useCallback', 'useState'], 'import_path': 'react'}, {'import_name': ['Tooltip', 'Button', 'Icon', 'TextContent', 'Text'], 'import_path': '@patternfly/react-core'}, {'import_name': ['TrashIcon'], 'import_path': '@patternfly/react-icons'}, {'import_name': ['ConfirmationModal'], 'import_path': '#/components/ConfirmationModal'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/connect/sources-table/actions/RemoveSourceAction.tsx", | |
| "code": "import React, { useCallback, useState } from \"react\";\nimport {\n Tooltip,\n Button,\n Icon,\n TextContent,\n Text,\n} from \"@patternfly/react-core\";\nimport { TrashIcon } from \"@patternfly/react-icons\";\nimport { ConfirmationModal } from \"#/components/ConfirmationModal\";\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace RemoveSourceAction {\n export type ConfirmEventHandler = (\n event: React.MouseEvent<HTMLButtonElement, MouseEvent> & {\n dismissConfirmationModal: () => void;\n showConfirmationModal: () => void;\n }\n ) => void;\n export type Props = {\n sourceId: string;\n isDisabled: boolean;\n onConfirm?: ConfirmEventHandler;\n };\n}\n\nexport const RemoveSourceAction: React.FC<RemoveSourceAction.Props> = (\n props\n) => {\n const { sourceId, isDisabled = false, onConfirm } = props;\n\n const [shouldShowConfirmationModal, setShouldShowConfirmationModal] =\n useState(false);\n const dismissConfirmationModal = useCallback((): void => {\n setShouldShowConfirmationModal(false);\n }, []);\n const showConfirmationModal = useCallback((): void => {\n setShouldShowConfirmationModal(true);\n }, []);\n\n const handleConfirm = useCallback<RemoveSourceAction.ConfirmEventHandler>(\n (event) => {\n if (onConfirm) {\n event.dismissConfirmationModal = dismissConfirmationModal;\n onConfirm(event);\n }\n },\n [dismissConfirmationModal, onConfirm]\n );\n\n return (\n <>\n <Tooltip content=\"Remove\">\n <Button\n data-source-id={sourceId}\n variant=\"plain\"\n isDisabled={isDisabled}\n onClick={showConfirmationModal}\n >\n <Icon size=\"md\" isInline>\n <TrashIcon />\n </Icon>\n </Button>\n </Tooltip>\n {onConfirm && shouldShowConfirmationModal && (\n <ConfirmationModal\n title=\"Remove discovery source?\"\n titleIconVariant=\"warning\"\n primaryButtonVariant=\"danger\"\n isOpen={shouldShowConfirmationModal}\n isDisabled={isDisabled}\n onCancel={dismissConfirmationModal}\n onConfirm={handleConfirm}\n >\n <TextContent>\n <Text id=\"confirmation-modal-description\">\n The discovery information will be lost.\n </Text>\n </TextContent>\n </ConfirmationModal>\n )}\n </>\n );\n};\n\nRemoveSourceAction.displayName = \"RemoveSourceAction\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "33f37ac8-d89f-42bd-bbc7-892bc6cac0a9", | |
| "name": "DiscoverySourceSetupModal.tsx", | |
| "imports": "[{'import_name': ['useCallback', 'useState'], 'import_path': 'react'}, {'import_name': ['Button', 'Form', 'FormGroup', 'FormHelperText', 'HelperText', 'HelperTextItem', 'TextArea'], 'import_path': '@patternfly/react-core'}, {'import_name': ['Modal', 'ModalBody', 'ModalFooter', 'ModalHeader'], 'import_path': '@patternfly/react-core/next'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/connect/sources-table/empty-state/DiscoverySourceSetupModal.tsx", | |
| "code": "import React, { useCallback, useState } from \"react\";\nimport {\n Button,\n Form,\n FormGroup,\n FormHelperText,\n HelperText,\n HelperTextItem,\n TextArea,\n} from \"@patternfly/react-core\";\nimport {\n Modal,\n ModalBody,\n ModalFooter,\n ModalHeader,\n} from \"@patternfly/react-core/next\";\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace DiscoverySourceSetupModal {\n export type Props = {\n isOpen?: boolean;\n isDisabled?: boolean;\n onClose?: ((event: KeyboardEvent | React.MouseEvent) => void) | undefined;\n onSubmit: React.FormEventHandler<HTMLFormElement> | undefined;\n };\n}\n\nexport const DiscoverySourceSetupModal: React.FC<\n DiscoverySourceSetupModal.Props\n> = (props) => {\n const { isOpen = false, isDisabled = false, onClose, onSubmit } = props;\n const [sshKey, setSshKey] = useState(\"\");\n const [sshKeyError, setSshKeyError] = useState<string | null>(null);\n\n const validateSshKey = useCallback((key: string): string | null => {\n // SSH key validation regex patterns\n const SSH_KEY_PATTERNS = {\n RSA: /^ssh-rsa\\s+[A-Za-z0-9+/]+[=]{0,2}(\\s+.*)?$/,\n ED25519: /^ssh-ed25519\\s+[A-Za-z0-9+/]+[=]{0,2}(\\s+.*)?$/,\n ECDSA: /^ssh-(ecdsa|sk-ecdsa)-sha2-nistp[0-9]+\\s+[A-Za-z0-9+/]+[=]{0,2}(\\s+.*)?$/,\n };\n\n // Optional field, so empty is valid\n if (!key) return null;\n\n // Check if the key matches any of the known SSH key formats\n const isValidKey = Object.values(SSH_KEY_PATTERNS).some(pattern => pattern.test(key.trim()));\n\n return isValidKey ? null : \"Invalid SSH key format. Please provide a valid SSH public key.\";\n }, []);\n\n const handleSshKeyChange = (value: string): void => {\n setSshKey(value);\n setSshKeyError(validateSshKey(value));\n };\n\n const handleSubmit = useCallback<React.FormEventHandler<HTMLFormElement>>(\n (event) => {\n event.preventDefault();\n\n // Validate SSH key before submission\n const keyValidationError = validateSshKey(sshKey);\n if (keyValidationError) {\n setSshKeyError(keyValidationError);\n return;\n }\n\n if (onSubmit) {\n onSubmit(event);\n }\n },\n [onSubmit, sshKey, validateSshKey]\n );\n\n return (\n <Modal\n variant=\"small\"\n isOpen={isOpen}\n onClose={onClose}\n ouiaId=\"DiscoverySourceSetupModal\"\n aria-labelledby=\"discovery-source-setup-modal-title\"\n aria-describedby=\"modal-box-body-discovery-source-setup\"\n >\n <ModalHeader\n title=\"Discovery source setup\"\n labelId=\"discovery-source-setup-modal-title\"\n />\n <ModalBody id=\"modal-box-body-discovery-source-setup\">\n <Form\n noValidate={false}\n id=\"discovery-source-setup-form\"\n onSubmit={handleSubmit}\n >\n <FormGroup\n label=\"SSH Key\"\n fieldId=\"discovery-source-sshkey-form-control\"\n >\n <TextArea\n id=\"discovery-source-sshkey-form-control\"\n name=\"discoverySourceSshKey\"\n value={sshKey}\n onChange={(_, value) => handleSshKeyChange(value)}\n type=\"text\"\n placeholder=\"Example: ssh-rsa AAAAB3NzaC1yc2E...\"\n aria-describedby=\"sshkey-helper-text\"\n validated={sshKeyError ? 'error' : 'default'}\n />\n <FormHelperText>\n <HelperText>\n <HelperTextItem variant={sshKeyError ? 'error' : 'default'} id=\"sshkey-helper-text\">\n {sshKeyError || \"Enter your SSH public key for the 'core' user to enable SSH access to the OVA image.\"}\n </HelperTextItem>\n </HelperText>\n </FormHelperText>\n </FormGroup>\n </Form>\n </ModalBody>\n <ModalFooter>\n <Button\n form=\"discovery-source-setup-form\"\n type=\"submit\"\n key=\"confirm\"\n variant=\"primary\"\n isDisabled={isDisabled || !!sshKeyError}\n >\n Download OVA Image\n </Button>\n </ModalFooter>\n </Modal>\n );\n};\n\nDiscoverySourceSetupModal.displayName = \"DiscoverySourceSetupModal\";\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "582278e8-2e3c-4a3c-80f3-02e22ed4d491", | |
| "name": "DiscoverySourceSetupModal", | |
| "imports": "[{'import_name': ['useCallback', 'useState'], 'import_path': 'react'}, {'import_name': ['Button', 'Form', 'FormGroup', 'FormHelperText', 'HelperText', 'HelperTextItem', 'TextArea'], 'import_path': '@patternfly/react-core'}, {'import_name': ['Modal', 'ModalBody', 'ModalFooter', 'ModalHeader'], 'import_path': '@patternfly/react-core/next'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/connect/sources-table/empty-state/DiscoverySourceSetupModal.tsx", | |
| "code": "DiscoverySourceSetupModal: React.FC<\n DiscoverySourceSetupModal.Props\n> = (props) => {\n const { isOpen = false, isDisabled = false, onClose, onSubmit } = props;\n const [sshKey, setSshKey] = useState(\"\");\n const [sshKeyError, setSshKeyError] = useState<string | null>(null);\n\n const validateSshKey = useCallback((key: string): string | null => {\n // SSH key validation regex patterns\n const SSH_KEY_PATTERNS = {\n RSA: /^ssh-rsa\\s+[A-Za-z0-9+/]+[=]{0,2}(\\s+.*)?$/,\n ED25519: /^ssh-ed25519\\s+[A-Za-z0-9+/]+[=]{0,2}(\\s+.*)?$/,\n ECDSA: /^ssh-(ecdsa|sk-ecdsa)-sha2-nistp[0-9]+\\s+[A-Za-z0-9+/]+[=]{0,2}(\\s+.*)?$/,\n };\n\n // Optional field, so empty is valid\n if (!key) return null;\n\n // Check if the key matches any of the known SSH key formats\n const isValidKey = Object.values(SSH_KEY_PATTERNS).some(pattern => pattern.test(key.trim()));\n\n return isValidKey ? null : \"Invalid SSH key format. Please provide a valid SSH public key.\";\n }, []);\n\n const handleSshKeyChange = (value: string): void => {\n setSshKey(value);\n setSshKeyError(validateSshKey(value));\n };\n\n const handleSubmit = useCallback<React.FormEventHandler<HTMLFormElement>>(\n (event) => {\n event.preventDefault();\n\n // Validate SSH key before submission\n const keyValidationError = validateSshKey(sshKey);\n if (keyValidationError) {\n setSshKeyError(keyValidationError);\n return;\n }\n\n if (onSubmit) {\n onSubmit(event);\n }\n },\n [onSubmit, sshKey, validateSshKey]\n );\n\n return (\n <Modal\n variant=\"small\"\n isOpen={isOpen}\n onClose={onClose}\n ouiaId=\"DiscoverySourceSetupModal\"\n aria-labelledby=\"discovery-source-setup-modal-title\"\n aria-describedby=\"modal-box-body-discovery-source-setup\"\n >\n <ModalHeader\n title=\"Discovery source setup\"\n labelId=\"discovery-source-setup-modal-title\"\n />\n <ModalBody id=\"modal-box-body-discovery-source-setup\">\n <Form\n noValidate={false}\n id=\"discovery-source-setup-form\"\n onSubmit={handleSubmit}\n >\n <FormGroup\n label=\"SSH Key\"\n fieldId=\"discovery-source-sshkey-form-control\"\n >\n <TextArea\n id=\"discovery-source-sshkey-form-control\"\n name=\"discoverySourceSshKey\"\n value={sshKey}\n onChange={(_, value) => handleSshKeyChange(value)}\n type=\"text\"\n placeholder=\"Example: ssh-rsa AAAAB3NzaC1yc2E...\"\n aria-describedby=\"sshkey-helper-text\"\n validated={sshKeyError ? 'error' : 'default'}\n />\n <FormHelperText>\n <HelperText>\n <HelperTextItem variant={sshKeyError ? 'error' : 'default'} id=\"sshkey-helper-text\">\n {sshKeyError || \"Enter your SSH public key for the 'core' user to enable SSH access to the OVA image.\"}\n </HelperTextItem>\n </HelperText>\n </FormHelperText>\n </FormGroup>\n </Form>\n </ModalBody>\n <ModalFooter>\n <Button\n form=\"discovery-source-setup-form\"\n type=\"submit\"\n key=\"confirm\"\n variant=\"primary\"\n isDisabled={isDisabled || !!sshKeyError}\n >\n Download OVA Image\n </Button>\n </ModalFooter>\n </Modal>\n );\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c66cf6bf-d5c3-456f-ac11-bc8929b49354", | |
| "name": "EmptyState.tsx", | |
| "imports": "[{'import_name': ['useCallback', 'useState'], 'import_path': 'react'}, {'import_name': ['Button', 'EmptyState', 'PFEmptyState', 'EmptyStateActions', 'EmptyStateBody', 'EmptyStateFooter', 'EmptyStateHeader', 'EmptyStateIcon'], 'import_path': '@patternfly/react-core'}, {'import_name': ['ExclamationCircleIcon', 'SearchIcon'], 'import_path': '@patternfly/react-icons'}, {'import_name': ['useDiscoverySources'], 'import_path': '#/migration-wizard/contexts/discovery-sources/Context'}, {'import_name': ['DiscoverySourceSetupModal'], 'import_path': './DiscoverySourceSetupModal'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/connect/sources-table/empty-state/EmptyState.tsx", | |
| "code": "import React, { useCallback, useState } from \"react\";\nimport {\n Button,\n EmptyState as PFEmptyState,\n EmptyStateActions,\n EmptyStateBody,\n EmptyStateFooter,\n EmptyStateHeader,\n EmptyStateIcon,\n} from \"@patternfly/react-core\";\nimport { ExclamationCircleIcon, SearchIcon } from \"@patternfly/react-icons\";\nimport globalDangerColor200 from \"@patternfly/react-tokens/dist/esm/global_danger_color_200\";\nimport { useDiscoverySources } from \"#/migration-wizard/contexts/discovery-sources/Context\";\nimport { DiscoverySourceSetupModal } from \"./DiscoverySourceSetupModal\";\n\nexport const EmptyState: React.FC = () => {\n const discoverySourcesContext = useDiscoverySources();\n\n const [\n shouldShowDiscoverySourceSetupModal,\n setShouldShowDiscoverySetupModal,\n ] = useState(false);\n\n const toggleDiscoverySourceSetupModal = useCallback((): void => {\n setShouldShowDiscoverySetupModal((lastState) => !lastState);\n }, []);\n\n const handleTryAgain = useCallback(() => {\n if (!discoverySourcesContext.isLoadingAgents) {\n //discoverySourcesContext.listSources();\n discoverySourcesContext.listAgents();\n }\n }, [discoverySourcesContext]);\n\n let emptyStateNode: React.ReactNode = (\n <PFEmptyState variant=\"sm\">\n <EmptyStateHeader\n titleText=\"No discovery source found\"\n headingLevel=\"h4\"\n icon={<EmptyStateIcon icon={SearchIcon} />}\n />\n <EmptyStateBody>\n Begin by creating a discovery source. Then download and import the OVA\n file into your VMware environment.\n </EmptyStateBody>\n <EmptyStateFooter>\n <EmptyStateActions>\n <Button\n variant=\"secondary\"\n onClick={toggleDiscoverySourceSetupModal}\n >\n Create\n </Button>\n </EmptyStateActions>\n </EmptyStateFooter>\n </PFEmptyState>\n );\n\n if (discoverySourcesContext.errorLoadingSources) {\n emptyStateNode = (\n <PFEmptyState variant=\"sm\">\n <EmptyStateHeader\n titleText=\"Something went wrong...\"\n headingLevel=\"h4\"\n icon={\n <EmptyStateIcon\n icon={ExclamationCircleIcon}\n color={globalDangerColor200.value}\n />\n }\n />\n <EmptyStateBody>\n An error occurred while attempting to detect existing discovery\n sources\n </EmptyStateBody>\n <EmptyStateFooter>\n <EmptyStateActions>\n <Button variant=\"link\" onClick={handleTryAgain}>\n Try again\n </Button>\n </EmptyStateActions>\n </EmptyStateFooter>\n </PFEmptyState>\n );\n }\n\n return (\n <>\n {emptyStateNode}\n {shouldShowDiscoverySourceSetupModal && (\n <DiscoverySourceSetupModal\n isOpen={shouldShowDiscoverySourceSetupModal}\n onClose={toggleDiscoverySourceSetupModal}\n isDisabled={discoverySourcesContext.isDownloadingSource}\n onSubmit={async (event) => {\n const form = event.currentTarget;\n const sshKey = form[\"discoverySourceSshKey\"].value as string;\n await discoverySourcesContext.downloadSource(sshKey);\n toggleDiscoverySourceSetupModal();\n await discoverySourcesContext.listAgents();\n }}\n />\n )}\n </>\n );\n};\n\nEmptyState.displayName = \"SourcesTableEmptyState\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "7ac392df-07f6-4932-bee6-7e3271e6f8a1", | |
| "name": "DiscoveryStep.tsx", | |
| "imports": "[{'import_name': ['Stack', 'StackItem', 'Icon', 'Text', 'TextContent', 'TreeView', 'TreeViewDataItem', 'Badge', 'Flex', 'FlexItem', 'Progress'], 'import_path': '@patternfly/react-core'}, {'import_name': ['CogsIcon', 'DatabaseIcon', 'ExclamationCircleIcon', 'ExclamationTriangleIcon', 'HddIcon', 'InfrastructureIcon', 'MicrochipIcon', 'NetworkIcon', 'VirtualMachineIcon'], 'import_path': '@patternfly/react-icons'}, {'import_name': ['InfraDatastoresInner', 'InfraNetworksInner', 'MigrationIssuesInner', 'Source'], 'import_path': '@migration-planner-ui/api-client/models'}, {'import_name': ['useDiscoverySources'], 'import_path': '#/migration-wizard/contexts/discovery-sources/Context'}, {'import_name': ['ReportTable'], 'import_path': './ReportTable'}, {'import_name': ['ReportPieChart'], 'import_path': './ReportPieChart'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/DiscoveryStep.tsx", | |
| "code": "import React from \"react\";\nimport Humanize from \"humanize-plus\";\nimport {\n Stack,\n StackItem,\n Icon,\n Text,\n TextContent,\n TreeView,\n TreeViewDataItem,\n Badge,\n Flex,\n FlexItem,\n Progress,\n} from \"@patternfly/react-core\";\nimport {\n CogsIcon,\n DatabaseIcon,\n ExclamationCircleIcon,\n ExclamationTriangleIcon,\n HddIcon,\n InfrastructureIcon,\n MicrochipIcon,\n NetworkIcon,\n VirtualMachineIcon,\n} from \"@patternfly/react-icons\";\nimport globalWarningColor100 from \"@patternfly/react-tokens/dist/esm/global_warning_color_100\";\nimport globalDangerColor100 from \"@patternfly/react-tokens/dist/esm/global_danger_color_100\";\nimport type {\n InfraDatastoresInner,\n InfraNetworksInner,\n MigrationIssuesInner,\n Source,\n} from \"@migration-planner-ui/api-client/models\";\nimport { useDiscoverySources } from \"#/migration-wizard/contexts/discovery-sources/Context\";\nimport { ReportTable } from \"./ReportTable\";\nimport { ReportPieChart } from \"./ReportPieChart\";\n\nexport const DiscoveryStep: React.FC = () => {\n const discoverSourcesContext = useDiscoverySources();\n const { inventory } = discoverSourcesContext.sourceSelected as Source;\n const { infra, vms } = inventory!;\n const {\n datastores,\n networks,\n } = infra;\n const { cpuCores, ramGB, diskCount, diskGB, os } = vms;\n const operatingSystems = Object.entries(os).map(([name, count]) => ({\n name,\n count,\n }));\n const totalDistributedSwitches = networks.filter(\n (net) => net.type === \"distributed\"\n ).length;\n\n const infrastructureViewData: TreeViewDataItem = {\n title: \"Infrastructure\",\n icon: <InfrastructureIcon />,\n name: (\n <>\n We found {infra.totalClusters}{\" \"}\n {Humanize.pluralize(infra.totalClusters, \"cluster\")} with{\" \"}\n {infra.totalHosts} {Humanize.pluralize(infra.totalHosts, \"host\")}. The\n hosts have a total of {cpuCores.total} CPU cores and{\" \"}\n {Humanize.fileSize(ramGB.total * 1024 ** 3, 0)} of memory.\n </>\n ),\n id: \"infra\",\n };\n\n const computeStatsViewData: TreeViewDataItem = {\n title: \"Compute per VM\",\n icon: <MicrochipIcon />,\n id: \"compute\",\n name: \"\",\n children: [\n {\n title: \"Details\",\n id: \"compute-details\",\n name: (\n <Flex\n fullWidth={{ default: \"fullWidth\" }}\n spaceItems={{ default: \"spaceItems4xl\" }}\n >\n <FlexItem>\n <ReportPieChart\n histogram={cpuCores.histogram}\n title=\"CPU Cores\"\n legendLabel=\"CPU Cores\"\n />\n </FlexItem>\n <FlexItem>\n <ReportPieChart\n histogram={ramGB.histogram}\n title=\"Memory\"\n legendLabel=\"GB\"\n />\n </FlexItem>\n </Flex>\n ),\n },\n ],\n };\n\n const diskStatsViewData: TreeViewDataItem = {\n title: \"Disk size per VM\",\n icon: <HddIcon />,\n name: (\n <>\n The size of the virtual machine disk (VMDK) impacts the migration\n process duration due to the time required to copy the file to the\n OpenShift cluster and the time needed for disk format conversion.\n </>\n ),\n id: \"disk-size\",\n children: [\n {\n title: \"Details\",\n id: \"infra-details\",\n name: (\n <Flex\n fullWidth={{ default: \"fullWidth\" }}\n spaceItems={{ default: \"spaceItems4xl\" }}\n >\n <FlexItem>\n <ReportPieChart\n histogram={diskGB.histogram}\n title=\"Disk capacity\"\n legendLabel=\"GB\"\n />\n </FlexItem>\n <FlexItem>\n <ReportPieChart\n histogram={diskCount.histogram}\n title=\"Number of disks\"\n legendLabel=\"Disks\"\n />\n </FlexItem>\n </Flex>\n ),\n },\n ],\n };\n\n const virtualMachinesViewData: TreeViewDataItem = {\n title: \"Virtual machines\",\n icon: <VirtualMachineIcon />,\n name: (\n <>\n This environment consists of {vms.total} virtual machines,{\" \"}\n {vms.total === (vms.totalMigratableWithWarnings ?? 0)\n ? \"All\"\n : vms.totalMigratableWithWarnings}{\" \"}\n of them are potentially migratable to a new OpenShift cluster.\n </>\n ),\n id: \"vms\",\n children: [\n {\n name: (\n <TextContent>\n <Text>\n Warnings{\" \"}\n <Badge isRead>\n {vms.migrationWarnings\n .map(({ count }) => count)\n .reduce((sum, n) => sum + n, 0)}\n </Badge>\n </Text>\n </TextContent>\n ),\n icon: (\n <Icon style={{ color: globalWarningColor100.value }}>\n <ExclamationTriangleIcon />\n </Icon>\n ),\n id: \"migration-warnings\",\n children: [\n {\n name: (\n <ReportTable<MigrationIssuesInner>\n data={vms.migrationWarnings}\n columns={[\"Total\", \"Description\"]}\n fields={[\"count\", \"assessment\"]}\n />\n ),\n id: \"migration-warnings-details\",\n },\n ],\n },\n vms.notMigratableReasons.length > 0\n ? {\n name: (\n <TextContent>\n <Text>\n Not migratable reasons{\" \"}\n <Badge isRead>\n {vms.migrationWarnings\n .map(({ count }) => count)\n .reduce((sum, n) => sum + n, 0)}\n </Badge>\n </Text>\n </TextContent>\n ),\n icon: (\n <Icon style={{ color: globalDangerColor100.value }}>\n <ExclamationCircleIcon />\n </Icon>\n ),\n id: \"not-migratable\",\n children: [\n {\n name: (\n <ReportTable<MigrationIssuesInner>\n data={vms.notMigratableReasons}\n columns={[\"Total\", \"Description\"]}\n fields={[\"count\", \"assessment\"]}\n />\n ),\n id: \"not-migratable-details\",\n },\n ],\n }\n : null,\n computeStatsViewData,\n diskStatsViewData,\n ].filter(Boolean) as TreeViewDataItem[],\n };\n\n const networksViewData: TreeViewDataItem = {\n title: \"Networks\",\n icon: <NetworkIcon />,\n name: (\n <>\n We found {networks.length} networks.{\" \"}\n {networks.length === totalDistributedSwitches\n ? \"All\"\n : totalDistributedSwitches}{\" \"}\n of them are connected to a distibuted switch.\n </>\n ),\n id: \"networks\",\n children: [\n {\n title: \"Details\",\n name: (\n <ReportTable<InfraNetworksInner>\n data={networks}\n columns={[\"Name\", \"Type\", \"VlanId\"]}\n fields={[\"name\", \"type\", \"vlanId\"]}\n />\n ),\n id: \"networks-details\",\n }\n ],\n };\n\n const storageViewData: TreeViewDataItem = {\n title: \"Storage\",\n icon: <DatabaseIcon />,\n name: (\n <>\n The environment consists of {datastores.length} datastores with a total\n capacity of{\" \"}\n {Humanize.fileSize(\n datastores\n .map((ds) => ds.totalCapacityGB)\n .reduce((sum, next) => sum + next, 0) *\n 1024 ** 3\n )}\n .\n </>\n ),\n id: \"storage\",\n children: [\n {\n title: \"Datastores\",\n name: (\n <ReportTable<\n InfraDatastoresInner & {\n usage: JSX.Element;\n }\n >\n data={datastores.map((ds) => ({\n ...ds,\n usage: (\n <div style={{ width: \"200px\" }}>\n <Progress\n value={(ds.freeCapacityGB / ds.totalCapacityGB) * 100}\n size=\"sm\"\n />\n </div>\n ),\n }))}\n columns={[\"Total\", \"Free\", \"Type\", \"Usage %\"]}\n fields={[\"totalCapacityGB\", \"freeCapacityGB\", \"type\", \"usage\"]}\n />\n ),\n id: \"datastores\",\n },\n ],\n };\n\n const operatingSystemsViewData: TreeViewDataItem = {\n title: \"Operating systems\",\n icon: <CogsIcon />,\n name: (\n <>These are the operating systems running on your virtual machines.</>\n ),\n id: \"os\",\n children: [\n {\n title: \"Details\",\n name: (\n <ReportTable<{ name: string; count: number }>\n data={operatingSystems}\n columns={[\"Count\", \"Name\"]}\n fields={[\"count\", \"name\"]}\n style={{ width: \"25rem\" }}\n />\n ),\n id: \"os-details\",\n },\n ],\n };\n\n const treeViewData: Array<TreeViewDataItem> = [\n infrastructureViewData,\n virtualMachinesViewData,\n networksViewData,\n storageViewData,\n operatingSystemsViewData,\n ];\n\n return (\n <Stack hasGutter>\n <StackItem>\n <TextContent>\n <Text component=\"h2\">Discovery report</Text>\n <Text component=\"p\">\n Review the information collected during the discovery process\n </Text>\n </TextContent>\n </StackItem>\n <StackItem>\n <TreeView\n aria-label=\"Discovery report\"\n variant=\"compactNoBackground\"\n data={treeViewData}\n />\n </StackItem>\n </Stack>\n );\n};\n\nDiscoveryStep.displayName = \"DiscoveryStep\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "e5125d18-a270-4e78-8bc2-e64cd7ea76f0", | |
| "name": "ReportBarChart.tsx", | |
| "imports": "[{'import_name': ['Chart', 'ChartVoronoiContainer', 'ChartAxis', 'ChartGroup', 'ChartBar'], 'import_path': '@patternfly/react-charts'}, {'import_name': ['TextContent', 'Text'], 'import_path': '@patternfly/react-core'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/ReportBarChart.tsx", | |
| "code": "import React from \"react\";\nimport {\n Chart,\n ChartVoronoiContainer,\n ChartAxis,\n ChartGroup,\n ChartBar,\n} from \"@patternfly/react-charts\";\nimport { TextContent, Text } from \"@patternfly/react-core\";\n\ntype ChartBarDataEntry = {\n name: string;\n x: string;\n y: number;\n};\n\nfunction histogramToBarChartData(\n histogram: ReportBarChart.Histogram,\n name: string,\n units: string = \"\"\n): ChartBarDataEntry[] {\n const { minValue, step, data } = histogram;\n return data.map((y, idx) => {\n const lo = step * idx + minValue;\n const hi = lo + step - 1;\n\n return {\n name,\n x: `${lo}-${hi}${units}`,\n y,\n };\n });\n}\n\nfunction getMax(histogram: ReportBarChart.Histogram): number {\n const [head, ..._] = histogram.data;\n return histogram.data.reduce((prev, next) => Math.max(prev, next), head);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReportBarChart {\n export type Histogram = {\n data: number[];\n minValue: number;\n step: number;\n };\n\n export type Props = {\n histogram: Histogram;\n title: string;\n };\n}\n\nexport function ReportBarChart(props: ReportBarChart.Props): React.ReactNode {\n const { title, histogram } = props;\n\n return (\n <>\n <TextContent style={{ textAlign: \"center\" }}>\n <Text>{title}</Text>\n </TextContent>\n <Chart\n name={title.toLowerCase().split(\" \").join(\"-\")}\n ariaDesc={title + \" chart\"}\n ariaTitle={title + \" chart\"}\n containerComponent={\n <ChartVoronoiContainer\n responsive\n labels={({ datum }) => `${datum.name}: ${datum.y}`}\n constrainToVisibleArea\n />\n }\n domain={{\n y: [0, getMax(histogram)],\n }}\n domainPadding={{ x: [10, 10] }}\n legendOrientation=\"horizontal\"\n legendPosition=\"bottom-left\"\n padding={75}\n width={600}\n height={250}\n >\n <ChartAxis />\n <ChartAxis dependentAxis showGrid />\n <ChartGroup>\n <ChartBar data={histogramToBarChartData(histogram, \"Count\")} />\n </ChartGroup>\n </Chart>\n </>\n );\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "0bdadd42-674b-493d-b77a-5765509cf5ea", | |
| "name": "histogramToBarChartData", | |
| "imports": "[{'import_name': ['Chart', 'ChartBar'], 'import_path': '@patternfly/react-charts'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/ReportBarChart.tsx", | |
| "code": "function histogramToBarChartData(\n histogram: ReportBarChart.Histogram,\n name: string,\n units: string = \"\"\n): ChartBarDataEntry[] {\n const { minValue, step, data } = histogram;\n return data.map((y, idx) => {\n const lo = step * idx + minValue;\n const hi = lo + step - 1;\n\n return {\n name,\n x: `${lo}-${hi}${units}`,\n y,\n };\n });\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "7dbf601a-9477-48f5-a8ca-d3d0940a3233", | |
| "name": "getMax", | |
| "imports": "[{'import_name': ['Chart'], 'import_path': '@patternfly/react-charts'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/ReportBarChart.tsx", | |
| "code": "function getMax(histogram: ReportBarChart.Histogram): number {\n const [head, ..._] = histogram.data;\n return histogram.data.reduce((prev, next) => Math.max(prev, next), head);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "55bcffb8-5d42-4b4b-894c-52a1e7828e9e", | |
| "name": "ReportPieChart.tsx", | |
| "imports": "[{'import_name': ['ChartPie'], 'import_path': '@patternfly/react-charts'}, {'import_name': ['TextContent', 'Text'], 'import_path': '@patternfly/react-core'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/ReportPieChart.tsx", | |
| "code": "import React from \"react\";\nimport { ChartPie } from \"@patternfly/react-charts\";\nimport { TextContent, Text } from \"@patternfly/react-core\";\n\ntype ChartBarDataEntry = {\n name: string;\n x: string;\n y: number;\n};\n\n\nfunction histogramToPieChartData(\n histogram: ReportPieChart.Histogram,\n legendLabel: string,\n): ChartBarDataEntry[] {\n const { data } = histogram;\n return data\n .filter(y => y > 0) // Filtrar valores mayores que 0\n .map((y, idx) => ({\n name: legendLabel,\n x: `${idx + 1} ${legendLabel}`, // Cambia esto seg\u00fan tus necesidades\n y,\n })).sort((a, b) => a.y - b.y);\n}\n\nfunction getLegendData( histogram: ReportPieChart.Histogram,legendLabel:string): { name: string; }[] {\n return histogramToPieChartData(histogram, '').map(d => ({ name: `${d.x} ${legendLabel}: ${d.y} VM` }))\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReportPieChart {\n export type Histogram = {\n data: number[];\n minValue: number;\n step: number;\n \n };\n\n export type Props = {\n histogram: Histogram;\n title: string;\n legendLabel: string;\n };\n}\n\nexport function ReportPieChart(props: ReportPieChart.Props): React.ReactNode {\n const { title, histogram,legendLabel } = props;\n return (\n <>\n <TextContent style={{ textAlign: \"center\" }}>\n <Text>{title}</Text>\n </TextContent>\n <ChartPie\n name={title.toLowerCase().split(\" \").join(\"-\")}\n ariaDesc={title + \" chart\"}\n ariaTitle={title + \" chart\"}\n constrainToVisibleArea\n data={histogramToPieChartData(histogram, legendLabel)}\n height={230}\n labels={({ datum }) => `${datum.x}: ${datum.y}`}\n legendData={getLegendData(histogram,legendLabel)}\n legendOrientation=\"vertical\"\n legendPosition=\"right\"\n padding={{\n bottom: 20,\n left: 20,\n right: 140, // Adjusted to accommodate legend\n top: 20,\n }}\n width={450}\n colorScale={['#73BCF7','#73C5C5','#F9E0A2','#BDE5B8','#D2D2D2','#F4B678','#CBC1FF','#FF7468','#7CDBF3','#E4F5BC']}/>\n \n </>\n );\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "cff60a11-5281-4464-827e-cab15b0c33a3", | |
| "name": "histogramToPieChartData", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/ReportPieChart.tsx", | |
| "code": "function histogramToPieChartData(\n histogram: ReportPieChart.Histogram,\n legendLabel: string,\n): ChartBarDataEntry[] {\n const { data } = histogram;\n return data\n .filter(y => y > 0) // Filtrar valores mayores que 0\n .map((y, idx) => ({\n name: legendLabel,\n x: `${idx + 1} ${legendLabel}`, // Cambia esto seg\u00fan tus necesidades\n y,\n })).sort((a, b) => a.y - b.y);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "3e54045e-51c8-4ce8-af7a-f66ff5e1f610", | |
| "name": "getLegendData", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/ReportPieChart.tsx", | |
| "code": "function getLegendData( histogram: ReportPieChart.Histogram,legendLabel:string): { name: string; }[] {\n return histogramToPieChartData(histogram, '').map(d => ({ name: `${d.x} ${legendLabel}: ${d.y} VM` }))\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c7b16667-ffb7-4d3b-a9ea-14c227472a1f", | |
| "name": "histogramToPieChartData", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/ReportPieChart.tsx", | |
| "code": "histogramToPieChartData(histogram, legendLabel)}\n height={230}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c5115fac-bc5a-4145-bbf6-a1ebfc498dd0", | |
| "name": "ReportTable.tsx", | |
| "imports": "[{'import_name': ['Table', 'Thead', 'Tr', 'Th', 'Tbody', 'Td'], 'import_path': '@patternfly/react-table'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/ReportTable.tsx", | |
| "code": "import { Table, Thead, Tr, Th, Tbody, Td } from \"@patternfly/react-table\";\nimport React from \"react\";\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReportTable {\n export type Props<DataList extends Array<unknown>> = {\n columns: string[];\n data: DataList;\n fields: Array<keyof DataList[0]>;\n style?: React.CSSProperties;\n };\n}\n\nexport function ReportTable<DataItem>(\n props: ReportTable.Props<DataItem[]>\n): React.ReactNode {\n const { columns, data, fields, style } = props;\n\n return (\n <Table\n variant=\"compact\"\n borders={true}\n style={{ border: \"1px solid lightgray\", borderRight: \"none\", ...style }}\n >\n <Thead>\n <Tr>\n {columns.map((name) => (\n <Th hasRightBorder>{name}</Th>\n ))}\n </Tr>\n </Thead>\n <Tbody>\n {data.map((item, idx) => (\n <Tr key={idx}>\n {fields.map((f) => (\n <Td hasRightBorder> {item[f] === \"\" ? \"-\" : (item[f] as React.ReactNode)}</Td>\n ))}\n </Tr>\n ))}\n </Tbody>\n </Table>\n );\n}\n\nReportTable.displayName = \"ReportTable\";\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "b2c1bbb0-1716-4a4f-a81a-a3efda95e1d1", | |
| "name": "ReportTable", | |
| "imports": "[{'import_name': ['Table', 'Thead', 'Tr', 'Th', 'Tbody', 'Td'], 'import_path': '@patternfly/react-table'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/discovery/ReportTable.tsx", | |
| "code": "function ReportTable<DataItem>(\n props: ReportTable.Props<DataItem[]>\n): React.ReactNode {\n const { columns, data, fields, style } = props;\n\n return (\n <Table\n variant=\"compact\"\n borders={true}\n style={{ border: \"1px solid lightgray\", borderRight: \"none\", ...style }}\n >\n <Thead>\n <Tr>\n {columns.map((name) => (\n <Th hasRightBorder>{name}</Th>\n ))}\n </Tr>\n </Thead>\n <Tbody>\n {data.map((item, idx) => (\n <Tr key={idx}>\n {fields.map((f) => (\n <Td hasRightBorder> {item[f] === \"\" ? \"-\" : (item[f] as React.ReactNode)}</Td>\n ))}\n </Tr>\n ))}\n </Tbody>\n </Table>\n );\n}\n\nReportTable.displayName = \"ReportTable\";", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a5fdc096-c464-4b3f-a1a8-7d41a9bea46a", | |
| "name": "PrepareMigrationStep.tsx", | |
| "imports": "[{'import_name': ['Stack', 'StackItem', 'TextContent', 'Text', 'Radio'], 'import_path': '@patternfly/react-core'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/migration-wizard/steps/prepare-migration/PrepareMigrationStep.tsx", | |
| "code": "import React from \"react\";\nimport {\n Stack,\n StackItem,\n TextContent,\n Text,\n Radio,\n} from \"@patternfly/react-core\";\n\nexport const PrepareMigrationStep: React.FC = () => {\n\n return (\n <Stack hasGutter>\n <StackItem>\n <TextContent>\n <Text component=\"h2\">Prepare for Migration</Text>\n </TextContent>\n </StackItem>\n <StackItem>\n <TextContent>\n <Text component=\"h3\">Migration goal</Text>\n </TextContent>\n </StackItem>\n <StackItem>\n <Radio\n id=\"lets-try\"\n label=\"Let's try\"\n name=\"lets-try\"\n description=\"Starting with a minimal cluster to try our migration flows and OpenShift Virtualization. (20 VMs or up to cluster capacity limitations)\"\n checked\n />\n </StackItem>\n <StackItem>\n <Radio\n id=\"feel-good\"\n label=\"Feeling good\"\n name=\"feel-good\"\n description=\"Create a cluster that can support a medium migration scale (500 VMs or up to cluster capacity limitations)\"\n isDisabled\n />\n </StackItem>\n <StackItem>\n <Radio\n id=\"got-this\"\n label=\"I got this\"\n name=\"got-this\"\n description=\"Create a cluster that can support a big migration scale (5000 VMs or up to cluster capacity limitations)\"\n isDisabled\n />\n </StackItem>\n <StackItem>\n <TextContent style={{ paddingBlock: \"1rem\" }}>\n <Text component=\"h3\">Target cluster</Text>\n </TextContent>\n </StackItem>\n <StackItem>\n <Radio\n id=\"new-cluster\"\n label=\"New cluster\"\n name=\"new-cluster\"\n description=\"Let's use our OpenShift assisted installer to create a new bare metal cluster\"\n checked\n />\n </StackItem>\n <StackItem>\n <Radio\n id=\"use-existing-cluster\"\n label=\"Use existing cluster\"\n name=\"use-existing-cluster\"\n description=\"Choose one of your OpenShift cluster\"\n isDisabled\n />\n </StackItem>\n <StackItem>\n <Radio\n id=\"use-sandbox\"\n label=\"Use OpenShift developer sandbox (Coming Soon)\"\n name=\"use-sandabox\"\n description=\"\"\n isDisabled\n />\n </StackItem>\n </Stack>\n );\n};\n\nPrepareMigrationStep.displayName = \"PrepareMigrationStep\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "313cc0c0-6d2e-4d83-b291-de96307c0da5", | |
| "name": "OpenShiftIcon.tsx", | |
| "imports": "[{'import_name': ['SVGIcon'], 'import_path': '#/components/SVGIcon'}, {'import_name': ['css'], 'import_path': '@emotion/css'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/ocm/OpenShiftIcon.tsx", | |
| "code": "import React from \"react\";\nimport { SVGIcon } from \"#/components/SVGIcon\";\nimport { css } from \"@emotion/css\";\n\nconst classes = {\n root: css({\n width: \"3rem\",\n height: \"3rem\",\n }),\n};\n\nexport const OpenShiftIcon: React.FC = () => (\n <SVGIcon className={classes.root} viewBox=\"0 0 38 38\">\n <path d=\"M28,1H10a9,9,0,0,0-9,9V28a9,9,0,0,0,9,9H28a9,9,0,0,0,9-9V10a9,9,0,0,0-9-9Z\" />\n <path\n fill=\"#fff\"\n d=\"M10.09863,22.18994a.625.625,0,0,1-.25488-1.1958l2.74072-1.22021a.62492.62492,0,1,1,.50879,1.1416l-2.74072,1.22021A.619.619,0,0,1,10.09863,22.18994Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M8.832,25.49072a.625.625,0,0,1-.25488-1.1958l2.74023-1.22021a.62492.62492,0,1,1,.50879,1.1416L9.08594,25.43652A.61731.61731,0,0,1,8.832,25.49072Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M26.42773,14.91943a.62473.62473,0,0,1-.2539-1.1958L28.915,12.50342a.62472.62472,0,1,1,.50781,1.1416l-2.74121,1.22021A.61563.61563,0,0,1,26.42773,14.91943Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M25.16113,18.22021a.62473.62473,0,0,1-.2539-1.1958l2.74023-1.22021a.62472.62472,0,1,1,.50781,1.1416L25.415,18.166A.61581.61581,0,0,1,25.16113,18.22021Z\"\n />\n <path\n fill=\"#e00\"\n d=\"M18.95166,28.63379A9.593,9.593,0,0,1,12.8291,26.4165a.625.625,0,0,1,.7959-.96386,8.37943,8.37943,0,0,0,13.71289-6.1045.61006.61006,0,0,1,.65039-.59814.6249.6249,0,0,1,.59766.65088,9.65521,9.65521,0,0,1-9.63428,9.23291Z\"\n />\n <path\n fill=\"#e00\"\n d=\"M9.97461,19.22607l-.02881-.00048a.62539.62539,0,0,1-.59619-.65284A9.6291,9.6291,0,0,1,25.10547,11.5835a.62531.62531,0,0,1-.79688.96386,8.37815,8.37815,0,0,0-13.71,6.082A.62532.62532,0,0,1,9.97461,19.22607Z\"\n />\n </SVGIcon>\n);\n\nOpenShiftIcon.displayName = \"OpenShiftIcon\";\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "0dba0b4b-3da5-449b-b099-34dae6e135c7", | |
| "name": "OpenShiftIcon", | |
| "imports": "[{'import_name': ['SVGIcon'], 'import_path': '#/components/SVGIcon'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/ocm/OpenShiftIcon.tsx", | |
| "code": "OpenShiftIcon: React.FC = () => (\n <SVGIcon className={classes.root} viewBox=\"0 0 38 38\">\n <path d=\"M28,1H10a9,9,0,0,0-9,9V28a9,9,0,0,0,9,9H28a9,9,0,0,0,9-9V10a9,9,0,0,0-9-9Z\" />\n <path\n fill=\"#fff\"\n d=\"M10.09863,22.18994a.625.625,0,0,1-.25488-1.1958l2.74072-1.22021a.62492.62492,0,1,1,.50879,1.1416l-2.74072,1.22021A.619.619,0,0,1,10.09863,22.18994Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M8.832,25.49072a.625.625,0,0,1-.25488-1.1958l2.74023-1.22021a.62492.62492,0,1,1,.50879,1.1416L9.08594,25.43652A.61731.61731,0,0,1,8.832,25.49072Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M26.42773,14.91943a.62473.62473,0,0,1-.2539-1.1958L28.915,12.50342a.62472.62472,0,1,1,.50781,1.1416l-2.74121,1.22021A.61563.61563,0,0,1,26.42773,14.91943Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M25.16113,18.22021a.62473.62473,0,0,1-.2539-1.1958l2.74023-1.22021a.62472.62472,0,1,1,.50781,1.1416L25.415,18.166A.61581.61581,0,0,1,25.16113,18.22021Z\"\n />\n <path\n fill=\"#e00\"\n d=\"M18.95166,28.63379A9.593,9.593,0,0,1,12.8291,26.4165a.625.625,0,0,1,.7959-.96386,8.37943,8.37943,0,0,0,13.71289-6.1045.61006.61006,0,0,1,.65039-.59814.6249.6249,0,0,1,.59766.65088,9.65521,9.65521,0,0,1-9.63428,9.23291Z\"\n />\n <path\n fill=\"#e00\"\n d=\"M9.97461,19.22607l-.02881-.00048a.62539.62539,0,0,1-.59619-.65284A9.6291,9.6291,0,0,1,25.10547,11.5835a.62531.62531,0,0,1-.79688.96386,8.37815,8.37815,0,0,0-13.71,6.082A.62532.62532,0,0,1,9.97461,19.22607Z\"\n />\n </SVGIcon>\n)", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ad889a90-56d4-49cf-a199-7872ac5e6cba", | |
| "name": "VMwareMigrationCard.tsx", | |
| "imports": "[{'import_name': ['Card', 'CardHeader', 'Split', 'SplitItem', 'Label', 'CardBody', 'Title', 'Text', 'TextContent', 'CardFooter', 'Flex', 'FlexItem', 'Button'], 'import_path': '@patternfly/react-core'}, {'import_name': ['css'], 'import_path': '@emotion/css'}, {'import_name': ['Link'], 'import_path': 'react-router-dom'}, {'import_name': ['OpenShiftIcon'], 'import_path': './OpenShiftIcon'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/ocm/VMwareMigrationCard.tsx", | |
| "code": "import React from \"react\";\nimport {\n Card,\n CardHeader,\n Split,\n SplitItem,\n Label,\n CardBody,\n Title,\n Text,\n TextContent,\n CardFooter,\n Flex,\n FlexItem,\n Button,\n} from \"@patternfly/react-core\";\nimport { css } from \"@emotion/css\";\nimport { Link } from \"react-router-dom\";\nimport { OpenShiftIcon } from \"./OpenShiftIcon\";\n\nconst classes = {\n cardRoot: css({ width: \"22em\", height: \"22em\" }),\n};\n\nexport const VMwareMigrationCard: React.FC = () => {\n return (\n <Card className={classes.cardRoot}>\n <CardHeader>\n <Split hasGutter>\n <SplitItem>\n <OpenShiftIcon />\n </SplitItem>\n <SplitItem isFilled />\n <SplitItem>\n <Label color=\"blue\">Self-managed service</Label>\n </SplitItem>\n </Split>\n </CardHeader>\n <CardBody>\n <Title headingLevel=\"h2\">VMware to OpenShift migration</Title>\n </CardBody>\n <CardBody>\n <TextContent>\n <Text>\n Start your migration journey to OpenShift Virtualization. We will\n create a migration assessment report and help you create a migration\n plan.\n </Text>\n </TextContent>\n </CardBody>\n <CardFooter>\n <Flex>\n <FlexItem>\n <Link to=\"/migrate/wizard\">\n <Button variant=\"secondary\">Start your migration journey</Button>\n </Link>\n </FlexItem>\n </Flex>\n </CardFooter>\n </Card>\n );\n};\n\nVMwareMigrationCard.displayName = \"VMwareMigrationCard\";\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d2c4db10-f524-463c-9273-1a24ea1db472", | |
| "name": "VMwareMigrationCard", | |
| "imports": "[{'import_name': ['Card', 'CardHeader', 'Split', 'SplitItem', 'Label', 'CardBody', 'Title', 'Text', 'TextContent', 'CardFooter', 'Flex', 'FlexItem', 'Button'], 'import_path': '@patternfly/react-core'}, {'import_name': ['Link'], 'import_path': 'react-router-dom'}, {'import_name': ['OpenShiftIcon'], 'import_path': './OpenShiftIcon'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/ocm/VMwareMigrationCard.tsx", | |
| "code": "VMwareMigrationCard: React.FC = () => {\n return (\n <Card className={classes.cardRoot}>\n <CardHeader>\n <Split hasGutter>\n <SplitItem>\n <OpenShiftIcon />\n </SplitItem>\n <SplitItem isFilled />\n <SplitItem>\n <Label color=\"blue\">Self-managed service</Label>\n </SplitItem>\n </Split>\n </CardHeader>\n <CardBody>\n <Title headingLevel=\"h2\">VMware to OpenShift migration</Title>\n </CardBody>\n <CardBody>\n <TextContent>\n <Text>\n Start your migration journey to OpenShift Virtualization. We will\n create a migration assessment report and help you create a migration\n plan.\n </Text>\n </TextContent>\n </CardBody>\n <CardFooter>\n <Flex>\n <FlexItem>\n <Link to=\"/migrate/wizard\">\n <Button variant=\"secondary\">Start your migration journey</Button>\n </Link>\n </FlexItem>\n </Flex>\n </CardFooter>\n </Card>\n );\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d1b7e6c1-c447-4788-af0f-58c4948e0673", | |
| "name": "MigrationAssessmentPage.tsx", | |
| "imports": "[{'import_name': ['Link'], 'import_path': 'react-router-dom'}, {'import_name': ['Bullseye', 'Button', 'Card', 'CardBody', 'CardHeader', 'Flex', 'FlexItem', 'Icon', 'Stack', 'StackItem', 'Text', 'TextContent'], 'import_path': '@patternfly/react-core'}, {'import_name': ['ClusterIcon', 'MigrationIcon'], 'import_path': '@patternfly/react-icons'}, {'import_name': ['AppPage'], 'import_path': '#/components/AppPage'}, {'import_name': ['CustomEnterpriseIcon'], 'import_path': '#/components/CustomEnterpriseIcon'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/pages/MigrationAssessmentPage.tsx", | |
| "code": "import React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport {\n Bullseye,\n Button,\n Card,\n CardBody,\n CardHeader,\n Flex,\n FlexItem,\n Icon,\n Stack,\n StackItem,\n Text,\n TextContent,\n} from \"@patternfly/react-core\";\nimport { ClusterIcon, MigrationIcon } from \"@patternfly/react-icons\";\nimport globalActiveColor300 from \"@patternfly/react-tokens/dist/esm/global_active_color_300\";\nimport { AppPage } from \"#/components/AppPage\";\nimport { CustomEnterpriseIcon } from \"#/components/CustomEnterpriseIcon\";\n\nconst cards: React.ReactElement[] = [\n <Card isFullHeight isPlain key=\"card-1\">\n <CardHeader>\n <TextContent style={{ textAlign: \"center\" }}>\n <Icon size=\"xl\" style={{ color: globalActiveColor300.var }}>\n <CustomEnterpriseIcon />\n </Icon>\n <Text component=\"h2\">Discover your VMware environment</Text>\n </TextContent>\n </CardHeader>\n <CardBody>\n <TextContent style={{ textAlign: \"center\" }}>\n <Text>\n Run the discovery process and create a full evaluation report\n including recommendations for your migration journey.\n <a href=\"/example_report.pdf\" download>\n <Button size=\"sm\" variant=\"link\">\n See an example report.\n </Button>\n </a>\n </Text>\n </TextContent>\n </CardBody>\n </Card>,\n\n <Card isFullHeight isPlain key=\"card-2\">\n <CardHeader>\n <TextContent style={{ textAlign: \"center\" }}>\n <Icon size=\"xl\" style={{ color: globalActiveColor300.var }}>\n <ClusterIcon />\n </Icon>\n <Text component=\"h2\">Select a target cluster</Text>\n </TextContent>\n </CardHeader>\n <CardBody>\n <TextContent style={{ textAlign: \"center\" }}>\n <Text>\n Select your target OpenShift Cluster to fit your migration goals.\n </Text>\n </TextContent>\n </CardBody>\n </Card>,\n\n <Card isFullHeight isPlain key=\"card-3\">\n <CardHeader>\n <TextContent style={{ textAlign: \"center\" }}>\n <Icon size=\"xl\" style={{ color: globalActiveColor300.var }}>\n <MigrationIcon />\n </Icon>\n <Text component=\"h2\">Create a migration plan</Text>\n </TextContent>\n </CardHeader>\n <CardBody>\n <TextContent style={{ textAlign: \"center\" }}>\n <Text>\n Select your VMs, create a network and storage mapping and schedule\n your migration timeline\n </Text>\n </TextContent>\n </CardBody>\n </Card>,\n];\n\nconst MigrationAssessmentPage: React.FC = () => (\n <AppPage\n breadcrumbs={[\n {\n key: 1,\n to: \"#\",\n children: \"Migration assessment\",\n isActive: true,\n },\n ]}\n title=\"Welcome, let's start your migration journey from VMware to OpenShift.\"\n >\n <Bullseye>\n <Stack hasGutter style={{ justifyContent: \"space-evenly\" }}>\n <StackItem>\n <Flex>\n {cards.map((card) => (\n <FlexItem flex={{ default: \"flex_1\" }} key={card.key}>\n {card}\n </FlexItem>\n ))}\n </Flex>\n </StackItem>\n <StackItem style={{ alignSelf: \"center\" }}>\n <Link to=\"/migrate/wizard\">\n <Button>Start your migration journey</Button>\n </Link>\n </StackItem>\n </Stack>\n </Bullseye>\n </AppPage>\n);\n\nMigrationAssessmentPage.displayName = \"MigrationAssessmentPage\";\n\nexport default MigrationAssessmentPage;\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "64e445ae-afa2-4e16-af1d-db5a39a4a170", | |
| "name": "MigrationWizardPage.tsx", | |
| "imports": "[{'import_name': ['AppPage'], 'import_path': '#/components/AppPage'}, {'import_name': ['MigrationWizard'], 'import_path': '#/migration-wizard/MigrationWizard'}, {'import_name': ['Provider', 'DiscoverySourcesProvider'], 'import_path': '#/migration-wizard/contexts/discovery-sources/Provider'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/pages/MigrationWizardPage.tsx", | |
| "code": "import React from \"react\";\nimport { AppPage } from \"#/components/AppPage\";\nimport { MigrationWizard } from \"#/migration-wizard/MigrationWizard\";\nimport { Provider as DiscoverySourcesProvider } from \"#/migration-wizard/contexts/discovery-sources/Provider\";\n\nconst MigrationWizardPage: React.FC = () => {\n return (\n <AppPage\n breadcrumbs={[\n { key: 1, to: \"/migrate\", children: \"Migration assessment\" },\n { key: 2, to: \"#\", children: \"Guide\", isActive: true },\n ]}\n title=\"Welcome, let's start your migration journey from VMware to OpenShift.\"\n >\n <DiscoverySourcesProvider>\n <MigrationWizard />\n </DiscoverySourcesProvider>\n </AppPage>\n );\n};\n\nMigrationWizardPage.displayName = \"MigrationWizardPage\";\n\nexport default MigrationWizardPage;\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "b37c7923-f802-4e66-bb85-202b998a9b47", | |
| "name": "OcmPreviewPage.tsx", | |
| "imports": "[{'import_name': ['Bullseye'], 'import_path': '@patternfly/react-core'}, {'import_name': ['AppPage'], 'import_path': '#/components/AppPage'}, {'import_name': ['VMwareMigrationCard'], 'import_path': '#/ocm/VMwareMigrationCard'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/apps/demo/src/pages/OcmPreviewPage.tsx", | |
| "code": "import React from \"react\";\nimport { Bullseye } from \"@patternfly/react-core\";\nimport { AppPage } from \"#/components/AppPage\";\nimport { VMwareMigrationCard } from \"#/ocm/VMwareMigrationCard\";\n\nconst OcmPreviewPage: React.FC = () => {\n return (\n <AppPage title=\"VMware Migration Assessment Card for OCM\">\n <Bullseye>\n <VMwareMigrationCard />\n </Bullseye>\n </AppPage>\n );\n};\n\nOcmPreviewPage.displayName = \"OcmPreviewPage\";\n\nexport default OcmPreviewPage;\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "766551e6-4caf-4652-98d4-14a51e781612", | |
| "name": "AgentApi.ts", | |
| "imports": "[{'import_name': ['Either', 'Credentials', 'StatusReply', 'CredentialsError'], 'import_path': '#/models/'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/apis/AgentApi.ts", | |
| "code": "import {\n type Either,\n type Credentials,\n type StatusReply,\n CredentialsError,\n} from \"#/models/\";\n\ninterface Configuration {\n basePath: string;\n}\n\nexport interface AgentApiInterface {\n putCredentials(\n credentials: Credentials,\n options?: RequestInit & { pathParams?: string[] }\n ): Promise<Either<number, CredentialsError>>;\n getStatus(options?: RequestInit): Promise<StatusReply>;\n getAgentVersion():Promise<string>;\n getServiceUiUrl():Promise<string>;\n}\n\nexport class AgentApi implements AgentApiInterface {\n private readonly configuration: Configuration;\n\n constructor(configuration: Configuration) {\n this.configuration = configuration;\n }\n\n async getStatus(options?: RequestInit): Promise<StatusReply> {\n const request = new Request(this.configuration.basePath + \"/status\", {\n method: \"GET\",\n ...(options?.signal && { signal: options.signal }),\n });\n\n const response = await fetch(request);\n const statusReply = (await response.json()) as StatusReply;\n return statusReply;\n }\n\n async putCredentials(\n credentials: Credentials,\n options?: RequestInit & { pathParams?: string[] }\n ): Promise<Either<number, CredentialsError>> {\n const request = new Request(this.configuration.basePath + \"/credentials\", {\n method: \"PUT\",\n body: JSON.stringify(credentials),\n ...(options?.signal && { signal: options.signal }),\n });\n\n const response = await fetch(request);\n if (response.ok) {\n return [response.status, null];\n } else {\n let message = response.statusText;\n const error = new CredentialsError(response.status, message);\n if (response.arrayBuffer.length > 0) {\n message = await response.text();\n error.message = message;\n }\n\n return [null, error];\n }\n }\n\n async getAgentVersion(): Promise<string> {\n const request = new Request(this.configuration.basePath + \"/version\", {\n method: \"GET\"\n });\n\n const response = await fetch(request);\n const statusReply = (await response.json()) as { version: string };\n return statusReply.version;\n }\n async getServiceUiUrl(): Promise<string> {\n const request = new Request(this.configuration.basePath + \"/url\", {\n method: \"GET\"\n });\n\n const response = await fetch(request);\n const uiReply = (await response.json()) as { url: string };\n return uiReply.url;\n }\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "47f02ec9-e5d0-433f-a52f-078ca67f24cc", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/apis/AgentApi.ts", | |
| "code": "constructor(configuration: Configuration) {\n this.configuration = configuration;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "AgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "30c621c0-1e9f-4608-8203-47cd2d2bdf96", | |
| "name": "getStatus", | |
| "imports": "[{'import_name': ['StatusReply'], 'import_path': '#/models/'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/apis/AgentApi.ts", | |
| "code": "async getStatus(options?: RequestInit): Promise<StatusReply> {\n const request = new Request(this.configuration.basePath + \"/status\", {\n method: \"GET\",\n ...(options?.signal && { signal: options.signal }),\n });\n\n const response = await fetch(request);\n const statusReply = (await response.json()) as StatusReply;\n return statusReply;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "AgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d5c462a8-b56b-40bc-bf46-f28208af09ba", | |
| "name": "putCredentials", | |
| "imports": "[{'import_name': ['Either', 'Credentials', 'CredentialsError'], 'import_path': '#/models/'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/apis/AgentApi.ts", | |
| "code": "async putCredentials(\n credentials: Credentials,\n options?: RequestInit & { pathParams?: string[] }\n ): Promise<Either<number, CredentialsError>> {\n const request = new Request(this.configuration.basePath + \"/credentials\", {\n method: \"PUT\",\n body: JSON.stringify(credentials),\n ...(options?.signal && { signal: options.signal }),\n });\n\n const response = await fetch(request);\n if (response.ok) {\n return [response.status, null];\n } else {\n let message = response.statusText;\n const error = new CredentialsError(response.status, message);\n if (response.arrayBuffer.length > 0) {\n message = await response.text();\n error.message = message;\n }\n\n return [null, error];\n }\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "AgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "cc00e965-ad0b-4cf1-9daa-caa0d2a73bbb", | |
| "name": "getAgentVersion", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/apis/AgentApi.ts", | |
| "code": "async getAgentVersion(): Promise<string> {\n const request = new Request(this.configuration.basePath + \"/version\", {\n method: \"GET\"\n });\n\n const response = await fetch(request);\n const statusReply = (await response.json()) as { version: string };\n return statusReply.version;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "AgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "9f22bf00-1346-480d-bfcb-ab99400cc145", | |
| "name": "getServiceUiUrl", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/apis/AgentApi.ts", | |
| "code": "async getServiceUiUrl(): Promise<string> {\n const request = new Request(this.configuration.basePath + \"/url\", {\n method: \"GET\"\n });\n\n const response = await fetch(request);\n const uiReply = (await response.json()) as { url: string };\n return uiReply.url;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "AgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a20d4bb5-353f-45e2-9a63-f0bbed8b9745", | |
| "name": "index.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/apis/index.ts", | |
| "code": "export * from \"./AgentApi\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "25c5e0de-f7ca-4a1c-b623-92b1dcbf0f37", | |
| "name": "Credentials.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/models/Credentials.ts", | |
| "code": "export interface Credentials {\n url: string;\n username: string;\n password: string;\n isDataSharingAllowed?: boolean;\n}\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a45f1d97-59d3-446d-8411-1354c60d148e", | |
| "name": "CredentialsError.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/models/CredentialsError.ts", | |
| "code": "export class CredentialsError extends Error {\n #code?: number;\n\n constructor(code?: number, ...errorArgs: Parameters<ErrorConstructor>) {\n super(...errorArgs);\n this.#code = code;\n }\n\n toString(): string {\n const code = this.#code ? `code=${this.#code}` : \"\";\n return `${super.toString()} ${code}`;\n }\n\n get code(): number | undefined {\n return this.#code;\n }\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "6391392f-3d22-45ae-aa24-a02f6b09bbca", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/models/CredentialsError.ts", | |
| "code": "constructor(code?: number, ...errorArgs: Parameters<ErrorConstructor>) {\n super(...errorArgs);\n this.#code = code;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "CredentialsError" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "944af81a-c93a-4b23-8b56-abe2af1b463c", | |
| "name": "toString", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/models/CredentialsError.ts", | |
| "code": "toString(): string {\n const code = this.#code ? `code=${this.#code}` : \"\";\n return `${super.toString()} ${code}`;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "CredentialsError" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "e379b314-75f1-4440-9991-1e018418ef4e", | |
| "name": "code", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/models/CredentialsError.ts", | |
| "code": "get code(): number | undefined {\n return this.#code;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "CredentialsError" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "58e3e8fb-1ccf-41e8-ad1e-7136eef0b094", | |
| "name": "Either.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/models/Either.ts", | |
| "code": "export type Either<GoodType, BadType> = [GoodType, null] | [null, BadType];\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "bd8f6e53-b63e-43ad-ae7e-7d61389af309", | |
| "name": "SourceStatus.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/models/SourceStatus.ts", | |
| "code": "export enum SourceStatus {\n SourceStatusError = \"error\",\n SourceStatusGatheringInitialInventory = \"gathering-initial-inventory\",\n SourceStatusNotConnected = \"not-connected\",\n SourceStatusUpToDate = \"up-to-date\",\n SourceStatusWaitingForCredentials = \"waiting-for-credentials\",\n}\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "dbe7c3fb-3f6f-45a5-a595-39a5fd9098ff", | |
| "name": "StatusReply.ts", | |
| "imports": "[{'import_name': ['SourceStatus'], 'import_path': './SourceStatus'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/models/StatusReply.ts", | |
| "code": "import { SourceStatus } from \"./SourceStatus\";\n\nexport interface StatusReply {\n status: SourceStatus;\n statusInfo: string;\n}\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "eaf6fa93-4738-4b67-ad59-4637eb8fcd11", | |
| "name": "index.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/agent-client/src/models/index.ts", | |
| "code": "export * from \"./Credentials\";\nexport * from \"./StatusReply\";\nexport * from \"./SourceStatus\";\nexport * from \"./CredentialsError\";\nexport * from \"./Either\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "81d32f1f-25a3-488c-81e3-450847a12e6f", | |
| "name": "index.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/index.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\nexport * from './runtime';\nexport * from './apis/index';\nexport * from './models/index';\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "179299fb-db37-4c64-b4d7-a25a5880d0c0", | |
| "name": "runtime.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nexport const BASE_PATH = \"https://raw.githubusercontent.com\".replace(/\\/+$/, \"\");\n\nexport interface ConfigurationParameters {\n basePath?: string; // override base path\n fetchApi?: FetchAPI; // override for fetch implementation\n middleware?: Middleware[]; // middleware to apply before/after fetch requests\n queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings\n username?: string; // parameter for basic security\n password?: string; // parameter for basic security\n apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security\n accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security\n headers?: HTTPHeaders; //header params we want to use on every request\n credentials?: RequestCredentials; //value for the credentials param we want to use on each request\n}\n\nexport class Configuration {\n constructor(private configuration: ConfigurationParameters = {}) {}\n\n set config(configuration: Configuration) {\n this.configuration = configuration;\n }\n\n get basePath(): string {\n return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;\n }\n\n get fetchApi(): FetchAPI | undefined {\n return this.configuration.fetchApi;\n }\n\n get middleware(): Middleware[] {\n return this.configuration.middleware || [];\n }\n\n get queryParamsStringify(): (params: HTTPQuery) => string {\n return this.configuration.queryParamsStringify || querystring;\n }\n\n get username(): string | undefined {\n return this.configuration.username;\n }\n\n get password(): string | undefined {\n return this.configuration.password;\n }\n\n get apiKey(): ((name: string) => string | Promise<string>) | undefined {\n const apiKey = this.configuration.apiKey;\n if (apiKey) {\n return typeof apiKey === 'function' ? apiKey : () => apiKey;\n }\n return undefined;\n }\n\n get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {\n const accessToken = this.configuration.accessToken;\n if (accessToken) {\n return typeof accessToken === 'function' ? accessToken : async () => accessToken;\n }\n return undefined;\n }\n\n get headers(): HTTPHeaders | undefined {\n return this.configuration.headers;\n }\n\n get credentials(): RequestCredentials | undefined {\n return this.configuration.credentials;\n }\n}\n\nexport const DefaultConfig = new Configuration();\n\n/**\n * This is the base class for all generated API classes.\n */\nexport class BaseAPI {\n\n private static readonly jsonRegex = new RegExp('^(:?application\\/json|[^;/ \\t]+\\/[^;/ \\t]+[+]json)[ \\t]*(:?;.*)?$', 'i');\n private middleware: Middleware[];\n\n constructor(protected configuration = DefaultConfig) {\n this.middleware = configuration.middleware;\n }\n\n withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {\n const next = this.clone<T>();\n next.middleware = next.middleware.concat(...middlewares);\n return next;\n }\n\n withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {\n const middlewares = preMiddlewares.map((pre) => ({ pre }));\n return this.withMiddleware<T>(...middlewares);\n }\n\n withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {\n const middlewares = postMiddlewares.map((post) => ({ post }));\n return this.withMiddleware<T>(...middlewares);\n }\n\n /**\n * Check if the given MIME is a JSON MIME.\n * JSON MIME examples:\n * application/json\n * application/json; charset=UTF8\n * APPLICATION/JSON\n * application/vnd.company+json\n * @param mime - MIME (Multipurpose Internet Mail Extensions)\n * @return True if the given MIME is JSON, false otherwise.\n */\n protected isJsonMime(mime: string | null | undefined): boolean {\n if (!mime) {\n return false;\n }\n return BaseAPI.jsonRegex.test(mime);\n }\n\n protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {\n const { url, init } = await this.createFetchParams(context, initOverrides);\n const response = await this.fetchApi(url, init);\n if (response && (response.status >= 200 && response.status < 300)) {\n return response;\n }\n throw new ResponseError(response, 'Response returned an error code');\n }\n\n private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {\n let url = this.configuration.basePath + context.path;\n if (context.query !== undefined && Object.keys(context.query).length !== 0) {\n // only add the querystring to the URL if there are query parameters.\n // this is done to avoid urls ending with a \"?\" character which buggy webservers\n // do not handle correctly sometimes.\n url += '?' + this.configuration.queryParamsStringify(context.query);\n }\n\n const headers = Object.assign({}, this.configuration.headers, context.headers);\n Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});\n\n const initOverrideFn =\n typeof initOverrides === \"function\"\n ? initOverrides\n : async () => initOverrides;\n\n const initParams = {\n method: context.method,\n headers,\n body: context.body,\n credentials: this.configuration.credentials,\n };\n\n const overriddenInit: RequestInit = {\n ...initParams,\n ...(await initOverrideFn({\n init: initParams,\n context,\n }))\n };\n\n let body: any;\n if (isFormData(overriddenInit.body)\n || (overriddenInit.body instanceof URLSearchParams)\n || isBlob(overriddenInit.body)) {\n body = overriddenInit.body;\n } else if (this.isJsonMime(headers['Content-Type'])) {\n body = JSON.stringify(overriddenInit.body);\n } else {\n body = overriddenInit.body;\n }\n\n const init: RequestInit = {\n ...overriddenInit,\n body\n };\n\n return { url, init };\n }\n\n private fetchApi = async (url: string, init: RequestInit) => {\n let fetchParams = { url, init };\n for (const middleware of this.middleware) {\n if (middleware.pre) {\n fetchParams = await middleware.pre({\n fetch: this.fetchApi,\n ...fetchParams,\n }) || fetchParams;\n }\n }\n let response: Response | undefined = undefined;\n try {\n response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);\n } catch (e) {\n for (const middleware of this.middleware) {\n if (middleware.onError) {\n response = await middleware.onError({\n fetch: this.fetchApi,\n url: fetchParams.url,\n init: fetchParams.init,\n error: e,\n response: response ? response.clone() : undefined,\n }) || response;\n }\n }\n if (response === undefined) {\n if (e instanceof Error) {\n throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');\n } else {\n throw e;\n }\n }\n }\n for (const middleware of this.middleware) {\n if (middleware.post) {\n response = await middleware.post({\n fetch: this.fetchApi,\n url: fetchParams.url,\n init: fetchParams.init,\n response: response.clone(),\n }) || response;\n }\n }\n return response;\n }\n\n /**\n * Create a shallow clone of `this` by constructing a new instance\n * and then shallow cloning data members.\n */\n private clone<T extends BaseAPI>(this: T): T {\n const constructor = this.constructor as any;\n const next = new constructor(this.configuration);\n next.middleware = this.middleware.slice();\n return next;\n }\n};\n\nfunction isBlob(value: any): value is Blob {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}\n\nfunction isFormData(value: any): value is FormData {\n return typeof FormData !== \"undefined\" && value instanceof FormData;\n}\n\nexport class ResponseError extends Error {\n override name: \"ResponseError\" = \"ResponseError\";\n constructor(public response: Response, msg?: string) {\n super(msg);\n }\n}\n\nexport class FetchError extends Error {\n override name: \"FetchError\" = \"FetchError\";\n constructor(public cause: Error, msg?: string) {\n super(msg);\n }\n}\n\nexport class RequiredError extends Error {\n override name: \"RequiredError\" = \"RequiredError\";\n constructor(public field: string, msg?: string) {\n super(msg);\n }\n}\n\nexport const COLLECTION_FORMATS = {\n csv: \",\",\n ssv: \" \",\n tsv: \"\\t\",\n pipes: \"|\",\n};\n\nexport type FetchAPI = WindowOrWorkerGlobalScope['fetch'];\n\nexport type Json = any;\nexport type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';\nexport type HTTPHeaders = { [key: string]: string };\nexport type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery };\nexport type HTTPBody = Json | FormData | URLSearchParams;\nexport type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody };\nexport type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';\n\nexport type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>\n\nexport interface FetchParams {\n url: string;\n init: RequestInit;\n}\n\nexport interface RequestOpts {\n path: string;\n method: HTTPMethod;\n headers: HTTPHeaders;\n query?: HTTPQuery;\n body?: HTTPBody;\n}\n\nexport function querystring(params: HTTPQuery, prefix: string = ''): string {\n return Object.keys(params)\n .map(key => querystringSingleKey(key, params[key], prefix))\n .filter(part => part.length > 0)\n .join('&');\n}\n\nfunction querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {\n const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);\n if (value instanceof Array) {\n const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))\n .join(`&${encodeURIComponent(fullKey)}=`);\n return `${encodeURIComponent(fullKey)}=${multiValue}`;\n }\n if (value instanceof Set) {\n const valueAsArray = Array.from(value);\n return querystringSingleKey(key, valueAsArray, keyPrefix);\n }\n if (value instanceof Date) {\n return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;\n }\n if (value instanceof Object) {\n return querystring(value as HTTPQuery, fullKey);\n }\n return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;\n}\n\nexport function mapValues(data: any, fn: (item: any) => any) {\n return Object.keys(data).reduce(\n (acc, key) => ({ ...acc, [key]: fn(data[key]) }),\n {}\n );\n}\n\nexport function canConsumeForm(consumes: Consume[]): boolean {\n for (const consume of consumes) {\n if ('multipart/form-data' === consume.contentType) {\n return true;\n }\n }\n return false;\n}\n\nexport interface Consume {\n contentType: string;\n}\n\nexport interface RequestContext {\n fetch: FetchAPI;\n url: string;\n init: RequestInit;\n}\n\nexport interface ResponseContext {\n fetch: FetchAPI;\n url: string;\n init: RequestInit;\n response: Response;\n}\n\nexport interface ErrorContext {\n fetch: FetchAPI;\n url: string;\n init: RequestInit;\n error: unknown;\n response?: Response;\n}\n\nexport interface Middleware {\n pre?(context: RequestContext): Promise<FetchParams | void>;\n post?(context: ResponseContext): Promise<Response | void>;\n onError?(context: ErrorContext): Promise<Response | void>;\n}\n\nexport interface ApiResponse<T> {\n raw: Response;\n value(): Promise<T>;\n}\n\nexport interface ResponseTransformer<T> {\n (json: any): T;\n}\n\nexport class JSONApiResponse<T> {\n constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}\n\n async value(): Promise<T> {\n return this.transformer(await this.raw.json());\n }\n}\n\nexport class VoidApiResponse {\n constructor(public raw: Response) {}\n\n async value(): Promise<void> {\n return undefined;\n }\n}\n\nexport class BlobApiResponse {\n constructor(public raw: Response) {}\n\n async value(): Promise<Blob> {\n return await this.raw.blob();\n };\n}\n\nexport class TextApiResponse {\n constructor(public raw: Response) {}\n\n async value(): Promise<string> {\n return await this.raw.text();\n };\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "5c2cd476-bab4-4068-bbf8-590e2d30caa1", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "constructor(private configuration: ConfigurationParameters = {}) {}", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "eec8067e-0b81-4a51-9082-f3caccb8d9de", | |
| "name": "config", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "set config(configuration: Configuration) {\n this.configuration = configuration;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "bd695135-2956-44f9-8600-ee9bccb0d8f1", | |
| "name": "basePath", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get basePath(): string {\n return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "8b114f3e-600f-45ed-bcc4-5910ea20a5fd", | |
| "name": "fetchApi", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get fetchApi(): FetchAPI | undefined {\n return this.configuration.fetchApi;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f60fcb50-dc20-4190-81b3-d6c39aa766e9", | |
| "name": "middleware", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get middleware(): Middleware[] {\n return this.configuration.middleware || [];\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a376a830-dbdb-4b1a-98b8-d298ae76c085", | |
| "name": "queryParamsStringify", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get queryParamsStringify(): (params: HTTPQuery) => string {\n return this.configuration.queryParamsStringify || querystring;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "54c9d8ac-4490-4cf2-95b8-33cd7f0b0423", | |
| "name": "username", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get username(): string | undefined {\n return this.configuration.username;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c0341531-46d6-41df-a68e-af19baa386d0", | |
| "name": "password", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get password(): string | undefined {\n return this.configuration.password;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "3e234cd1-e840-4314-a93a-7fb3e984829a", | |
| "name": "apiKey", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get apiKey(): ((name: string) => string | Promise<string>) | undefined {\n const apiKey = this.configuration.apiKey;\n if (apiKey) {\n return typeof apiKey === 'function' ? apiKey : () => apiKey;\n }\n return undefined;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "e9f39a03-c093-4b43-af8f-bb6f74014dc8", | |
| "name": "accessToken", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {\n const accessToken = this.configuration.accessToken;\n if (accessToken) {\n return typeof accessToken === 'function' ? accessToken : async () => accessToken;\n }\n return undefined;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "28f5783e-1af6-4b1b-b2c5-44f605491d8f", | |
| "name": "headers", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get headers(): HTTPHeaders | undefined {\n return this.configuration.headers;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "0f1f5521-08fd-4612-8165-f8aa6d5dd017", | |
| "name": "credentials", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "get credentials(): RequestCredentials | undefined {\n return this.configuration.credentials;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Configuration" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f2a10acd-134f-41e6-899b-f44b66d42a6f", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "constructor(protected configuration = DefaultConfig) {\n this.middleware = configuration.middleware;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BaseAPI" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "459ecea9-f21c-469e-933c-d2bbcda698e1", | |
| "name": "withMiddleware", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {\n const next = this.clone<T>();\n next.middleware = next.middleware.concat(...middlewares);\n return next;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BaseAPI" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "20b6669b-8f5c-43b5-b1a7-7d0ee5ae300a", | |
| "name": "withPreMiddleware", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {\n const middlewares = preMiddlewares.map((pre) => ({ pre }));\n return this.withMiddleware<T>(...middlewares);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BaseAPI" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "78d57591-0145-4dd4-adea-23f1da0ba330", | |
| "name": "withPostMiddleware", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {\n const middlewares = postMiddlewares.map((post) => ({ post }));\n return this.withMiddleware<T>(...middlewares);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BaseAPI" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1661b166-01a5-4361-869b-59f6aed39cee", | |
| "name": "isJsonMime", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "protected isJsonMime(mime: string | null | undefined): boolean {\n if (!mime) {\n return false;\n }\n return BaseAPI.jsonRegex.test(mime);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BaseAPI" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ba05e1ab-717b-4c76-bc3d-c8343ebda72a", | |
| "name": "request", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {\n const { url, init } = await this.createFetchParams(context, initOverrides);\n const response = await this.fetchApi(url, init);\n if (response && (response.status >= 200 && response.status < 300)) {\n return response;\n }\n throw new ResponseError(response, 'Response returned an error code');\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BaseAPI" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "b6919718-ae28-4d77-a0f5-e9f4dc744f87", | |
| "name": "createFetchParams", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {\n let url = this.configuration.basePath + context.path;\n if (context.query !== undefined && Object.keys(context.query).length !== 0) {\n // only add the querystring to the URL if there are query parameters.\n // this is done to avoid urls ending with a \"?\" character which buggy webservers\n // do not handle correctly sometimes.\n url += '?' + this.configuration.queryParamsStringify(context.query);\n }\n\n const headers = Object.assign({}, this.configuration.headers, context.headers);\n Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});\n\n const initOverrideFn =\n typeof initOverrides === \"function\"\n ? initOverrides\n : async () => initOverrides;\n\n const initParams = {\n method: context.method,\n headers,\n body: context.body,\n credentials: this.configuration.credentials,\n };\n\n const overriddenInit: RequestInit = {\n ...initParams,\n ...(await initOverrideFn({\n init: initParams,\n context,\n }))\n };\n\n let body: any;\n if (isFormData(overriddenInit.body)\n || (overriddenInit.body instanceof URLSearchParams)\n || isBlob(overriddenInit.body)) {\n body = overriddenInit.body;\n } else if (this.isJsonMime(headers['Content-Type'])) {\n body = JSON.stringify(overriddenInit.body);\n } else {\n body = overriddenInit.body;\n }\n\n const init: RequestInit = {\n ...overriddenInit,\n body\n };\n\n return { url, init };\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BaseAPI" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "282052c3-0e9d-46d7-8adc-4b4ce4fc1ad0", | |
| "name": "clone", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "private clone<T extends BaseAPI>(this: T): T {\n const constructor = this.constructor as any;\n const next = new constructor(this.configuration);\n next.middleware = this.middleware.slice();\n return next;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BaseAPI" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "20a03d0f-8d83-42eb-b63b-e36b537d4569", | |
| "name": "isBlob", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "function isBlob(value: any): value is Blob {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "cb2cbaaa-3daf-47ea-8655-da72e2ec60f0", | |
| "name": "isFormData", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "function isFormData(value: any): value is FormData {\n return typeof FormData !== \"undefined\" && value instanceof FormData;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "305339f5-9b2d-49cb-a6e5-501c4f0b2b7e", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "constructor(public response: Response, msg?: string) {\n super(msg);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "ResponseError" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a0473ef4-ea91-4733-b1f4-0c4b810c4d0e", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "constructor(public cause: Error, msg?: string) {\n super(msg);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "FetchError" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "8156504e-4938-48cb-9999-da5ed490eaef", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "constructor(public field: string, msg?: string) {\n super(msg);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "RequiredError" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "98908937-26d7-40fa-8c03-33e97e3be078", | |
| "name": "querystring", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "function querystring(params: HTTPQuery, prefix: string = ''): string {\n return Object.keys(params)\n .map(key => querystringSingleKey(key, params[key], prefix))\n .filter(part => part.length > 0)\n .join('&');\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "8f9ad7b9-1486-4657-ad70-4aa6b2dc469a", | |
| "name": "querystringSingleKey", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {\n const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);\n if (value instanceof Array) {\n const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))\n .join(`&${encodeURIComponent(fullKey)}=`);\n return `${encodeURIComponent(fullKey)}=${multiValue}`;\n }\n if (value instanceof Set) {\n const valueAsArray = Array.from(value);\n return querystringSingleKey(key, valueAsArray, keyPrefix);\n }\n if (value instanceof Date) {\n return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;\n }\n if (value instanceof Object) {\n return querystring(value as HTTPQuery, fullKey);\n }\n return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "fcf6baea-c595-456d-9612-b40f5ab835c1", | |
| "name": "mapValues", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "function mapValues(data: any, fn: (item: any) => any) {\n return Object.keys(data).reduce(\n (acc, key) => ({ ...acc, [key]: fn(data[key]) }),\n {}\n );\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "b2406b13-d3f8-49c5-a07d-63aaa18a1c2f", | |
| "name": "canConsumeForm", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "function canConsumeForm(consumes: Consume[]): boolean {\n for (const consume of consumes) {\n if ('multipart/form-data' === consume.contentType) {\n return true;\n }\n }\n return false;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d4ff8833-5eaa-456e-8ce5-9b7878c7a59f", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "JSONApiResponse" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "338c8acb-68bd-4721-a731-f63166b71cef", | |
| "name": "value", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "async value(): Promise<T> {\n return this.transformer(await this.raw.json());\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "JSONApiResponse" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f02452ab-5011-41e9-b9f9-3310862c90c3", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "constructor(public raw: Response) {}", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "VoidApiResponse" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "892cd261-f26d-4b86-a623-5b86ac839de0", | |
| "name": "value", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "async value(): Promise<void> {\n return undefined;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "VoidApiResponse" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "2e21049f-4166-4b21-901b-13d9037d6e1e", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "constructor(public raw: Response) {}", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BlobApiResponse" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "2f3c2b4b-daf3-4da5-96e3-0c642db44e88", | |
| "name": "value", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "async value(): Promise<Blob> {\n return await this.raw.blob();\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "BlobApiResponse" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c6f71787-d10f-46a1-9a27-bd7cab70b8da", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "constructor(public raw: Response) {}", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "TextApiResponse" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1a55e474-d9a4-472b-a5cb-2b1d7845c96d", | |
| "name": "value", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/runtime.ts", | |
| "code": "async value(): Promise<string> {\n return await this.raw.text();\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "TextApiResponse" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "578aeca7-ee90-4989-8bcf-e0a7533edbcb", | |
| "name": "AgentApi.ts", | |
| "imports": "[{'import_name': ['Agent'], 'import_path': '../models/index'}, {'import_name': ['AgentFromJSON', 'AgentToJSON'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/AgentApi.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nimport * as runtime from '../runtime';\nimport type {\n Agent,\n} from '../models/index';\nimport {\n AgentFromJSON,\n AgentToJSON,\n} from '../models/index';\n\nexport interface DeleteAgentRequest {\n id: string;\n}\n\n/**\n * AgentApi - interface\n * \n * @export\n * @interface AgentApiInterface\n */\nexport interface AgentApiInterface {\n /**\n * delete an agent\n * @param {string} id ID of the agent\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof AgentApiInterface\n */\n deleteAgentRaw(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Agent>>;\n\n /**\n * delete an agent\n */\n deleteAgent(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Agent>;\n\n /**\n * list agents\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof AgentApiInterface\n */\n listAgentsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Agent>>>;\n\n /**\n * list agents\n */\n listAgents(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Agent>>;\n\n}\n\n/**\n * \n */\nexport class AgentApi extends runtime.BaseAPI implements AgentApiInterface {\n\n /**\n * delete an agent\n */\n async deleteAgentRaw(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Agent>> {\n if (requestParameters['id'] == null) {\n throw new runtime.RequiredError(\n 'id',\n 'Required parameter \"id\" was null or undefined when calling deleteAgent().'\n );\n }\n\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/agents/{id}`.replace(`{${\"id\"}}`, encodeURIComponent(String(requestParameters['id']))),\n method: 'DELETE',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => AgentFromJSON(jsonValue));\n }\n\n /**\n * delete an agent\n */\n async deleteAgent(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Agent> {\n const response = await this.deleteAgentRaw(requestParameters, initOverrides);\n return await response.value();\n }\n\n /**\n * list agents\n */\n async listAgentsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Agent>>> {\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/agents`,\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AgentFromJSON));\n }\n\n /**\n * list agents\n */\n async listAgents(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Agent>> {\n const response = await this.listAgentsRaw(initOverrides);\n return await response.value();\n }\n\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "16f48a24-7ca5-448b-9e7f-d8cd255b5f57", | |
| "name": "deleteAgentRaw", | |
| "imports": "[{'import_name': ['Agent'], 'import_path': '../models/index'}, {'import_name': ['AgentFromJSON'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/AgentApi.ts", | |
| "code": "async deleteAgentRaw(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Agent>> {\n if (requestParameters['id'] == null) {\n throw new runtime.RequiredError(\n 'id',\n 'Required parameter \"id\" was null or undefined when calling deleteAgent().'\n );\n }\n\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/agents/{id}`.replace(`{${\"id\"}}`, encodeURIComponent(String(requestParameters['id']))),\n method: 'DELETE',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => AgentFromJSON(jsonValue));\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "AgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "eb29130a-2e86-4fad-b343-509e9884b18d", | |
| "name": "deleteAgent", | |
| "imports": "[{'import_name': ['Agent'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/AgentApi.ts", | |
| "code": "async deleteAgent(requestParameters: DeleteAgentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Agent> {\n const response = await this.deleteAgentRaw(requestParameters, initOverrides);\n return await response.value();\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "AgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "18bc1bd8-9bf8-4731-8f9d-7d4c133bb758", | |
| "name": "listAgentsRaw", | |
| "imports": "[{'import_name': ['Agent'], 'import_path': '../models/index'}, {'import_name': ['AgentFromJSON'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/AgentApi.ts", | |
| "code": "async listAgentsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Agent>>> {\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/agents`,\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AgentFromJSON));\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "AgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ab2d50aa-fa7a-4566-aef7-91c2a6cc8893", | |
| "name": "listAgents", | |
| "imports": "[{'import_name': ['Agent'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/AgentApi.ts", | |
| "code": "async listAgents(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Agent>> {\n const response = await this.listAgentsRaw(initOverrides);\n return await response.value();\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "AgentApi" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "cb3a0e11-6364-459f-b2e4-c7f1f8451c90", | |
| "name": "HealthApi.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/HealthApi.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nimport * as runtime from '../runtime';\n\n/**\n * HealthApi - interface\n * \n * @export\n * @interface HealthApiInterface\n */\nexport interface HealthApiInterface {\n /**\n * health check\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof HealthApiInterface\n */\n healthRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;\n\n /**\n * health check\n */\n health(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;\n\n}\n\n/**\n * \n */\nexport class HealthApi extends runtime.BaseAPI implements HealthApiInterface {\n\n /**\n * health check\n */\n async healthRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/health`,\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.VoidApiResponse(response);\n }\n\n /**\n * health check\n */\n async health(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {\n await this.healthRaw(initOverrides);\n }\n\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "152b6c25-21be-48c6-bbb6-4de8180e7f37", | |
| "name": "healthRaw", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/HealthApi.ts", | |
| "code": "async healthRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/health`,\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.VoidApiResponse(response);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "HealthApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c4c0adf7-b86c-4570-9ff5-ff879129eefa", | |
| "name": "health", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/HealthApi.ts", | |
| "code": "async health(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {\n await this.healthRaw(initOverrides);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "HealthApi" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "81571194-e201-457a-b266-e36c71bbcf12", | |
| "name": "ImageApi.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/ImageApi.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nimport * as runtime from '../runtime';\n\nexport interface GetImageRequest {\n sshKey?: string;\n}\n\nexport interface HeadImageRequest {\n sshKey?: string;\n}\n\n/**\n * ImageApi - interface\n * \n * @export\n * @interface ImageApiInterface\n */\nexport interface ImageApiInterface {\n /**\n * get the OVA image\n * @param {string} [sshKey] public SSH key\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof ImageApiInterface\n */\n getImageRaw(requestParameters: GetImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;\n\n /**\n * get the OVA image\n */\n getImage(requestParameters: GetImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;\n\n /**\n * head the OVA image\n * @param {string} [sshKey] public SSH key\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof ImageApiInterface\n */\n headImageRaw(requestParameters: HeadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;\n\n /**\n * head the OVA image\n */\n headImage(requestParameters: HeadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;\n\n}\n\n/**\n * \n */\nexport class ImageApi extends runtime.BaseAPI implements ImageApiInterface {\n\n /**\n * get the OVA image\n */\n async getImageRaw(requestParameters: GetImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {\n const queryParameters: any = {};\n\n if (requestParameters['sshKey'] != null) {\n queryParameters['sshKey'] = requestParameters['sshKey'];\n }\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/image`,\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.BlobApiResponse(response);\n }\n\n /**\n * get the OVA image\n */\n async getImage(requestParameters: GetImageRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {\n const response = await this.getImageRaw(requestParameters, initOverrides);\n return await response.value();\n }\n\n /**\n * head the OVA image\n */\n async headImageRaw(requestParameters: HeadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {\n const queryParameters: any = {};\n\n if (requestParameters['sshKey'] != null) {\n queryParameters['sshKey'] = requestParameters['sshKey'];\n }\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/image`,\n method: 'HEAD',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.VoidApiResponse(response);\n }\n\n /**\n * head the OVA image\n */\n async headImage(requestParameters: HeadImageRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {\n await this.headImageRaw(requestParameters, initOverrides);\n }\n\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "09498d75-323d-47d5-9622-c49e91f7211e", | |
| "name": "getImageRaw", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/ImageApi.ts", | |
| "code": "async getImageRaw(requestParameters: GetImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {\n const queryParameters: any = {};\n\n if (requestParameters['sshKey'] != null) {\n queryParameters['sshKey'] = requestParameters['sshKey'];\n }\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/image`,\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.BlobApiResponse(response);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "ImageApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "968721fb-fd9d-4248-b721-987fe3b78bc9", | |
| "name": "getImage", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/ImageApi.ts", | |
| "code": "async getImage(requestParameters: GetImageRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {\n const response = await this.getImageRaw(requestParameters, initOverrides);\n return await response.value();\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "ImageApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "5e9d81ff-fae3-4329-9761-ca680742f577", | |
| "name": "headImageRaw", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/ImageApi.ts", | |
| "code": "async headImageRaw(requestParameters: HeadImageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {\n const queryParameters: any = {};\n\n if (requestParameters['sshKey'] != null) {\n queryParameters['sshKey'] = requestParameters['sshKey'];\n }\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/image`,\n method: 'HEAD',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.VoidApiResponse(response);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "ImageApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1edbc6da-4128-45ce-929b-8ce6f9d582c6", | |
| "name": "headImage", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/ImageApi.ts", | |
| "code": "async headImage(requestParameters: HeadImageRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {\n await this.headImageRaw(requestParameters, initOverrides);\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "ImageApi" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1be4ffc0-fce6-416f-9166-4a2019e2929f", | |
| "name": "SourceApi.ts", | |
| "imports": "[{'import_name': ['Source', 'Status'], 'import_path': '../models/index'}, {'import_name': ['SourceFromJSON', 'SourceToJSON', 'StatusFromJSON', 'StatusToJSON'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/SourceApi.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n\nimport * as runtime from '../runtime';\nimport type {\n Source,\n Status,\n} from '../models/index';\nimport {\n SourceFromJSON,\n SourceToJSON,\n StatusFromJSON,\n StatusToJSON,\n} from '../models/index';\n\nexport interface DeleteSourceRequest {\n id: string;\n}\n\nexport interface ReadSourceRequest {\n id: string;\n}\n\n/**\n * SourceApi - interface\n * \n * @export\n * @interface SourceApiInterface\n */\nexport interface SourceApiInterface {\n /**\n * delete a source\n * @param {string} id ID of the source\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof SourceApiInterface\n */\n deleteSourceRaw(requestParameters: DeleteSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>>;\n\n /**\n * delete a source\n */\n deleteSource(requestParameters: DeleteSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source>;\n\n /**\n * delete a collection of sources\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof SourceApiInterface\n */\n deleteSourcesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Status>>;\n\n /**\n * delete a collection of sources\n */\n deleteSources(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Status>;\n\n /**\n * list sources\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof SourceApiInterface\n */\n listSourcesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Source>>>;\n\n /**\n * list sources\n */\n listSources(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Source>>;\n\n /**\n * read the specified source\n * @param {string} id ID of the source\n * @param {*} [options] Override http request option.\n * @throws {RequiredError}\n * @memberof SourceApiInterface\n */\n readSourceRaw(requestParameters: ReadSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>>;\n\n /**\n * read the specified source\n */\n readSource(requestParameters: ReadSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source>;\n\n}\n\n/**\n * \n */\nexport class SourceApi extends runtime.BaseAPI implements SourceApiInterface {\n\n /**\n * delete a source\n */\n async deleteSourceRaw(requestParameters: DeleteSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>> {\n if (requestParameters['id'] == null) {\n throw new runtime.RequiredError(\n 'id',\n 'Required parameter \"id\" was null or undefined when calling deleteSource().'\n );\n }\n\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/sources/{id}`.replace(`{${\"id\"}}`, encodeURIComponent(String(requestParameters['id']))),\n method: 'DELETE',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => SourceFromJSON(jsonValue));\n }\n\n /**\n * delete a source\n */\n async deleteSource(requestParameters: DeleteSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source> {\n const response = await this.deleteSourceRaw(requestParameters, initOverrides);\n return await response.value();\n }\n\n /**\n * delete a collection of sources\n */\n async deleteSourcesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Status>> {\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/sources`,\n method: 'DELETE',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => StatusFromJSON(jsonValue));\n }\n\n /**\n * delete a collection of sources\n */\n async deleteSources(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Status> {\n const response = await this.deleteSourcesRaw(initOverrides);\n return await response.value();\n }\n\n /**\n * list sources\n */\n async listSourcesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Source>>> {\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/sources`,\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SourceFromJSON));\n }\n\n /**\n * list sources\n */\n async listSources(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Source>> {\n const response = await this.listSourcesRaw(initOverrides); \n return await response.value();\n }\n\n /**\n * read the specified source\n */\n async readSourceRaw(requestParameters: ReadSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>> {\n if (requestParameters['id'] == null) {\n throw new runtime.RequiredError(\n 'id',\n 'Required parameter \"id\" was null or undefined when calling readSource().'\n );\n }\n\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/sources/{id}`.replace(`{${\"id\"}}`, encodeURIComponent(String(requestParameters['id']))),\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => SourceFromJSON(jsonValue));\n }\n\n /**\n * read the specified source\n */\n async readSource(requestParameters: ReadSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source> {\n const response = await this.readSourceRaw(requestParameters, initOverrides);\n return await response.value();\n }\n\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "4c22392c-18b0-4d53-a66f-f5d1b1cb918a", | |
| "name": "deleteSourceRaw", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '../models/index'}, {'import_name': ['SourceFromJSON'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/SourceApi.ts", | |
| "code": "async deleteSourceRaw(requestParameters: DeleteSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>> {\n if (requestParameters['id'] == null) {\n throw new runtime.RequiredError(\n 'id',\n 'Required parameter \"id\" was null or undefined when calling deleteSource().'\n );\n }\n\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/sources/{id}`.replace(`{${\"id\"}}`, encodeURIComponent(String(requestParameters['id']))),\n method: 'DELETE',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => SourceFromJSON(jsonValue));\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "SourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "16160edd-3ff9-4f63-9e37-8920fce04377", | |
| "name": "deleteSource", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/SourceApi.ts", | |
| "code": "async deleteSource(requestParameters: DeleteSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source> {\n const response = await this.deleteSourceRaw(requestParameters, initOverrides);\n return await response.value();\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "SourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "4a4d905c-d62b-4b70-bf5c-b02c531d0d5d", | |
| "name": "deleteSourcesRaw", | |
| "imports": "[{'import_name': ['Source', 'Status'], 'import_path': '../models/index'}, {'import_name': ['StatusFromJSON'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/SourceApi.ts", | |
| "code": "async deleteSourcesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Status>> {\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/sources`,\n method: 'DELETE',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => StatusFromJSON(jsonValue));\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "SourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1107b3f6-90f7-4028-b992-cbbb5e996945", | |
| "name": "deleteSources", | |
| "imports": "[{'import_name': ['Source', 'Status'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/SourceApi.ts", | |
| "code": "async deleteSources(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Status> {\n const response = await this.deleteSourcesRaw(initOverrides);\n return await response.value();\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "SourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c13536ef-039a-4685-b4f2-e594b49def00", | |
| "name": "listSourcesRaw", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '../models/index'}, {'import_name': ['SourceFromJSON'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/SourceApi.ts", | |
| "code": "async listSourcesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Source>>> {\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/sources`,\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SourceFromJSON));\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "SourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f47b853f-3aa6-46c0-9154-2dd2516b3ffc", | |
| "name": "listSources", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/SourceApi.ts", | |
| "code": "async listSources(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Source>> {\n const response = await this.listSourcesRaw(initOverrides); \n return await response.value();\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "SourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "4901b6ef-9a83-45b4-9785-62c164adce03", | |
| "name": "readSourceRaw", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '../models/index'}, {'import_name': ['SourceFromJSON'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/SourceApi.ts", | |
| "code": "async readSourceRaw(requestParameters: ReadSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Source>> {\n if (requestParameters['id'] == null) {\n throw new runtime.RequiredError(\n 'id',\n 'Required parameter \"id\" was null or undefined when calling readSource().'\n );\n }\n\n const queryParameters: any = {};\n\n const headerParameters: runtime.HTTPHeaders = {};\n\n const response = await this.request({\n path: `/api/v1/sources/{id}`.replace(`{${\"id\"}}`, encodeURIComponent(String(requestParameters['id']))),\n method: 'GET',\n headers: headerParameters,\n query: queryParameters,\n }, initOverrides);\n\n return new runtime.JSONApiResponse(response, (jsonValue) => SourceFromJSON(jsonValue));\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "SourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "393dbbd5-1d8f-4058-811b-e7607c231f59", | |
| "name": "readSource", | |
| "imports": "[{'import_name': ['Source'], 'import_path': '../models/index'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/SourceApi.ts", | |
| "code": "async readSource(requestParameters: ReadSourceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Source> {\n const response = await this.readSourceRaw(requestParameters, initOverrides);\n return await response.value();\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "SourceApi" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "33a42521-a7f6-4a92-90ac-58a899cc1d92", | |
| "name": "index.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/apis/index.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\nexport {\n type GetImageRequest,\n type HeadImageRequest,\n type ImageApiInterface,\n ImageApi,\n} from \"./ImageApi\";\n\nexport {\n type DeleteSourceRequest,\n type ReadSourceRequest,\n type SourceApiInterface,\n SourceApi,\n} from \"./SourceApi\";\n\nexport {\n type HealthApiInterface,\n HealthApi\n} from \"./HealthApi\";\n\nexport {\n type AgentApiInterface,\n type DeleteAgentRequest,\n AgentApi\n} from \"./AgentApi\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "b62ec82b-60fb-4104-93d1-2c4dcd56b69a", | |
| "name": "Agent.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Agent.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * \n * @export\n * @interface Agent\n */\nexport interface Agent {\n /**\n * \n * @type {string}\n * @memberof Agent\n */\n id: string;\n /**\n * \n * @type {string}\n * @memberof Agent\n */\n status: AgentStatusEnum;\n /**\n * \n * @type {string}\n * @memberof Agent\n */\n statusInfo: string;\n /**\n * \n * @type {string}\n * @memberof Agent\n */\n credentialUrl: string;\n /**\n * \n * @type {string}\n * @memberof Agent\n */\n sourceId?: string;\n /**\n * \n * @type {Date}\n * @memberof Agent\n */\n createdAt: Date;\n /**\n * \n * @type {Date}\n * @memberof Agent\n */\n updatedAt: Date;\n /**\n * \n * @type {Date}\n * @memberof Agent\n */\n deletedAt?: Date;\n /**\n * \n * @type {boolean}\n * @memberof Agent\n */\n associated: boolean;\n /**\n * \n * @type {string}\n * @memberof Agent\n */\n version: string;\n}\n\n\n/**\n * @export\n */\nexport const AgentStatusEnum = {\n NotConnected: 'not-connected',\n WaitingForCredentials: 'waiting-for-credentials',\n Error: 'error',\n GatheringInitialInventory: 'gathering-initial-inventory',\n UpToDate: 'up-to-date',\n SourceGone: 'source-gone'\n} as const;\nexport type AgentStatusEnum = typeof AgentStatusEnum[keyof typeof AgentStatusEnum];\n\n\n/**\n * Check if a given object implements the Agent interface.\n */\nexport function instanceOfAgent(value: object): value is Agent {\n if (!('id' in value) || value['id'] === undefined) return false;\n if (!('status' in value) || value['status'] === undefined) return false;\n if (!('statusInfo' in value) || value['statusInfo'] === undefined) return false;\n if (!('credentialUrl' in value) || value['credentialUrl'] === undefined) return false;\n if (!('createdAt' in value) || value['createdAt'] === undefined) return false;\n if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;\n if (!('associated' in value) || value['associated'] === undefined) return false;\n if (!('version' in value) || value['version'] === undefined) return false;\n return true;\n}\n\nexport function AgentFromJSON(json: any): Agent {\n return AgentFromJSONTyped(json, false);\n}\n\nexport function AgentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Agent {\n if (json == null) {\n return json;\n }\n return {\n \n 'id': json['id'],\n 'status': json['status'],\n 'statusInfo': json['statusInfo'],\n 'credentialUrl': json['credentialUrl'],\n 'sourceId': json['sourceId'] == null ? undefined : json['sourceId'],\n 'createdAt': (new Date(json['createdAt'])),\n 'updatedAt': (new Date(json['updatedAt'])),\n 'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),\n 'associated': json['associated'],\n 'version': json['version'],\n };\n}\n\nexport function AgentToJSON(value?: Agent | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'id': value['id'],\n 'status': value['status'],\n 'statusInfo': value['statusInfo'],\n 'credentialUrl': value['credentialUrl'],\n 'sourceId': value['sourceId'],\n 'createdAt': ((value['createdAt']).toISOString()),\n 'updatedAt': ((value['updatedAt']).toISOString()),\n 'deletedAt': value['deletedAt'] == null ? undefined : ((value['deletedAt']).toISOString()),\n 'associated': value['associated'],\n 'version': value['version'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "3a343c49-4cea-45c4-8a60-d666926af3c0", | |
| "name": "instanceOfAgent", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Agent.ts", | |
| "code": "function instanceOfAgent(value: object): value is Agent {\n if (!('id' in value) || value['id'] === undefined) return false;\n if (!('status' in value) || value['status'] === undefined) return false;\n if (!('statusInfo' in value) || value['statusInfo'] === undefined) return false;\n if (!('credentialUrl' in value) || value['credentialUrl'] === undefined) return false;\n if (!('createdAt' in value) || value['createdAt'] === undefined) return false;\n if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;\n if (!('associated' in value) || value['associated'] === undefined) return false;\n if (!('version' in value) || value['version'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "706a5773-4da6-43c4-9e05-84beeadcb256", | |
| "name": "AgentFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Agent.ts", | |
| "code": "function AgentFromJSON(json: any): Agent {\n return AgentFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "29922701-c976-4e2c-8558-973efba4a1e2", | |
| "name": "AgentFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Agent.ts", | |
| "code": "function AgentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Agent {\n if (json == null) {\n return json;\n }\n return {\n \n 'id': json['id'],\n 'status': json['status'],\n 'statusInfo': json['statusInfo'],\n 'credentialUrl': json['credentialUrl'],\n 'sourceId': json['sourceId'] == null ? undefined : json['sourceId'],\n 'createdAt': (new Date(json['createdAt'])),\n 'updatedAt': (new Date(json['updatedAt'])),\n 'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),\n 'associated': json['associated'],\n 'version': json['version'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c4713349-1686-4997-8f5d-f47fa6c7c95e", | |
| "name": "AgentToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Agent.ts", | |
| "code": "function AgentToJSON(value?: Agent | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'id': value['id'],\n 'status': value['status'],\n 'statusInfo': value['statusInfo'],\n 'credentialUrl': value['credentialUrl'],\n 'sourceId': value['sourceId'],\n 'createdAt': ((value['createdAt']).toISOString()),\n 'updatedAt': ((value['updatedAt']).toISOString()),\n 'deletedAt': value['deletedAt'] == null ? undefined : ((value['deletedAt']).toISOString()),\n 'associated': value['associated'],\n 'version': value['version'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d8e1446b-7cb9-4214-a566-ba4d0b9facd4", | |
| "name": "Infra.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}, {'import_name': ['InfraNetworksInner'], 'import_path': './InfraNetworksInner'}, {'import_name': ['InfraNetworksInnerFromJSON', 'InfraNetworksInnerFromJSONTyped', 'InfraNetworksInnerToJSON'], 'import_path': './InfraNetworksInner'}, {'import_name': ['InfraDatastoresInner'], 'import_path': './InfraDatastoresInner'}, {'import_name': ['InfraDatastoresInnerFromJSON', 'InfraDatastoresInnerFromJSONTyped', 'InfraDatastoresInnerToJSON'], 'import_path': './InfraDatastoresInner'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Infra.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\nimport type { InfraNetworksInner } from './InfraNetworksInner';\nimport {\n InfraNetworksInnerFromJSON,\n InfraNetworksInnerFromJSONTyped,\n InfraNetworksInnerToJSON,\n} from './InfraNetworksInner';\nimport type { InfraDatastoresInner } from './InfraDatastoresInner';\nimport {\n InfraDatastoresInnerFromJSON,\n InfraDatastoresInnerFromJSONTyped,\n InfraDatastoresInnerToJSON,\n} from './InfraDatastoresInner';\n\n/**\n * \n * @export\n * @interface Infra\n */\nexport interface Infra {\n /**\n * \n * @type {number}\n * @memberof Infra\n */\n totalHosts: number;\n /**\n * \n * @type {number}\n * @memberof Infra\n */\n totalClusters: number;\n /**\n * \n * @type {Array<number>}\n * @memberof Infra\n */\n hostsPerCluster: Array<number>;\n /**\n * \n * @type {{ [key: string]: number; }}\n * @memberof Infra\n */\n hostPowerStates: { [key: string]: number; };\n /**\n * \n * @type {Array<InfraNetworksInner>}\n * @memberof Infra\n */\n networks: Array<InfraNetworksInner>;\n /**\n * \n * @type {Array<InfraDatastoresInner>}\n * @memberof Infra\n */\n datastores: Array<InfraDatastoresInner>;\n}\n\n/**\n * Check if a given object implements the Infra interface.\n */\nexport function instanceOfInfra(value: object): value is Infra {\n if (!('totalHosts' in value) || value['totalHosts'] === undefined) return false;\n if (!('totalClusters' in value) || value['totalClusters'] === undefined) return false;\n if (!('hostsPerCluster' in value) || value['hostsPerCluster'] === undefined) return false;\n if (!('hostPowerStates' in value) || value['hostPowerStates'] === undefined) return false;\n if (!('networks' in value) || value['networks'] === undefined) return false;\n if (!('datastores' in value) || value['datastores'] === undefined) return false;\n return true;\n}\n\nexport function InfraFromJSON(json: any): Infra {\n return InfraFromJSONTyped(json, false);\n}\n\nexport function InfraFromJSONTyped(json: any, ignoreDiscriminator: boolean): Infra {\n if (json == null) {\n return json;\n }\n return {\n \n 'totalHosts': json['totalHosts'],\n 'totalClusters': json['totalClusters'],\n 'hostsPerCluster': json['hostsPerCluster'],\n 'hostPowerStates': json['hostPowerStates'],\n 'networks': ((json['networks'] as Array<any>).map(InfraNetworksInnerFromJSON)),\n 'datastores': ((json['datastores'] as Array<any>).map(InfraDatastoresInnerFromJSON)),\n };\n}\n\nexport function InfraToJSON(value?: Infra | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'totalHosts': value['totalHosts'],\n 'totalClusters': value['totalClusters'],\n 'hostsPerCluster': value['hostsPerCluster'],\n 'hostPowerStates': value['hostPowerStates'],\n 'networks': ((value['networks'] as Array<any>).map(InfraNetworksInnerToJSON)),\n 'datastores': ((value['datastores'] as Array<any>).map(InfraDatastoresInnerToJSON)),\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "173be413-48fb-4198-9026-adf7f2a211e0", | |
| "name": "instanceOfInfra", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Infra.ts", | |
| "code": "function instanceOfInfra(value: object): value is Infra {\n if (!('totalHosts' in value) || value['totalHosts'] === undefined) return false;\n if (!('totalClusters' in value) || value['totalClusters'] === undefined) return false;\n if (!('hostsPerCluster' in value) || value['hostsPerCluster'] === undefined) return false;\n if (!('hostPowerStates' in value) || value['hostPowerStates'] === undefined) return false;\n if (!('networks' in value) || value['networks'] === undefined) return false;\n if (!('datastores' in value) || value['datastores'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "6155c007-033b-4bc6-a31d-cbb1ad54ab85", | |
| "name": "InfraFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Infra.ts", | |
| "code": "function InfraFromJSON(json: any): Infra {\n return InfraFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "5a42596a-3ef6-449c-8d70-3aa343e07ce7", | |
| "name": "InfraFromJSONTyped", | |
| "imports": "[{'import_name': ['InfraNetworksInner'], 'import_path': './InfraNetworksInner'}, {'import_name': ['InfraNetworksInnerFromJSON'], 'import_path': './InfraNetworksInner'}, {'import_name': ['InfraDatastoresInner'], 'import_path': './InfraDatastoresInner'}, {'import_name': ['InfraDatastoresInnerFromJSON'], 'import_path': './InfraDatastoresInner'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Infra.ts", | |
| "code": "function InfraFromJSONTyped(json: any, ignoreDiscriminator: boolean): Infra {\n if (json == null) {\n return json;\n }\n return {\n \n 'totalHosts': json['totalHosts'],\n 'totalClusters': json['totalClusters'],\n 'hostsPerCluster': json['hostsPerCluster'],\n 'hostPowerStates': json['hostPowerStates'],\n 'networks': ((json['networks'] as Array<any>).map(InfraNetworksInnerFromJSON)),\n 'datastores': ((json['datastores'] as Array<any>).map(InfraDatastoresInnerFromJSON)),\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ada9c794-497f-43b0-8156-f5b59b0e0297", | |
| "name": "InfraToJSON", | |
| "imports": "[{'import_name': ['InfraNetworksInner'], 'import_path': './InfraNetworksInner'}, {'import_name': ['InfraNetworksInnerToJSON'], 'import_path': './InfraNetworksInner'}, {'import_name': ['InfraDatastoresInner'], 'import_path': './InfraDatastoresInner'}, {'import_name': ['InfraDatastoresInnerToJSON'], 'import_path': './InfraDatastoresInner'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Infra.ts", | |
| "code": "function InfraToJSON(value?: Infra | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'totalHosts': value['totalHosts'],\n 'totalClusters': value['totalClusters'],\n 'hostsPerCluster': value['hostsPerCluster'],\n 'hostPowerStates': value['hostPowerStates'],\n 'networks': ((value['networks'] as Array<any>).map(InfraNetworksInnerToJSON)),\n 'datastores': ((value['datastores'] as Array<any>).map(InfraDatastoresInnerToJSON)),\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "634430da-ac18-429c-a0f9-caaecab7f25b", | |
| "name": "InfraDatastoresInner.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraDatastoresInner.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * \n * @export\n * @interface InfraDatastoresInner\n */\nexport interface InfraDatastoresInner {\n /**\n * \n * @type {string}\n * @memberof InfraDatastoresInner\n */\n type: string;\n /**\n * \n * @type {number}\n * @memberof InfraDatastoresInner\n */\n totalCapacityGB: number;\n /**\n * \n * @type {number}\n * @memberof InfraDatastoresInner\n */\n freeCapacityGB: number;\n}\n\n/**\n * Check if a given object implements the InfraDatastoresInner interface.\n */\nexport function instanceOfInfraDatastoresInner(value: object): value is InfraDatastoresInner {\n if (!('type' in value) || value['type'] === undefined) return false;\n if (!('totalCapacityGB' in value) || value['totalCapacityGB'] === undefined) return false;\n if (!('freeCapacityGB' in value) || value['freeCapacityGB'] === undefined) return false;\n return true;\n}\n\nexport function InfraDatastoresInnerFromJSON(json: any): InfraDatastoresInner {\n return InfraDatastoresInnerFromJSONTyped(json, false);\n}\n\nexport function InfraDatastoresInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): InfraDatastoresInner {\n if (json == null) {\n return json;\n }\n return {\n \n 'type': json['type'],\n 'totalCapacityGB': json['totalCapacityGB'],\n 'freeCapacityGB': json['freeCapacityGB'],\n };\n}\n\nexport function InfraDatastoresInnerToJSON(value?: InfraDatastoresInner | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'type': value['type'],\n 'totalCapacityGB': value['totalCapacityGB'],\n 'freeCapacityGB': value['freeCapacityGB'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "353f5069-1925-4226-97a7-eb1f1fc4b228", | |
| "name": "instanceOfInfraDatastoresInner", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraDatastoresInner.ts", | |
| "code": "function instanceOfInfraDatastoresInner(value: object): value is InfraDatastoresInner {\n if (!('type' in value) || value['type'] === undefined) return false;\n if (!('totalCapacityGB' in value) || value['totalCapacityGB'] === undefined) return false;\n if (!('freeCapacityGB' in value) || value['freeCapacityGB'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "58979a19-aaad-4b73-884c-c30c899f23e6", | |
| "name": "InfraDatastoresInnerFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraDatastoresInner.ts", | |
| "code": "function InfraDatastoresInnerFromJSON(json: any): InfraDatastoresInner {\n return InfraDatastoresInnerFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "0bc4b809-ad2c-425e-a5c3-a006a366a3b9", | |
| "name": "InfraDatastoresInnerFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraDatastoresInner.ts", | |
| "code": "function InfraDatastoresInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): InfraDatastoresInner {\n if (json == null) {\n return json;\n }\n return {\n \n 'type': json['type'],\n 'totalCapacityGB': json['totalCapacityGB'],\n 'freeCapacityGB': json['freeCapacityGB'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "dffa9a14-5b3f-47f6-b157-faa2e16b317e", | |
| "name": "InfraDatastoresInnerToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraDatastoresInner.ts", | |
| "code": "function InfraDatastoresInnerToJSON(value?: InfraDatastoresInner | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'type': value['type'],\n 'totalCapacityGB': value['totalCapacityGB'],\n 'freeCapacityGB': value['freeCapacityGB'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "8ec6879d-27c9-4c6c-90fe-3a62547f32a9", | |
| "name": "InfraNetworksInner.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraNetworksInner.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * \n * @export\n * @interface InfraNetworksInner\n */\nexport interface InfraNetworksInner {\n /**\n * \n * @type {string}\n * @memberof InfraNetworksInner\n */\n type: InfraNetworksInnerTypeEnum;\n /**\n * \n * @type {string}\n * @memberof InfraNetworksInner\n */\n name: string;\n /**\n * \n * @type {string}\n * @memberof InfraNetworksInner\n */\n vlanId?: string;\n /**\n * \n * @type {string}\n * @memberof InfraNetworksInner\n */\n dvswitch?: string;\n}\n\n\n/**\n * @export\n */\nexport const InfraNetworksInnerTypeEnum = {\n Standard: 'standard',\n Distributed: 'distributed',\n Dvswitch: 'dvswitch',\n Unsupported: 'unsupported'\n} as const;\nexport type InfraNetworksInnerTypeEnum = typeof InfraNetworksInnerTypeEnum[keyof typeof InfraNetworksInnerTypeEnum];\n\n\n/**\n * Check if a given object implements the InfraNetworksInner interface.\n */\nexport function instanceOfInfraNetworksInner(value: object): value is InfraNetworksInner {\n if (!('type' in value) || value['type'] === undefined) return false;\n if (!('name' in value) || value['name'] === undefined) return false;\n return true;\n}\n\nexport function InfraNetworksInnerFromJSON(json: any): InfraNetworksInner {\n return InfraNetworksInnerFromJSONTyped(json, false);\n}\n\nexport function InfraNetworksInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): InfraNetworksInner {\n if (json == null) {\n return json;\n }\n return {\n \n 'type': json['type'],\n 'name': json['name'],\n 'vlanId': json['vlanId'] == null ? undefined : json['vlanId'],\n 'dvswitch': json['dvswitch'] == null ? undefined : json['dvswitch'],\n };\n}\n\nexport function InfraNetworksInnerToJSON(value?: InfraNetworksInner | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'type': value['type'],\n 'name': value['name'],\n 'vlanId': value['vlanId'],\n 'dvswitch': value['dvswitch'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "6941b051-2563-4ace-a21e-b54e0f5db0da", | |
| "name": "instanceOfInfraNetworksInner", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraNetworksInner.ts", | |
| "code": "function instanceOfInfraNetworksInner(value: object): value is InfraNetworksInner {\n if (!('type' in value) || value['type'] === undefined) return false;\n if (!('name' in value) || value['name'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "60923dfe-2cfc-4bd1-8599-2af830b42149", | |
| "name": "InfraNetworksInnerFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraNetworksInner.ts", | |
| "code": "function InfraNetworksInnerFromJSON(json: any): InfraNetworksInner {\n return InfraNetworksInnerFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "991483c5-c1fa-43f1-bbc9-70c7474a2825", | |
| "name": "InfraNetworksInnerFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraNetworksInner.ts", | |
| "code": "function InfraNetworksInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): InfraNetworksInner {\n if (json == null) {\n return json;\n }\n return {\n \n 'type': json['type'],\n 'name': json['name'],\n 'vlanId': json['vlanId'] == null ? undefined : json['vlanId'],\n 'dvswitch': json['dvswitch'] == null ? undefined : json['dvswitch'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "50f15f9e-39d5-45ab-8b98-19759a5e87dc", | |
| "name": "InfraNetworksInnerToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/InfraNetworksInner.ts", | |
| "code": "function InfraNetworksInnerToJSON(value?: InfraNetworksInner | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'type': value['type'],\n 'name': value['name'],\n 'vlanId': value['vlanId'],\n 'dvswitch': value['dvswitch'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "0d9a30e8-77b4-42a8-b79d-b82c870ed477", | |
| "name": "Inventory.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}, {'import_name': ['VCenter'], 'import_path': './VCenter'}, {'import_name': ['VCenterFromJSON', 'VCenterFromJSONTyped', 'VCenterToJSON'], 'import_path': './VCenter'}, {'import_name': ['Infra'], 'import_path': './Infra'}, {'import_name': ['InfraFromJSON', 'InfraFromJSONTyped', 'InfraToJSON'], 'import_path': './Infra'}, {'import_name': ['VMs'], 'import_path': './VMs'}, {'import_name': ['VMsFromJSON', 'VMsFromJSONTyped', 'VMsToJSON'], 'import_path': './VMs'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Inventory.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\nimport type { VCenter } from './VCenter';\nimport {\n VCenterFromJSON,\n VCenterFromJSONTyped,\n VCenterToJSON,\n} from './VCenter';\nimport type { Infra } from './Infra';\nimport {\n InfraFromJSON,\n InfraFromJSONTyped,\n InfraToJSON,\n} from './Infra';\nimport type { VMs } from './VMs';\nimport {\n VMsFromJSON,\n VMsFromJSONTyped,\n VMsToJSON,\n} from './VMs';\n\n/**\n * \n * @export\n * @interface Inventory\n */\nexport interface Inventory {\n /**\n * \n * @type {VCenter}\n * @memberof Inventory\n */\n vcenter: VCenter;\n /**\n * \n * @type {VMs}\n * @memberof Inventory\n */\n vms: VMs;\n /**\n * \n * @type {Infra}\n * @memberof Inventory\n */\n infra: Infra;\n}\n\n/**\n * Check if a given object implements the Inventory interface.\n */\nexport function instanceOfInventory(value: object): value is Inventory {\n if (!('vcenter' in value) || value['vcenter'] === undefined) return false;\n if (!('vms' in value) || value['vms'] === undefined) return false;\n if (!('infra' in value) || value['infra'] === undefined) return false;\n return true;\n}\n\nexport function InventoryFromJSON(json: any): Inventory {\n return InventoryFromJSONTyped(json, false);\n}\n\nexport function InventoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Inventory {\n if (json == null) {\n return json;\n }\n return {\n \n 'vcenter': json['vcenter'],\n 'vms': json['vms'],\n 'infra': json['infra'],\n };\n}\n\nexport function InventoryToJSON(value?: Inventory | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'vcenter': value['vcenter'],\n 'vms': value['vms'],\n 'infra': value['infra'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "8d9ba4ae-bcd3-4855-9e10-3e46c2f390e7", | |
| "name": "instanceOfInventory", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Inventory.ts", | |
| "code": "function instanceOfInventory(value: object): value is Inventory {\n if (!('vcenter' in value) || value['vcenter'] === undefined) return false;\n if (!('vms' in value) || value['vms'] === undefined) return false;\n if (!('infra' in value) || value['infra'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1d47e7bf-de23-459e-ac46-800726579f61", | |
| "name": "InventoryFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Inventory.ts", | |
| "code": "function InventoryFromJSON(json: any): Inventory {\n return InventoryFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a6cf793d-e20e-4183-8a08-9f3ed621907e", | |
| "name": "InventoryFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Inventory.ts", | |
| "code": "function InventoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Inventory {\n if (json == null) {\n return json;\n }\n return {\n \n 'vcenter': json['vcenter'],\n 'vms': json['vms'],\n 'infra': json['infra'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "312feff3-bac6-4859-8a19-633220beeadd", | |
| "name": "InventoryToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Inventory.ts", | |
| "code": "function InventoryToJSON(value?: Inventory | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'vcenter': value['vcenter'],\n 'vms': value['vms'],\n 'infra': value['infra'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "fa3e1801-b014-498a-9808-64306ca6d766", | |
| "name": "MigrationIssuesInner.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/MigrationIssuesInner.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * \n * @export\n * @interface MigrationIssuesInner\n */\nexport interface MigrationIssuesInner {\n /**\n * \n * @type {string}\n * @memberof MigrationIssuesInner\n */\n label: string;\n /**\n * \n * @type {string}\n * @memberof MigrationIssuesInner\n */\n assessment: string;\n /**\n * \n * @type {number}\n * @memberof MigrationIssuesInner\n */\n count: number;\n}\n\n/**\n * Check if a given object implements the MigrationIssuesInner interface.\n */\nexport function instanceOfMigrationIssuesInner(value: object): value is MigrationIssuesInner {\n if (!('label' in value) || value['label'] === undefined) return false;\n if (!('assessment' in value) || value['assessment'] === undefined) return false;\n if (!('count' in value) || value['count'] === undefined) return false;\n return true;\n}\n\nexport function MigrationIssuesInnerFromJSON(json: any): MigrationIssuesInner {\n return MigrationIssuesInnerFromJSONTyped(json, false);\n}\n\nexport function MigrationIssuesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): MigrationIssuesInner {\n if (json == null) {\n return json;\n }\n return {\n \n 'label': json['label'],\n 'assessment': json['assessment'],\n 'count': json['count'],\n };\n}\n\nexport function MigrationIssuesInnerToJSON(value?: MigrationIssuesInner | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'label': value['label'],\n 'assessment': value['assessment'],\n 'count': value['count'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "5e6fd56e-68a7-46d4-9189-5b59548ba0fa", | |
| "name": "instanceOfMigrationIssuesInner", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/MigrationIssuesInner.ts", | |
| "code": "function instanceOfMigrationIssuesInner(value: object): value is MigrationIssuesInner {\n if (!('label' in value) || value['label'] === undefined) return false;\n if (!('assessment' in value) || value['assessment'] === undefined) return false;\n if (!('count' in value) || value['count'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "50df146b-b43b-4e3e-b6b1-2191e461649e", | |
| "name": "MigrationIssuesInnerFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/MigrationIssuesInner.ts", | |
| "code": "function MigrationIssuesInnerFromJSON(json: any): MigrationIssuesInner {\n return MigrationIssuesInnerFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "fe0b791c-0091-4a03-82c5-0fcaecca49a7", | |
| "name": "MigrationIssuesInnerFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/MigrationIssuesInner.ts", | |
| "code": "function MigrationIssuesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): MigrationIssuesInner {\n if (json == null) {\n return json;\n }\n return {\n \n 'label': json['label'],\n 'assessment': json['assessment'],\n 'count': json['count'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "03a3b003-2129-4ebe-b0f3-1e6474023f73", | |
| "name": "MigrationIssuesInnerToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/MigrationIssuesInner.ts", | |
| "code": "function MigrationIssuesInnerToJSON(value?: MigrationIssuesInner | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'label': value['label'],\n 'assessment': value['assessment'],\n 'count': value['count'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "e9053345-8734-462e-a1da-b34730d8cc6c", | |
| "name": "ModelError.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/ModelError.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * \n * @export\n * @interface ModelError\n */\nexport interface ModelError {\n /**\n * Error message\n * @type {string}\n * @memberof ModelError\n */\n message: string;\n}\n\n/**\n * Check if a given object implements the ModelError interface.\n */\nexport function instanceOfModelError(value: object): value is ModelError {\n if (!('message' in value) || value['message'] === undefined) return false;\n return true;\n}\n\nexport function ModelErrorFromJSON(json: any): ModelError {\n return ModelErrorFromJSONTyped(json, false);\n}\n\nexport function ModelErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelError {\n if (json == null) {\n return json;\n }\n return {\n \n 'message': json['message'],\n };\n}\n\nexport function ModelErrorToJSON(value?: ModelError | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'message': value['message'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "fe0e3c11-2e64-4dcf-8a26-70dbd95a724b", | |
| "name": "instanceOfModelError", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/ModelError.ts", | |
| "code": "function instanceOfModelError(value: object): value is ModelError {\n if (!('message' in value) || value['message'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "66f70106-d077-4a8d-b1b3-8274c04363df", | |
| "name": "ModelErrorFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/ModelError.ts", | |
| "code": "function ModelErrorFromJSON(json: any): ModelError {\n return ModelErrorFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f349d5e4-3661-413d-bbbe-70d28e75171c", | |
| "name": "ModelErrorFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/ModelError.ts", | |
| "code": "function ModelErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelError {\n if (json == null) {\n return json;\n }\n return {\n \n 'message': json['message'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "555190f0-1926-45c9-90b0-3b82cc2eccd3", | |
| "name": "ModelErrorToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/ModelError.ts", | |
| "code": "function ModelErrorToJSON(value?: ModelError | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'message': value['message'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "df002d3b-15aa-40d3-b7e6-8d0bdc8f48e9", | |
| "name": "Source.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}, {'import_name': ['SourceAgentItem'], 'import_path': './SourceAgentItem'}, {'import_name': ['SourceAgentItemFromJSON', 'SourceAgentItemFromJSONTyped', 'SourceAgentItemToJSON'], 'import_path': './SourceAgentItem'}, {'import_name': ['Inventory'], 'import_path': './Inventory'}, {'import_name': ['InventoryFromJSON', 'InventoryFromJSONTyped', 'InventoryToJSON'], 'import_path': './Inventory'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Source.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\nimport type { SourceAgentItem } from './SourceAgentItem';\nimport {\n SourceAgentItemFromJSON,\n SourceAgentItemFromJSONTyped,\n SourceAgentItemToJSON,\n} from './SourceAgentItem';\nimport type { Inventory } from './Inventory';\nimport {\n InventoryFromJSON,\n InventoryFromJSONTyped,\n InventoryToJSON,\n} from './Inventory';\n\n/**\n * \n * @export\n * @interface Source\n */\nexport interface Source {\n /**\n * \n * @type {string}\n * @memberof Source\n */\n id: string;\n /**\n * \n * @type {string}\n * @memberof Source\n */\n name: string;\n /**\n * \n * @type {string}\n * @memberof Source\n */\n status: SourceStatusEnum;\n /**\n * \n * @type {string}\n * @memberof Source\n */\n statusInfo: string;\n /**\n * \n * @type {Inventory}\n * @memberof Source\n */\n inventory?: Inventory;\n /**\n * \n * @type {Date}\n * @memberof Source\n */\n createdAt: Date;\n /**\n * \n * @type {Date}\n * @memberof Source\n */\n updatedAt: Date;\n /**\n * \n * @type {string}\n * @memberof Source\n */\n sshKey?: string;\n /**\n * \n * @type {Array<SourceAgentItem>}\n * @memberof Source\n */\n agents?: Array<SourceAgentItem>;\n}\n\n\n/**\n * @export\n */\nexport const SourceStatusEnum = {\n NotConnected: 'not-connected',\n WaitingForCredentials: 'waiting-for-credentials',\n Error: 'error',\n GatheringInitialInventory: 'gathering-initial-inventory',\n UpToDate: 'up-to-date'\n} as const;\nexport type SourceStatusEnum = typeof SourceStatusEnum[keyof typeof SourceStatusEnum];\n\n\n/**\n * Check if a given object implements the Source interface.\n */\nexport function instanceOfSource(value: object): value is Source {\n if (!('id' in value) || value['id'] === undefined) return false;\n if (!('name' in value) || value['name'] === undefined) return false;\n if (!('status' in value) || value['status'] === undefined) return false;\n if (!('statusInfo' in value) || value['statusInfo'] === undefined) return false;\n if (!('createdAt' in value) || value['createdAt'] === undefined) return false;\n if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;\n return true;\n}\n\nexport function SourceFromJSON(json: any): Source {\n return SourceFromJSONTyped(json, false);\n}\n\nexport function SourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Source {\n if (json == null) {\n return json;\n }\n return {\n \n 'id': json['id'],\n 'name': json['name'],\n 'status': json['status'],\n 'statusInfo': json['statusInfo'],\n 'inventory': json['inventory'] == null ? undefined : InventoryFromJSON(json['inventory']),\n 'createdAt': (new Date(json['createdAt'])),\n 'updatedAt': (new Date(json['updatedAt'])),\n 'sshKey': json['sshKey'] == null ? undefined : json['sshKey'],\n 'agents': json['agents'] == null ? undefined : ((json['agents'] as Array<any>).map(SourceAgentItemFromJSON)),\n };\n}\n\nexport function SourceToJSON(value?: Source | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'id': value['id'],\n 'name': value['name'],\n 'status': value['status'],\n 'statusInfo': value['statusInfo'],\n 'inventory': InventoryToJSON(value['inventory']),\n 'createdAt': ((value['createdAt']).toISOString()),\n 'updatedAt': ((value['updatedAt']).toISOString()),\n 'sshKey': value['sshKey'],\n 'agents': value['agents'] == null ? undefined : ((value['agents'] as Array<any>).map(SourceAgentItemToJSON)),\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "894c3994-38a6-4c87-a84b-4f9ecac9525c", | |
| "name": "instanceOfSource", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Source.ts", | |
| "code": "function instanceOfSource(value: object): value is Source {\n if (!('id' in value) || value['id'] === undefined) return false;\n if (!('name' in value) || value['name'] === undefined) return false;\n if (!('status' in value) || value['status'] === undefined) return false;\n if (!('statusInfo' in value) || value['statusInfo'] === undefined) return false;\n if (!('createdAt' in value) || value['createdAt'] === undefined) return false;\n if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "904ce414-8315-46d1-bce5-817bf9f39814", | |
| "name": "SourceFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Source.ts", | |
| "code": "function SourceFromJSON(json: any): Source {\n return SourceFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c5608d9f-41ae-4778-9d37-04b948a880e2", | |
| "name": "SourceFromJSONTyped", | |
| "imports": "[{'import_name': ['SourceAgentItem'], 'import_path': './SourceAgentItem'}, {'import_name': ['SourceAgentItemFromJSON'], 'import_path': './SourceAgentItem'}, {'import_name': ['Inventory'], 'import_path': './Inventory'}, {'import_name': ['InventoryFromJSON'], 'import_path': './Inventory'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Source.ts", | |
| "code": "function SourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Source {\n if (json == null) {\n return json;\n }\n return {\n \n 'id': json['id'],\n 'name': json['name'],\n 'status': json['status'],\n 'statusInfo': json['statusInfo'],\n 'inventory': json['inventory'] == null ? undefined : InventoryFromJSON(json['inventory']),\n 'createdAt': (new Date(json['createdAt'])),\n 'updatedAt': (new Date(json['updatedAt'])),\n 'sshKey': json['sshKey'] == null ? undefined : json['sshKey'],\n 'agents': json['agents'] == null ? undefined : ((json['agents'] as Array<any>).map(SourceAgentItemFromJSON)),\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "405fa9b0-1f59-4c3d-bf57-d77aa1e023ef", | |
| "name": "SourceToJSON", | |
| "imports": "[{'import_name': ['SourceAgentItem'], 'import_path': './SourceAgentItem'}, {'import_name': ['SourceAgentItemToJSON'], 'import_path': './SourceAgentItem'}, {'import_name': ['Inventory'], 'import_path': './Inventory'}, {'import_name': ['InventoryToJSON'], 'import_path': './Inventory'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Source.ts", | |
| "code": "function SourceToJSON(value?: Source | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'id': value['id'],\n 'name': value['name'],\n 'status': value['status'],\n 'statusInfo': value['statusInfo'],\n 'inventory': InventoryToJSON(value['inventory']),\n 'createdAt': ((value['createdAt']).toISOString()),\n 'updatedAt': ((value['updatedAt']).toISOString()),\n 'sshKey': value['sshKey'],\n 'agents': value['agents'] == null ? undefined : ((value['agents'] as Array<any>).map(SourceAgentItemToJSON)),\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "18baf3c8-c023-4637-b3cd-091d580c973d", | |
| "name": "SourceAgentItem.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceAgentItem.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * \n * @export\n * @interface SourceAgentItem\n */\nexport interface SourceAgentItem {\n /**\n * \n * @type {string}\n * @memberof SourceAgentItem\n */\n id: string;\n /**\n * \n * @type {boolean}\n * @memberof SourceAgentItem\n */\n associated: boolean;\n}\n\n/**\n * Check if a given object implements the SourceAgentItem interface.\n */\nexport function instanceOfSourceAgentItem(value: object): value is SourceAgentItem {\n if (!('id' in value) || value['id'] === undefined) return false;\n if (!('associated' in value) || value['associated'] === undefined) return false;\n return true;\n}\n\nexport function SourceAgentItemFromJSON(json: any): SourceAgentItem {\n return SourceAgentItemFromJSONTyped(json, false);\n}\n\nexport function SourceAgentItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAgentItem {\n if (json == null) {\n return json;\n }\n return {\n \n 'id': json['id'],\n 'associated': json['associated'],\n };\n}\n\nexport function SourceAgentItemToJSON(value?: SourceAgentItem | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'id': value['id'],\n 'associated': value['associated'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a324a1b8-07df-4ab5-8a19-95344ab93b88", | |
| "name": "instanceOfSourceAgentItem", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceAgentItem.ts", | |
| "code": "function instanceOfSourceAgentItem(value: object): value is SourceAgentItem {\n if (!('id' in value) || value['id'] === undefined) return false;\n if (!('associated' in value) || value['associated'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d9bd560b-ff54-4141-a593-9673b1f82a93", | |
| "name": "SourceAgentItemFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceAgentItem.ts", | |
| "code": "function SourceAgentItemFromJSON(json: any): SourceAgentItem {\n return SourceAgentItemFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1ea6fd07-ebb5-452e-8f3b-ba95be9162cf", | |
| "name": "SourceAgentItemFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceAgentItem.ts", | |
| "code": "function SourceAgentItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceAgentItem {\n if (json == null) {\n return json;\n }\n return {\n \n 'id': json['id'],\n 'associated': json['associated'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "fb781e39-12eb-459f-a8c3-78803244c4b1", | |
| "name": "SourceAgentItemToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceAgentItem.ts", | |
| "code": "function SourceAgentItemToJSON(value?: SourceAgentItem | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'id': value['id'],\n 'associated': value['associated'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "bcad6e71-cc78-4981-b58f-000ba80886ff", | |
| "name": "SourceCreate.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceCreate.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * \n * @export\n * @interface SourceCreate\n */\nexport interface SourceCreate {\n /**\n * \n * @type {string}\n * @memberof SourceCreate\n */\n name: string;\n}\n\n/**\n * Check if a given object implements the SourceCreate interface.\n */\nexport function instanceOfSourceCreate(value: object): value is SourceCreate {\n if (!('name' in value) || value['name'] === undefined) return false;\n return true;\n}\n\nexport function SourceCreateFromJSON(json: any): SourceCreate {\n return SourceCreateFromJSONTyped(json, false);\n}\n\nexport function SourceCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceCreate {\n if (json == null) {\n return json;\n }\n return {\n \n 'name': json['name'],\n };\n}\n\nexport function SourceCreateToJSON(value?: SourceCreate | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'name': value['name'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "4e72948b-e427-4cc7-a699-e7c9c778a6e8", | |
| "name": "instanceOfSourceCreate", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceCreate.ts", | |
| "code": "function instanceOfSourceCreate(value: object): value is SourceCreate {\n if (!('name' in value) || value['name'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "ad97655d-bc2b-4a04-8261-8bbefc25f85a", | |
| "name": "SourceCreateFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceCreate.ts", | |
| "code": "function SourceCreateFromJSON(json: any): SourceCreate {\n return SourceCreateFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f8d4e8fa-291d-42f4-9542-39ead44627bf", | |
| "name": "SourceCreateFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceCreate.ts", | |
| "code": "function SourceCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceCreate {\n if (json == null) {\n return json;\n }\n return {\n \n 'name': json['name'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1e4b152a-121c-46e2-8fef-720d7584a7e6", | |
| "name": "SourceCreateToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/SourceCreate.ts", | |
| "code": "function SourceCreateToJSON(value?: SourceCreate | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'name': value['name'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "d4f47b24-4c46-441b-9725-025c12b7deb0", | |
| "name": "Status.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Status.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * Status is a return value for calls that don't return other objects.\n * @export\n * @interface Status\n */\nexport interface Status {\n /**\n * A human-readable description of the status of this operation.\n * @type {string}\n * @memberof Status\n */\n message?: string;\n /**\n * A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.\n * @type {string}\n * @memberof Status\n */\n reason?: string;\n /**\n * Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status\n * @type {string}\n * @memberof Status\n */\n status?: string;\n}\n\n/**\n * Check if a given object implements the Status interface.\n */\nexport function instanceOfStatus(value: object): value is Status {\n return true;\n}\n\nexport function StatusFromJSON(json: any): Status {\n return StatusFromJSONTyped(json, false);\n}\n\nexport function StatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): Status {\n if (json == null) {\n return json;\n }\n return {\n \n 'message': json['message'] == null ? undefined : json['message'],\n 'reason': json['reason'] == null ? undefined : json['reason'],\n 'status': json['status'] == null ? undefined : json['status'],\n };\n}\n\nexport function StatusToJSON(value?: Status | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'message': value['message'],\n 'reason': value['reason'],\n 'status': value['status'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "bd3f5182-1c30-41b0-b49d-dab241f6b291", | |
| "name": "instanceOfStatus", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Status.ts", | |
| "code": "function instanceOfStatus(value: object): value is Status {\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "97dcf69c-eedc-4b7f-a359-18aefefb6339", | |
| "name": "StatusFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Status.ts", | |
| "code": "function StatusFromJSON(json: any): Status {\n return StatusFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "b57a7e76-c480-49bb-b430-7e11d59577df", | |
| "name": "StatusFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Status.ts", | |
| "code": "function StatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): Status {\n if (json == null) {\n return json;\n }\n return {\n \n 'message': json['message'] == null ? undefined : json['message'],\n 'reason': json['reason'] == null ? undefined : json['reason'],\n 'status': json['status'] == null ? undefined : json['status'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1378ea80-1b23-4670-905a-ac6c4d8539eb", | |
| "name": "StatusToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/Status.ts", | |
| "code": "function StatusToJSON(value?: Status | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'message': value['message'],\n 'reason': value['reason'],\n 'status': value['status'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "03bc55b5-3f72-4566-82ac-272a67e3428b", | |
| "name": "VCenter.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VCenter.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * \n * @export\n * @interface VCenter\n */\nexport interface VCenter {\n /**\n * \n * @type {string}\n * @memberof VCenter\n */\n id: string;\n}\n\n/**\n * Check if a given object implements the VCenter interface.\n */\nexport function instanceOfVCenter(value: object): value is VCenter {\n if (!('id' in value) || value['id'] === undefined) return false;\n return true;\n}\n\nexport function VCenterFromJSON(json: any): VCenter {\n return VCenterFromJSONTyped(json, false);\n}\n\nexport function VCenterFromJSONTyped(json: any, ignoreDiscriminator: boolean): VCenter {\n if (json == null) {\n return json;\n }\n return {\n \n 'id': json['id'],\n };\n}\n\nexport function VCenterToJSON(value?: VCenter | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'id': value['id'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "9dcf1349-218a-4e94-abbd-dbc16f2053f5", | |
| "name": "instanceOfVCenter", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VCenter.ts", | |
| "code": "function instanceOfVCenter(value: object): value is VCenter {\n if (!('id' in value) || value['id'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c09f32c0-3e5a-4536-b0f9-2a2163f8187b", | |
| "name": "VCenterFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VCenter.ts", | |
| "code": "function VCenterFromJSON(json: any): VCenter {\n return VCenterFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f01a1146-9af5-403b-bd2c-2c9b2c6c2946", | |
| "name": "VCenterFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VCenter.ts", | |
| "code": "function VCenterFromJSONTyped(json: any, ignoreDiscriminator: boolean): VCenter {\n if (json == null) {\n return json;\n }\n return {\n \n 'id': json['id'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "96e4cbb9-0547-46e7-bdea-60060c587ad0", | |
| "name": "VCenterToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VCenter.ts", | |
| "code": "function VCenterToJSON(value?: VCenter | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'id': value['id'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "e006fdde-ee69-45ad-a8c4-6aad5dd211f5", | |
| "name": "VMResourceBreakdown.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}, {'import_name': ['VMResourceBreakdownHistogram'], 'import_path': './VMResourceBreakdownHistogram'}, {'import_name': ['VMResourceBreakdownHistogramFromJSON', 'VMResourceBreakdownHistogramFromJSONTyped', 'VMResourceBreakdownHistogramToJSON'], 'import_path': './VMResourceBreakdownHistogram'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdown.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\nimport type { VMResourceBreakdownHistogram } from './VMResourceBreakdownHistogram';\nimport {\n VMResourceBreakdownHistogramFromJSON,\n VMResourceBreakdownHistogramFromJSONTyped,\n VMResourceBreakdownHistogramToJSON,\n} from './VMResourceBreakdownHistogram';\n\n/**\n * \n * @export\n * @interface VMResourceBreakdown\n */\nexport interface VMResourceBreakdown {\n /**\n * \n * @type {number}\n * @memberof VMResourceBreakdown\n */\n total: number;\n /**\n * \n * @type {number}\n * @memberof VMResourceBreakdown\n */\n totalForMigratable: number;\n /**\n * \n * @type {number}\n * @memberof VMResourceBreakdown\n */\n totalForMigratableWithWarnings: number;\n /**\n * \n * @type {number}\n * @memberof VMResourceBreakdown\n */\n totalForNotMigratable: number;\n /**\n * \n * @type {VMResourceBreakdownHistogram}\n * @memberof VMResourceBreakdown\n */\n histogram: VMResourceBreakdownHistogram;\n}\n\n/**\n * Check if a given object implements the VMResourceBreakdown interface.\n */\nexport function instanceOfVMResourceBreakdown(value: object): value is VMResourceBreakdown {\n if (!('total' in value) || value['total'] === undefined) return false;\n if (!('totalForMigratable' in value) || value['totalForMigratable'] === undefined) return false;\n if (!('totalForMigratableWithWarnings' in value) || value['totalForMigratableWithWarnings'] === undefined) return false;\n if (!('totalForNotMigratable' in value) || value['totalForNotMigratable'] === undefined) return false;\n if (!('histogram' in value) || value['histogram'] === undefined) return false;\n return true;\n}\n\nexport function VMResourceBreakdownFromJSON(json: any): VMResourceBreakdown {\n return VMResourceBreakdownFromJSONTyped(json, false);\n}\n\nexport function VMResourceBreakdownFromJSONTyped(json: any, ignoreDiscriminator: boolean): VMResourceBreakdown {\n if (json == null) {\n return json;\n }\n return {\n \n 'total': json['total'],\n 'totalForMigratable': json['totalForMigratable'],\n 'totalForMigratableWithWarnings': json['totalForMigratableWithWarnings'],\n 'totalForNotMigratable': json['totalForNotMigratable'],\n 'histogram': VMResourceBreakdownHistogramFromJSON(json['histogram']),\n };\n}\n\nexport function VMResourceBreakdownToJSON(value?: VMResourceBreakdown | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'total': value['total'],\n 'totalForMigratable': value['totalForMigratable'],\n 'totalForMigratableWithWarnings': value['totalForMigratableWithWarnings'],\n 'totalForNotMigratable': value['totalForNotMigratable'],\n 'histogram': VMResourceBreakdownHistogramToJSON(value['histogram']),\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c1508c0a-112c-443d-a571-d6c573eea095", | |
| "name": "instanceOfVMResourceBreakdown", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdown.ts", | |
| "code": "function instanceOfVMResourceBreakdown(value: object): value is VMResourceBreakdown {\n if (!('total' in value) || value['total'] === undefined) return false;\n if (!('totalForMigratable' in value) || value['totalForMigratable'] === undefined) return false;\n if (!('totalForMigratableWithWarnings' in value) || value['totalForMigratableWithWarnings'] === undefined) return false;\n if (!('totalForNotMigratable' in value) || value['totalForNotMigratable'] === undefined) return false;\n if (!('histogram' in value) || value['histogram'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "dcb9db7e-9a53-40f6-b1b8-cf8e221e4a1e", | |
| "name": "VMResourceBreakdownFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdown.ts", | |
| "code": "function VMResourceBreakdownFromJSON(json: any): VMResourceBreakdown {\n return VMResourceBreakdownFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "a9c849fa-829a-43ec-ad86-f92e3e7abf6c", | |
| "name": "VMResourceBreakdownFromJSONTyped", | |
| "imports": "[{'import_name': ['VMResourceBreakdownHistogram'], 'import_path': './VMResourceBreakdownHistogram'}, {'import_name': ['VMResourceBreakdownHistogramFromJSON'], 'import_path': './VMResourceBreakdownHistogram'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdown.ts", | |
| "code": "function VMResourceBreakdownFromJSONTyped(json: any, ignoreDiscriminator: boolean): VMResourceBreakdown {\n if (json == null) {\n return json;\n }\n return {\n \n 'total': json['total'],\n 'totalForMigratable': json['totalForMigratable'],\n 'totalForMigratableWithWarnings': json['totalForMigratableWithWarnings'],\n 'totalForNotMigratable': json['totalForNotMigratable'],\n 'histogram': VMResourceBreakdownHistogramFromJSON(json['histogram']),\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "244d05b0-2c41-48ca-963d-ba177c8cd0a2", | |
| "name": "VMResourceBreakdownToJSON", | |
| "imports": "[{'import_name': ['VMResourceBreakdownHistogram'], 'import_path': './VMResourceBreakdownHistogram'}, {'import_name': ['VMResourceBreakdownHistogramToJSON'], 'import_path': './VMResourceBreakdownHistogram'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdown.ts", | |
| "code": "function VMResourceBreakdownToJSON(value?: VMResourceBreakdown | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'total': value['total'],\n 'totalForMigratable': value['totalForMigratable'],\n 'totalForMigratableWithWarnings': value['totalForMigratableWithWarnings'],\n 'totalForNotMigratable': value['totalForNotMigratable'],\n 'histogram': VMResourceBreakdownHistogramToJSON(value['histogram']),\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c4a02e6a-cc05-423c-a7d2-cf4fc7db970b", | |
| "name": "VMResourceBreakdownHistogram.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdownHistogram.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\n/**\n * \n * @export\n * @interface VMResourceBreakdownHistogram\n */\nexport interface VMResourceBreakdownHistogram {\n /**\n * \n * @type {number}\n * @memberof VMResourceBreakdownHistogram\n */\n minValue: number;\n /**\n * \n * @type {number}\n * @memberof VMResourceBreakdownHistogram\n */\n step: number;\n /**\n * \n * @type {Array<number>}\n * @memberof VMResourceBreakdownHistogram\n */\n data: Array<number>;\n}\n\n/**\n * Check if a given object implements the VMResourceBreakdownHistogram interface.\n */\nexport function instanceOfVMResourceBreakdownHistogram(value: object): value is VMResourceBreakdownHistogram {\n if (!('minValue' in value) || value['minValue'] === undefined) return false;\n if (!('step' in value) || value['step'] === undefined) return false;\n if (!('data' in value) || value['data'] === undefined) return false;\n return true;\n}\n\nexport function VMResourceBreakdownHistogramFromJSON(json: any): VMResourceBreakdownHistogram {\n return VMResourceBreakdownHistogramFromJSONTyped(json, false);\n}\n\nexport function VMResourceBreakdownHistogramFromJSONTyped(json: any, ignoreDiscriminator: boolean): VMResourceBreakdownHistogram {\n if (json == null) {\n return json;\n }\n return {\n \n 'minValue': json['minValue'],\n 'step': json['step'],\n 'data': json['data'],\n };\n}\n\nexport function VMResourceBreakdownHistogramToJSON(value?: VMResourceBreakdownHistogram | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'minValue': value['minValue'],\n 'step': value['step'],\n 'data': value['data'],\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "82e55ac7-2e90-44ba-a6fb-fbe662567db6", | |
| "name": "instanceOfVMResourceBreakdownHistogram", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdownHistogram.ts", | |
| "code": "function instanceOfVMResourceBreakdownHistogram(value: object): value is VMResourceBreakdownHistogram {\n if (!('minValue' in value) || value['minValue'] === undefined) return false;\n if (!('step' in value) || value['step'] === undefined) return false;\n if (!('data' in value) || value['data'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "245e6063-a058-4bb5-ae16-cb3dc2e3495d", | |
| "name": "VMResourceBreakdownHistogramFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdownHistogram.ts", | |
| "code": "function VMResourceBreakdownHistogramFromJSON(json: any): VMResourceBreakdownHistogram {\n return VMResourceBreakdownHistogramFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "2ff4baad-8bcd-4a4a-87c6-9e0be3206940", | |
| "name": "VMResourceBreakdownHistogramFromJSONTyped", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdownHistogram.ts", | |
| "code": "function VMResourceBreakdownHistogramFromJSONTyped(json: any, ignoreDiscriminator: boolean): VMResourceBreakdownHistogram {\n if (json == null) {\n return json;\n }\n return {\n \n 'minValue': json['minValue'],\n 'step': json['step'],\n 'data': json['data'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "734f5cea-78f2-4db7-9106-a11cd80ab902", | |
| "name": "VMResourceBreakdownHistogramToJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMResourceBreakdownHistogram.ts", | |
| "code": "function VMResourceBreakdownHistogramToJSON(value?: VMResourceBreakdownHistogram | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'minValue': value['minValue'],\n 'step': value['step'],\n 'data': value['data'],\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "085547d5-4618-4180-beab-8ddaa0e6b3f0", | |
| "name": "VMs.ts", | |
| "imports": "[{'import_name': ['mapValues'], 'import_path': '../runtime'}, {'import_name': ['MigrationIssuesInner'], 'import_path': './MigrationIssuesInner'}, {'import_name': ['MigrationIssuesInnerFromJSON', 'MigrationIssuesInnerFromJSONTyped', 'MigrationIssuesInnerToJSON'], 'import_path': './MigrationIssuesInner'}, {'import_name': ['VMResourceBreakdown'], 'import_path': './VMResourceBreakdown'}, {'import_name': ['VMResourceBreakdownFromJSON', 'VMResourceBreakdownFromJSONTyped', 'VMResourceBreakdownToJSON'], 'import_path': './VMResourceBreakdown'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMs.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\n/**\n * Migration Planner API\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: undefined\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { mapValues } from '../runtime';\nimport type { MigrationIssuesInner } from './MigrationIssuesInner';\nimport {\n MigrationIssuesInnerFromJSON,\n MigrationIssuesInnerFromJSONTyped,\n MigrationIssuesInnerToJSON,\n} from './MigrationIssuesInner';\nimport type { VMResourceBreakdown } from './VMResourceBreakdown';\nimport {\n VMResourceBreakdownFromJSON,\n VMResourceBreakdownFromJSONTyped,\n VMResourceBreakdownToJSON,\n} from './VMResourceBreakdown';\n\n/**\n * \n * @export\n * @interface VMs\n */\nexport interface VMs {\n /**\n * \n * @type {number}\n * @memberof VMs\n */\n total: number;\n /**\n * \n * @type {number}\n * @memberof VMs\n */\n totalMigratable: number;\n /**\n * \n * @type {number}\n * @memberof VMs\n */\n totalMigratableWithWarnings?: number;\n /**\n * \n * @type {VMResourceBreakdown}\n * @memberof VMs\n */\n cpuCores: VMResourceBreakdown;\n /**\n * \n * @type {VMResourceBreakdown}\n * @memberof VMs\n */\n ramGB: VMResourceBreakdown;\n /**\n * \n * @type {VMResourceBreakdown}\n * @memberof VMs\n */\n diskGB: VMResourceBreakdown;\n /**\n * \n * @type {VMResourceBreakdown}\n * @memberof VMs\n */\n diskCount: VMResourceBreakdown;\n /**\n * \n * @type {{ [key: string]: number; }}\n * @memberof VMs\n */\n powerStates: { [key: string]: number; };\n /**\n * \n * @type {{ [key: string]: number; }}\n * @memberof VMs\n */\n os: { [key: string]: number; };\n /**\n * \n * @type {Array<MigrationIssuesInner>}\n * @memberof VMs\n */\n notMigratableReasons: Array<MigrationIssuesInner>;\n /**\n * \n * @type {Array<MigrationIssuesInner>}\n * @memberof VMs\n */\n migrationWarnings: Array<MigrationIssuesInner>;\n}\n\n/**\n * Check if a given object implements the VMs interface.\n */\nexport function instanceOfVMs(value: object): value is VMs {\n if (!('total' in value) || value['total'] === undefined) return false;\n if (!('totalMigratable' in value) || value['totalMigratable'] === undefined) return false;\n if (!('cpuCores' in value) || value['cpuCores'] === undefined) return false;\n if (!('ramGB' in value) || value['ramGB'] === undefined) return false;\n if (!('diskGB' in value) || value['diskGB'] === undefined) return false;\n if (!('diskCount' in value) || value['diskCount'] === undefined) return false;\n if (!('powerStates' in value) || value['powerStates'] === undefined) return false;\n if (!('os' in value) || value['os'] === undefined) return false;\n if (!('notMigratableReasons' in value) || value['notMigratableReasons'] === undefined) return false;\n if (!('migrationWarnings' in value) || value['migrationWarnings'] === undefined) return false;\n return true;\n}\n\nexport function VMsFromJSON(json: any): VMs {\n return VMsFromJSONTyped(json, false);\n}\n\nexport function VMsFromJSONTyped(json: any, ignoreDiscriminator: boolean): VMs {\n if (json == null) {\n return json;\n }\n return {\n \n 'total': json['total'],\n 'totalMigratable': json['totalMigratable'],\n 'totalMigratableWithWarnings': json['totalMigratableWithWarnings'] == null ? undefined : json['totalMigratableWithWarnings'],\n 'cpuCores': json['cpuCores'],\n 'ramGB': json['ramGB'],\n 'diskGB': json['diskGB'],\n 'diskCount': json['diskCount'],\n 'powerStates': json['powerStates'],\n 'os': json['os'],\n 'notMigratableReasons': ((json['notMigratableReasons'] as Array<any>).map(MigrationIssuesInnerFromJSON)),\n 'migrationWarnings': ((json['migrationWarnings'] as Array<any>).map(MigrationIssuesInnerFromJSON)),\n };\n}\n\nexport function VMsToJSON(value?: VMs | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'total': value['total'],\n 'totalMigratable': value['totalMigratable'],\n 'totalMigratableWithWarnings': value['totalMigratableWithWarnings'],\n 'cpuCores': value['cpuCores'],\n 'ramGB': value['ramGB'],\n 'diskGB': value['diskGB'],\n 'diskCount': value['diskCount'],\n 'powerStates': value['powerStates'],\n 'os': value['os'],\n 'notMigratableReasons': ((value['notMigratableReasons'] as Array<any>).map(MigrationIssuesInnerToJSON)),\n 'migrationWarnings': ((value['migrationWarnings'] as Array<any>).map(MigrationIssuesInnerToJSON)),\n };\n}\n\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "9dd63189-12f1-4cf5-957f-b06335fddca3", | |
| "name": "instanceOfVMs", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMs.ts", | |
| "code": "function instanceOfVMs(value: object): value is VMs {\n if (!('total' in value) || value['total'] === undefined) return false;\n if (!('totalMigratable' in value) || value['totalMigratable'] === undefined) return false;\n if (!('cpuCores' in value) || value['cpuCores'] === undefined) return false;\n if (!('ramGB' in value) || value['ramGB'] === undefined) return false;\n if (!('diskGB' in value) || value['diskGB'] === undefined) return false;\n if (!('diskCount' in value) || value['diskCount'] === undefined) return false;\n if (!('powerStates' in value) || value['powerStates'] === undefined) return false;\n if (!('os' in value) || value['os'] === undefined) return false;\n if (!('notMigratableReasons' in value) || value['notMigratableReasons'] === undefined) return false;\n if (!('migrationWarnings' in value) || value['migrationWarnings'] === undefined) return false;\n return true;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "dc9496ec-22f6-47fa-b7ff-e887bdae9f8a", | |
| "name": "VMsFromJSON", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMs.ts", | |
| "code": "function VMsFromJSON(json: any): VMs {\n return VMsFromJSONTyped(json, false);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "48ad01e6-94a7-4576-8ce8-3f229f0e9eef", | |
| "name": "VMsFromJSONTyped", | |
| "imports": "[{'import_name': ['MigrationIssuesInner'], 'import_path': './MigrationIssuesInner'}, {'import_name': ['MigrationIssuesInnerFromJSON'], 'import_path': './MigrationIssuesInner'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMs.ts", | |
| "code": "function VMsFromJSONTyped(json: any, ignoreDiscriminator: boolean): VMs {\n if (json == null) {\n return json;\n }\n return {\n \n 'total': json['total'],\n 'totalMigratable': json['totalMigratable'],\n 'totalMigratableWithWarnings': json['totalMigratableWithWarnings'] == null ? undefined : json['totalMigratableWithWarnings'],\n 'cpuCores': json['cpuCores'],\n 'ramGB': json['ramGB'],\n 'diskGB': json['diskGB'],\n 'diskCount': json['diskCount'],\n 'powerStates': json['powerStates'],\n 'os': json['os'],\n 'notMigratableReasons': ((json['notMigratableReasons'] as Array<any>).map(MigrationIssuesInnerFromJSON)),\n 'migrationWarnings': ((json['migrationWarnings'] as Array<any>).map(MigrationIssuesInnerFromJSON)),\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "034cbaad-deca-4490-8a8c-f33098b685f1", | |
| "name": "VMsToJSON", | |
| "imports": "[{'import_name': ['MigrationIssuesInner'], 'import_path': './MigrationIssuesInner'}, {'import_name': ['MigrationIssuesInnerToJSON'], 'import_path': './MigrationIssuesInner'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/VMs.ts", | |
| "code": "function VMsToJSON(value?: VMs | null): any {\n if (value == null) {\n return value;\n }\n return {\n \n 'total': value['total'],\n 'totalMigratable': value['totalMigratable'],\n 'totalMigratableWithWarnings': value['totalMigratableWithWarnings'],\n 'cpuCores': value['cpuCores'],\n 'ramGB': value['ramGB'],\n 'diskGB': value['diskGB'],\n 'diskCount': value['diskCount'],\n 'powerStates': value['powerStates'],\n 'os': value['os'],\n 'notMigratableReasons': ((value['notMigratableReasons'] as Array<any>).map(MigrationIssuesInnerToJSON)),\n 'migrationWarnings': ((value['migrationWarnings'] as Array<any>).map(MigrationIssuesInnerToJSON)),\n };\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "b853e448-230d-4557-a5fb-3ed903a19b28", | |
| "name": "index.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/api-client/src/models/index.ts", | |
| "code": "/* tslint:disable */\n/* eslint-disable */\nexport * from './Agent';\nexport * from './Infra';\nexport * from './InfraDatastoresInner';\nexport * from './InfraNetworksInner';\nexport * from './Inventory';\nexport * from './MigrationIssuesInner';\nexport * from './ModelError';\nexport * from './Source';\nexport * from './SourceAgentItem';\nexport * from './SourceCreate';\nexport * from './Status';\nexport * from './VCenter';\nexport * from './VMResourceBreakdown';\nexport * from './VMResourceBreakdownHistogram';\nexport * from './VMs';\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f3615429-0f53-4e86-b3db-1706959a339e", | |
| "name": "Container.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/ioc/src/Container.ts", | |
| "code": "/** A naive, singleton-scoped dependency injection container */\nexport class Container {\n readonly #registry: Record<symbol, unknown>;\n\n constructor() {\n this.#registry = {};\n }\n\n get<T>(registeredInterfaceSymbol: symbol): T {\n const value = this.#registry[registeredInterfaceSymbol] as T;\n return value;\n }\n\n register<T = unknown>(\n registeredInterfaceSymbol: symbol,\n value: T\n ): Container {\n this.#registry[registeredInterfaceSymbol] = value;\n\n return this;\n }\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "14691c72-709d-40a8-aec8-174c08132a5b", | |
| "name": "constructor", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/ioc/src/Container.ts", | |
| "code": "constructor() {\n this.#registry = {};\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Container" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "fdf63401-14a1-4e15-b058-ca27f88583ac", | |
| "name": "get", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/ioc/src/Container.ts", | |
| "code": "get<T>(registeredInterfaceSymbol: symbol): T {\n const value = this.#registry[registeredInterfaceSymbol] as T;\n return value;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Container" | |
| } | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "43fb25e8-fce3-4250-97cf-1a68a3367112", | |
| "name": "register", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/ioc/src/Container.ts", | |
| "code": "register<T = unknown>(\n registeredInterfaceSymbol: symbol,\n value: T\n ): Container {\n this.#registry[registeredInterfaceSymbol] = value;\n\n return this;\n }", | |
| "parent": { | |
| "type": "class_declaration", | |
| "name": "Container" | |
| } | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "c6d8cefd-42c8-465e-b49d-900ab55fdc7f", | |
| "name": "Provider.tsx", | |
| "imports": "[{'import_name': ['createContext', 'FC', 'PropsWithChildren'], 'import_path': 'react'}, {'import_name': ['Container'], 'import_path': './Container'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/ioc/src/Provider.tsx", | |
| "code": "import { createContext, type FC, type PropsWithChildren } from \"react\";\nimport { Container } from \"./Container\";\n\nexport const Context = createContext<Container | null>(null);\nexport const Provider: FC<\n PropsWithChildren<{ container: Container }>\n> = (props) => {\n const { container, children } = props;\n return <Context.Provider value={container}>{children}</Context.Provider>;\n};\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "74b46c32-dd1d-48e9-9612-c5e025f64c94", | |
| "name": "Provider", | |
| "imports": "[{'import_name': ['FC', 'PropsWithChildren'], 'import_path': 'react'}, {'import_name': ['Container'], 'import_path': './Container'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/ioc/src/Provider.tsx", | |
| "code": "Provider: FC<\n PropsWithChildren<{ container: Container }>\n> = (props) => {\n const { container, children } = props;\n return <Context.Provider value={container}>{children}</Context.Provider>;\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "1b93978e-cefb-4838-add7-71991839ae95", | |
| "name": "index.ts", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/ioc/src/index.ts", | |
| "code": "export * from \"./Container\";\nexport * from \"./Provider\";\nexport * from \"./hooks/UseInjection\";\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "73727769-083e-49f5-acf2-0ab8263c4a95", | |
| "name": "UseInjection.ts", | |
| "imports": "[{'import_name': ['useContext'], 'import_path': 'react'}, {'import_name': ['Context'], 'import_path': '../Provider'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/ioc/src/hooks/UseInjection.ts", | |
| "code": "import { useContext } from \"react\";\nimport { Context } from \"../Provider\";\n\nexport function useInjection<T>(registeredInterfaceSymbol: symbol): T {\n const container = useContext(Context);\n if (!container) {\n throw new ReferenceError(\"useInjection must be used inside its Provider\");\n }\n\n return container.get<T>(registeredInterfaceSymbol);\n}\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "migration-planner-ui", | |
| "uuid": "f47b9827-c9f2-4bfa-a714-1070b943222a", | |
| "name": "useInjection", | |
| "imports": "[{'import_name': ['useContext'], 'import_path': 'react'}, {'import_name': ['Context'], 'import_path': '../Provider'}]", | |
| "file_location": "https://github.com/konveyor/migration-planner-ui/packages/ioc/src/hooks/UseInjection.ts", | |
| "code": "function useInjection<T>(registeredInterfaceSymbol: symbol): T {\n const container = useContext(Context);\n if (!container) {\n throw new ReferenceError(\"useInjection must be used inside its Provider\");\n }\n\n return container.get<T>(registeredInterfaceSymbol);\n}", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "21925acf-f7d7-44f9-9e33-b41267d7efed", | |
| "name": "cypress.config.js", | |
| "imports": "[{'import_name': ['defineConfig'], 'import_path': 'cypress'}, {'import_name': ['homedir'], 'import_path': 'os'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress.config.js", | |
| "code": "import { defineConfig } from 'cypress';\nimport { homedir } from 'os';\nimport fs from 'fs';\nimport path from 'path';\n\nconst home = homedir();\nconst width = 1920;\nconst height = 1080;\n\nexport default defineConfig({\n env: {\n // Disable telemetry\n CRASH_REPORTS: 0,\n COMMERCIAL_RECOMMENDATIONS: 0,\n },\n reporter: '../node_modules/cypress-multi-reporters',\n reporterOptions: {\n configFile: 'reporter-config.json',\n },\n viewportWidth: width,\n viewportHeight: height,\n video: true,\n videoCompression: true, // default value (32)\n numTestsKeptInMemory: 5,\n chromeWebSecurity: false,\n\n // Timeouts\n execTimeout: 240000,\n defaultCommandTimeout: 60000,\n requestTimeout: 120000,\n responseTimeout: 120000,\n pageLoadTimeout: 15000,\n\n // Path overrides\n downloadsFolder: `${home}/Downloads`,\n videosFolder: `${home}/test_artifacts/videos`,\n screenshotsFolder: `${home}/test_artifacts/snapshots`,\n trashAssetsBeforeRuns: false,\n\n e2e: {\n // Cypress configuration. Application specific configuration is\n // located in cypress.env.json file.\n // baseUrl: passing in env variable\n specPattern: 'cypress/integration/**/*.spec.{js,jsx,ts,tsx}',\n supportFile: 'cypress/support/e2e.js',\n // excludeSpecPattern: Cypress.env('EXCLUDE_TESTS'),\n testIsolation: false,\n slowTestThreshold: 60 * 60 * 1000, // 1 hour\n setupNodeEvents(on, config) {\n on('task', {\n fileExists(filePath) {\n const fullPath = path.resolve(filePath); // Resolve the absolute path\n return fs.existsSync(fullPath); // Returns true or false\n },\n });\n },\n },\n});\n" | |
| }, | |
| { | |
| "element_type": "function", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "38936875-6ac9-4858-a1d2-b0ce06eb1b81", | |
| "name": "setupNodeEvents", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress.config.js", | |
| "code": "setupNodeEvents(on, config) {\n on('task', {\n fileExists(filePath) {\n const fullPath = path.resolve(filePath); // Resolve the absolute path\n return fs.existsSync(fullPath); // Returns true or false\n },\n });\n }", | |
| "parent": "" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "4dfece62-ce5e-4e41-ae2b-3c46be2e6e25", | |
| "name": "e2e-assessment-flow.spec.js", | |
| "imports": "[{'import_name': ['assessmentStartPage'], 'import_path': '../../../views/assessmentStartPage'}, {'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}, {'import_name': ['agentVM'], 'import_path': '../../../views/agentVM'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "import { assessmentStartPage } from '../../../views/assessmentStartPage';\nimport { assessmentConnectPage } from '../../../views/assessmentConnectPage';\nimport { agentVM } from '../../../views/agentVM';\n\ndescribe('Assisted Migration Assessment e2e', () => {\n beforeEach(() => {\n cy.getOvaAgentVmIpAddress(Cypress.env('ovaAgentVmName'));\n });\n afterEach(function () {\n if (this.currentTest.state === 'failed') {\n cy.log('e2e should stop early if any tests fail');\n Cypress.runner.stop();\n }\n });\n after(() => {\n cy.destroyAgentVm(Cypress.env('ovaAgentVmName'));\n });\n describe('Migration Assessment connect page', () => {\n before(() => {\n cy.cleanLeftOverFiles();\n });\n it('Should generate and download a discovery OVA', () => {\n assessmentStartPage.browseToAssesmentStartPage();\n assessmentStartPage.startMigrationJourneyButton();\n assessmentConnectPage.createSourceButton();\n assessmentConnectPage.downloadOvaImage();\n assessmentConnectPage.waitForOvaImageDownload();\n });\n });\n describe('Deploy Agent VM from OVA', () => {\n before(() => {\n cy.destroyAgentVm(Cypress.env('ovaAgentVmName'));\n });\n it('Should deploy an Agent VM on VCenter from the downloaded agent OVA', () => {\n cy.deployAgentVmFromOva(Cypress.env('ovaAgentVmName'), Cypress.env('ovaImageFileLocalPath'));\n });\n });\n describe('Source created waiting for credentials', () => {\n it('Source should be created on assessment page', () => {\n assessmentConnectPage.browseToAssesmentConnectPage();\n assessmentConnectPage.ensureAgentVmUrlMatchesVmIpAdd(Cypress.env('ovaAgentIpAddress'));\n assessmentConnectPage.checkSourceWaitingForCreds(Cypress.env('ovaAgentIpAddress'));\n });\n });\n describe('Registration to vcenter in agent VM', () => {\n it('Registration to vcenter in agent VM succeeds', () => {\n agentVM.browseToAgentVmPage(Cypress.env('ovaAgentIpAddress'));\n agentVM.inputVcenterUrl(Cypress.env('vcenterUrl'));\n agentVM.inputVcenterUser(Cypress.env('vcenterUser'));\n agentVM.inputVcenterPass(Cypress.env('vcenterPass'));\n agentVM.checkDataSharingAgreement();\n agentVM.loginButton();\n agentVM.confirmDiscoveryCompleted();\n agentVM.clickBackToAssessmentWizardButton();\n });\n });\n describe('Discovery Report is available', () => {\n it('Source status is moved to \"Up to date\"', () => {\n assessmentConnectPage.browseToAssesmentConnectPage();\n assessmentConnectPage.checkSourceUpToDate(Cypress.env('ovaAgentIpAddress'));\n });\n it('Discovery report page is available', () => {\n // Workaround for ECOPROJECT-2491\n assessmentConnectPage.workAroundForECOPROJECT_2491();\n assessmentConnectPage.selectSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n assessmentConnectPage.nextButtonIsAvailable();\n assessmentConnectPage.clickNextButton();\n assessmentConnectPage.onDiscoveryReportPage();\n });\n it('Prepare for Migration page is available', () => {\n assessmentConnectPage.nextButtonIsAvailable();\n assessmentConnectPage.clickNextButton();\n assessmentConnectPage.onPrepareForMigrationPage();\n });\n it('Lets create new cluster button works', () => {\n assessmentConnectPage.clickLetsCreateNewClusterButton();\n });\n });\n describe('Remove source from Assessment Connect Wizard', () => {\n it('Back button goes back to discovery report', () => {\n assessmentConnectPage.clickBackButton();\n assessmentConnectPage.onDiscoveryReportPage();\n });\n it('Back button goes back to vmware env table', () => {\n assessmentConnectPage.clickBackButton();\n assessmentConnectPage.onConnectVmwareEnvPage();\n });\n // ### [Chad] Leaving this commented out until ECOPROJECT-2492 is fixed\n // it('Delete source from environment table', () => {\n // assessmentConnectPage.selectSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n // assessmentConnectPage.clickDeleteSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n // assessmentConnectPage.clickConfirmButton();\n // });\n // it('Verify source is on longer in the table', () => {\n // assessmentConnectPage.agentVmSourceIsNotInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n // });\n });\n});\n" | |
| }, | |
| { | |
| "element_type": "test", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "65b12b18-f50a-403f-ab7c-83697a59aa8f", | |
| "name": "Assisted Migration Assessment e2e", | |
| "imports": "[{'import_name': ['assessmentStartPage'], 'import_path': '../../../views/assessmentStartPage'}, {'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}, {'import_name': ['agentVM'], 'import_path': '../../../views/agentVM'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "describe('Assisted Migration Assessment e2e', () => {\n beforeEach(() => {\n cy.getOvaAgentVmIpAddress(Cypress.env('ovaAgentVmName'));\n });\n afterEach(function () {\n if (this.currentTest.state === 'failed') {\n cy.log('e2e should stop early if any tests fail');\n Cypress.runner.stop();\n }\n });\n after(() => {\n cy.destroyAgentVm(Cypress.env('ovaAgentVmName'));\n });\n describe('Migration Assessment connect page', () => {\n before(() => {\n cy.cleanLeftOverFiles();\n });\n it('Should generate and download a discovery OVA', () => {\n assessmentStartPage.browseToAssesmentStartPage();\n assessmentStartPage.startMigrationJourneyButton();\n assessmentConnectPage.createSourceButton();\n assessmentConnectPage.downloadOvaImage();\n assessmentConnectPage.waitForOvaImageDownload();\n });\n });\n describe('Deploy Agent VM from OVA', () => {\n before(() => {\n cy.destroyAgentVm(Cypress.env('ovaAgentVmName'));\n });\n it('Should deploy an Agent VM on VCenter from the downloaded agent OVA', () => {\n cy.deployAgentVmFromOva(Cypress.env('ovaAgentVmName'), Cypress.env('ovaImageFileLocalPath'));\n });\n });\n describe('Source created waiting for credentials', () => {\n it('Source should be created on assessment page', () => {\n assessmentConnectPage.browseToAssesmentConnectPage();\n assessmentConnectPage.ensureAgentVmUrlMatchesVmIpAdd(Cypress.env('ovaAgentIpAddress'));\n assessmentConnectPage.checkSourceWaitingForCreds(Cypress.env('ovaAgentIpAddress'));\n });\n });\n describe('Registration to vcenter in agent VM', () => {\n it('Registration to vcenter in agent VM succeeds', () => {\n agentVM.browseToAgentVmPage(Cypress.env('ovaAgentIpAddress'));\n agentVM.inputVcenterUrl(Cypress.env('vcenterUrl'));\n agentVM.inputVcenterUser(Cypress.env('vcenterUser'));\n agentVM.inputVcenterPass(Cypress.env('vcenterPass'));\n agentVM.checkDataSharingAgreement();\n agentVM.loginButton();\n agentVM.confirmDiscoveryCompleted();\n agentVM.clickBackToAssessmentWizardButton();\n });\n });\n describe('Discovery Report is available', () => {\n it('Source status is moved to \"Up to date\"', () => {\n assessmentConnectPage.browseToAssesmentConnectPage();\n assessmentConnectPage.checkSourceUpToDate(Cypress.env('ovaAgentIpAddress'));\n });\n it('Discovery report page is available', () => {\n // Workaround for ECOPROJECT-2491\n assessmentConnectPage.workAroundForECOPROJECT_2491();\n assessmentConnectPage.selectSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n assessmentConnectPage.nextButtonIsAvailable();\n assessmentConnectPage.clickNextButton();\n assessmentConnectPage.onDiscoveryReportPage();\n });\n it('Prepare for Migration page is available', () => {\n assessmentConnectPage.nextButtonIsAvailable();\n assessmentConnectPage.clickNextButton();\n assessmentConnectPage.onPrepareForMigrationPage();\n });\n it('Lets create new cluster button works', () => {\n assessmentConnectPage.clickLetsCreateNewClusterButton();\n });\n });\n describe('Remove source from Assessment Connect Wizard', () => {\n it('Back button goes back to discovery report', () => {\n assessmentConnectPage.clickBackButton();\n assessmentConnectPage.onDiscoveryReportPage();\n });\n it('Back button goes back to vmware env table', () => {\n assessmentConnectPage.clickBackButton();\n assessmentConnectPage.onConnectVmwareEnvPage();\n });\n // ### [Chad] Leaving this commented out until ECOPROJECT-2492 is fixed\n // it('Delete source from environment table', () => {\n // assessmentConnectPage.selectSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n // assessmentConnectPage.clickDeleteSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n // assessmentConnectPage.clickConfirmButton();\n // });\n // it('Verify source is on longer in the table', () => {\n // assessmentConnectPage.agentVmSourceIsNotInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n // });\n });\n})" | |
| }, | |
| { | |
| "element_type": "test", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "ed3a5a66-4a72-4087-bfed-c74a8b482947", | |
| "name": "Migration Assessment connect page", | |
| "imports": "[{'import_name': ['assessmentStartPage'], 'import_path': '../../../views/assessmentStartPage'}, {'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "describe('Migration Assessment connect page', () => {\n before(() => {\n cy.cleanLeftOverFiles();\n });\n it('Should generate and download a discovery OVA', () => {\n assessmentStartPage.browseToAssesmentStartPage();\n assessmentStartPage.startMigrationJourneyButton();\n assessmentConnectPage.createSourceButton();\n assessmentConnectPage.downloadOvaImage();\n assessmentConnectPage.waitForOvaImageDownload();\n });\n })" | |
| }, | |
| { | |
| "element_type": "test", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "771ce3bb-9636-45aa-b178-41e3c25339e3", | |
| "name": "Deploy Agent VM from OVA", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "describe('Deploy Agent VM from OVA', () => {\n before(() => {\n cy.destroyAgentVm(Cypress.env('ovaAgentVmName'));\n });\n it('Should deploy an Agent VM on VCenter from the downloaded agent OVA', () => {\n cy.deployAgentVmFromOva(Cypress.env('ovaAgentVmName'), Cypress.env('ovaImageFileLocalPath'));\n });\n })" | |
| }, | |
| { | |
| "element_type": "test", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "a1379adb-0f71-4817-9ab8-0637ce0873c6", | |
| "name": "Source created waiting for credentials", | |
| "imports": "[{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "describe('Source created waiting for credentials', () => {\n it('Source should be created on assessment page', () => {\n assessmentConnectPage.browseToAssesmentConnectPage();\n assessmentConnectPage.ensureAgentVmUrlMatchesVmIpAdd(Cypress.env('ovaAgentIpAddress'));\n assessmentConnectPage.checkSourceWaitingForCreds(Cypress.env('ovaAgentIpAddress'));\n });\n })" | |
| }, | |
| { | |
| "element_type": "test", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "3c5aacb0-1b55-4bf4-a6cf-602a7eb1512d", | |
| "name": "Registration to vcenter in agent VM", | |
| "imports": "[{'import_name': ['agentVM'], 'import_path': '../../../views/agentVM'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "describe('Registration to vcenter in agent VM', () => {\n it('Registration to vcenter in agent VM succeeds', () => {\n agentVM.browseToAgentVmPage(Cypress.env('ovaAgentIpAddress'));\n agentVM.inputVcenterUrl(Cypress.env('vcenterUrl'));\n agentVM.inputVcenterUser(Cypress.env('vcenterUser'));\n agentVM.inputVcenterPass(Cypress.env('vcenterPass'));\n agentVM.checkDataSharingAgreement();\n agentVM.loginButton();\n agentVM.confirmDiscoveryCompleted();\n agentVM.clickBackToAssessmentWizardButton();\n });\n })" | |
| }, | |
| { | |
| "element_type": "test", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "c9b9b4a5-41ae-42e3-a220-de808739579b", | |
| "name": "Discovery Report is available", | |
| "imports": "[{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "describe('Discovery Report is available', () => {\n it('Source status is moved to \"Up to date\"', () => {\n assessmentConnectPage.browseToAssesmentConnectPage();\n assessmentConnectPage.checkSourceUpToDate(Cypress.env('ovaAgentIpAddress'));\n });\n it('Discovery report page is available', () => {\n // Workaround for ECOPROJECT-2491\n assessmentConnectPage.workAroundForECOPROJECT_2491();\n assessmentConnectPage.selectSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n assessmentConnectPage.nextButtonIsAvailable();\n assessmentConnectPage.clickNextButton();\n assessmentConnectPage.onDiscoveryReportPage();\n });\n it('Prepare for Migration page is available', () => {\n assessmentConnectPage.nextButtonIsAvailable();\n assessmentConnectPage.clickNextButton();\n assessmentConnectPage.onPrepareForMigrationPage();\n });\n it('Lets create new cluster button works', () => {\n assessmentConnectPage.clickLetsCreateNewClusterButton();\n });\n })" | |
| }, | |
| { | |
| "element_type": "test", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "a769811a-83c4-4ab4-8814-825a11d94811", | |
| "name": "Remove source from Assessment Connect Wizard", | |
| "imports": "[{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "describe('Remove source from Assessment Connect Wizard', () => {\n it('Back button goes back to discovery report', () => {\n assessmentConnectPage.clickBackButton();\n assessmentConnectPage.onDiscoveryReportPage();\n });\n it('Back button goes back to vmware env table', () => {\n assessmentConnectPage.clickBackButton();\n assessmentConnectPage.onConnectVmwareEnvPage();\n });\n // ### [Chad] Leaving this commented out until ECOPROJECT-2492 is fixed\n // it('Delete source from environment table', () => {\n // assessmentConnectPage.selectSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n // assessmentConnectPage.clickDeleteSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n // assessmentConnectPage.clickConfirmButton();\n // });\n // it('Verify source is on longer in the table', () => {\n // assessmentConnectPage.agentVmSourceIsNotInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n // });\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "c405b6b2-ba2b-4e34-a653-7427f0ec5f83", | |
| "name": "Should generate and download a discovery OVA", | |
| "imports": "Imports Used: [{'import_name': ['assessmentStartPage'], 'import_path': '../../../views/assessmentStartPage'}, {'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Should generate and download a discovery OVA', () => {\n assessmentStartPage.browseToAssesmentStartPage();\n assessmentStartPage.startMigrationJourneyButton();\n assessmentConnectPage.createSourceButton();\n assessmentConnectPage.downloadOvaImage();\n assessmentConnectPage.waitForOvaImageDownload();\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "b16d9ec8-fe41-469b-837b-e9f3e0277e5f", | |
| "name": "Should deploy an Agent VM on VCenter from the downloaded agent OVA", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Should deploy an Agent VM on VCenter from the downloaded agent OVA', () => {\n cy.deployAgentVmFromOva(Cypress.env('ovaAgentVmName'), Cypress.env('ovaImageFileLocalPath'));\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "70601c83-229f-40ea-97ea-d736acf104c7", | |
| "name": "Source should be created on assessment page", | |
| "imports": "Imports Used: [{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Source should be created on assessment page', () => {\n assessmentConnectPage.browseToAssesmentConnectPage();\n assessmentConnectPage.ensureAgentVmUrlMatchesVmIpAdd(Cypress.env('ovaAgentIpAddress'));\n assessmentConnectPage.checkSourceWaitingForCreds(Cypress.env('ovaAgentIpAddress'));\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "d50bcd96-cbc4-4960-bbf3-c7eb867b041c", | |
| "name": "Registration to vcenter in agent VM succeeds", | |
| "imports": "Imports Used: [{'import_name': ['agentVM'], 'import_path': '../../../views/agentVM'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Registration to vcenter in agent VM succeeds', () => {\n agentVM.browseToAgentVmPage(Cypress.env('ovaAgentIpAddress'));\n agentVM.inputVcenterUrl(Cypress.env('vcenterUrl'));\n agentVM.inputVcenterUser(Cypress.env('vcenterUser'));\n agentVM.inputVcenterPass(Cypress.env('vcenterPass'));\n agentVM.checkDataSharingAgreement();\n agentVM.loginButton();\n agentVM.confirmDiscoveryCompleted();\n agentVM.clickBackToAssessmentWizardButton();\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "d623c4e3-8041-4655-a93d-7e2eb1d64105", | |
| "name": "Source status is moved to \"Up to date", | |
| "imports": "Imports Used: [{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Source status is moved to \"Up to date\"', () => {\n assessmentConnectPage.browseToAssesmentConnectPage();\n assessmentConnectPage.checkSourceUpToDate(Cypress.env('ovaAgentIpAddress'));\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "c6ddbc99-9ede-47bf-8535-f93b03e4d2c4", | |
| "name": "Discovery report page is available", | |
| "imports": "Imports Used: [{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Discovery report page is available', () => {\n // Workaround for ECOPROJECT-2491\n assessmentConnectPage.workAroundForECOPROJECT_2491();\n assessmentConnectPage.selectSourceInVmwareEnvTable(Cypress.env('ovaAgentIpAddress'));\n assessmentConnectPage.nextButtonIsAvailable();\n assessmentConnectPage.clickNextButton();\n assessmentConnectPage.onDiscoveryReportPage();\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "a166de50-36f9-4942-bd21-2eca31993824", | |
| "name": "Prepare for Migration page is available", | |
| "imports": "Imports Used: [{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Prepare for Migration page is available', () => {\n assessmentConnectPage.nextButtonIsAvailable();\n assessmentConnectPage.clickNextButton();\n assessmentConnectPage.onPrepareForMigrationPage();\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "43e37c2f-d5bc-4b9c-900a-041660e632a3", | |
| "name": "Lets create new cluster button works", | |
| "imports": "Imports Used: [{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Lets create new cluster button works', () => {\n assessmentConnectPage.clickLetsCreateNewClusterButton();\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "9e2d5a6b-15b9-4000-b544-6d22da15af24", | |
| "name": "Back button goes back to discovery report", | |
| "imports": "Imports Used: [{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Back button goes back to discovery report', () => {\n assessmentConnectPage.clickBackButton();\n assessmentConnectPage.onDiscoveryReportPage();\n })" | |
| }, | |
| { | |
| "element_type": "test case", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "256f85e3-bd25-43f9-b1dd-de6bdb3f07c3", | |
| "name": "Back button goes back to vmware env table", | |
| "imports": "Imports Used: [{'import_name': ['assessmentConnectPage'], 'import_path': '../../../views/assessmentConnectPage'}]", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/integration/assessment/workflows/e2e-assessment-flow.spec.js", | |
| "code": "it('Back button goes back to vmware env table', () => {\n assessmentConnectPage.clickBackButton();\n assessmentConnectPage.onConnectVmwareEnvPage();\n })" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "a9881869-945d-44d9-9f54-65862154bae3", | |
| "name": "commands.js", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/support/commands.js", | |
| "code": "Cypress.Commands.add('cleanLeftOverFiles', () => {\n cy.exec(`rm -rf ${Cypress.env('ovaImageFileLocalPath')}`);\n});\n\nCypress.Commands.add('fileExists', (filePath, retries = 5, delay = 1000) => {\n // Retry logic\n let attempt = 0;\n\n const checkFileExistence = () => {\n cy.task('fileExists', filePath).then((exists) => {\n attempt++;\n if (exists) {\n cy.log(`File found after ${attempt} attempts`);\n } else {\n if (attempt < retries) {\n cy.log(`File not found, retrying in ${delay}ms...`);\n cy.wait(delay);\n checkFileExistence();\n } else {\n throw new Error(`File not found after ${attempt} attempts`);\n }\n }\n });\n };\n\n checkFileExistence();\n});\n\nCypress.Commands.add('runAnsiblePlaybook', (playbookFile, extraVars) => {\n cy.exec(`bash scripts/run_ansible_playbook.sh ${playbookFile} ${extraVars}`);\n});\n\nCypress.Commands.add('deployAgentVmFromOva', (vmName, ovaFilePath) => {\n const extraVars = `\"vm_name=${vmName} ova_file_path=${ovaFilePath}\"`;\n const playbookFile = `deploy_ova_vcenter.yml`;\n cy.runAnsiblePlaybook(playbookFile, extraVars);\n});\n\nCypress.Commands.add('destroyAgentVm', (vmName) => {\n const extraVars = `\"vm_name=${vmName}\"`;\n const playbookFile = `destroy_ova_vcenter.yml`;\n cy.runAnsiblePlaybook(playbookFile, extraVars);\n});\n\nCypress.Commands.add('getOvaAgentVmIpAddress', (ovaAgentVmName) => {\n const agentVmPath = 'cypress/fixtures/agent_vm.json';\n cy.readFile(agentVmPath).then((agent_vm) => {\n Cypress.env('ovaAgentIpAddress', agent_vm[ovaAgentVmName]);\n cy.log(`${ovaAgentVmName} VM IP address is ${Cypress.env('ovaAgentIpAddress')}`);\n cy.log(`agent_vm.json content is: `, JSON.stringify(agent_vm));\n });\n});\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "80c67d4b-ff74-4d69-b8b6-8df95f760b52", | |
| "name": "e2e.js", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/support/e2e.js", | |
| "code": "// ***********************************************************\n// This example support/index.js is processed and\n// loaded automatically before your test files.\n//\n// This is a great place to put global configuration and\n// behavior that modifies Cypress.\n//\n// You can change the location of this file or turn off\n// automatically serving support files with the\n// 'supportFile' configuration option.\n//\n// You can read more here:\n// https://on.cypress.io/configuration\n// ***********************************************************\n\n// Import commands.js using ES2015 syntax:\n// import './api';\nimport './commands';\n// import './selectors';\n// import './interceptors';\n// import './login';\n// import './transformations';\n// import './variables';\n// import './variables_pf5';\nimport path from 'path';\n\n// vars\nCypress.env('assessmentUrl', Cypress.env('ASSESSMENT_URL'));\nCypress.env('vcenterUrl', Cypress.env('VCENTER_URL'));\nCypress.env('vcenterUser', Cypress.env('VCENTER_USER'));\nCypress.env('vcenterPass', Cypress.env('VCENTER_PASS'));\nCypress.env('ovaImageFileName', 'image.ova');\nCypress.env('ovaAgentVmName', Cypress.env('OVA_AGENT_VM_NAME'));\nCypress.env(\n 'ovaImageFileLocalPath',\n path.join(Cypress.config('downloadsFolder')) + '/' + Cypress.env('ovaImageFileName'),\n);\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "bc63cfa1-8603-4f16-a49b-83317910f3be", | |
| "name": "agentVM.js", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/views/agentVM.js", | |
| "code": "/* eslint-disable cypress/unsafe-to-chain-command */\n\nexport const agentVM = {\n browseToAgentVmPage: (ovaAgentVmIpAddress) => {\n cy.visit(`http://${ovaAgentVmIpAddress}:3333`, { timeout: 580000 });\n },\n inputVcenterUser: (vcenterUser = Cypress.env('vcenterUser')) => {\n cy.get('#username-form-control').should('be.visible');\n cy.get('#username-form-control').clear();\n cy.get('#username-form-control').type(`${vcenterUser}`);\n },\n inputVcenterUrl: (vcenterUrl = Cypress.env('vcenterUrl')) => {\n cy.get('#url-form-control').should('be.visible');\n cy.get('#url-form-control').clear();\n cy.get('#url-form-control').type(`${vcenterUrl}`);\n },\n inputVcenterPass: (vcenterPass = Cypress.env('vcenterPass')) => {\n cy.get('#password-form-control').should('be.visible');\n cy.get('#password-form-control').clear();\n cy.get('#password-form-control').type(`${vcenterPass}`);\n },\n checkDataSharingAgreement: () => {\n cy.get('input#checkbox-form-control[name=\"isDataSharingAllowed\"]').should('be.visible');\n cy.get('input#checkbox-form-control[name=\"isDataSharingAllowed\"]').check().should('be.checked');\n },\n loginButton: () => {\n cy.contains('button', 'Log in').should('exist');\n cy.contains('button', 'Log in').click();\n },\n confirmDiscoveryCompleted: () => {\n cy.contains('p', 'Discovery completed').should('be.visible');\n },\n clickBackToAssessmentWizardButton: () => {\n cy.contains('button', 'Go back to assessment wizard').should('exist');\n cy.contains('button', 'Go back to assessment wizard').click();\n },\n};\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "a35e6db5-2d7a-4d52-a23c-3ed84efc3a31", | |
| "name": "assessmentConnectPage.js", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/views/assessmentConnectPage.js", | |
| "code": "/* eslint-disable cypress/unsafe-to-chain-command */\n\nexport const assessmentConnectPage = {\n createSourceButton: () => {\n cy.contains('button', 'Add source').should('exist');\n cy.contains('button', 'Add source').click();\n },\n downloadOvaImage: () => {\n cy.intercept('HEAD', '/planner/api/v1/image').as('headRequest');\n cy.contains('button', 'Download OVA Image').click();\n cy.wait('@headRequest').its('response.statusCode').should('eq', 200);\n },\n waitForOvaImageDownload: () => {\n const ovaImageFileLocalPath = Cypress.env('ovaImageFileLocalPath');\n cy.fileExists(ovaImageFileLocalPath, 20, 15000);\n },\n checkSourceWaitingForCreds: (ovaAgentVmIpAddress) => {\n cy.get('table[aria-label=\"Sources table\"]')\n .contains('td', ovaAgentVmIpAddress)\n .parent()\n .find('td')\n .eq(1)\n .should('contain', 'Waiting for credentials');\n },\n ensureAgentVmUrlMatchesVmIpAdd: (ovaAgentVmIpAddress) => {\n cy.get('table[aria-label=\"Sources table\"]')\n .contains('td', ovaAgentVmIpAddress)\n .parent()\n .find('td')\n .eq(0)\n .should('contain.text', ovaAgentVmIpAddress);\n },\n browseToAssesmentConnectPage: () => {\n cy.visit(Cypress.env('ASSESSMENT_URL') + `/migrate/wizard`);\n },\n checkSourceUpToDate: (ovaAgentVmIpAddress) => {\n cy.get('table[aria-label=\"Sources table\"]')\n .contains('td', ovaAgentVmIpAddress)\n .parent()\n .find('td')\n .eq(1)\n .should('contain', 'Up to date');\n },\n selectSourceInVmwareEnvTable: (ovaAgentVmIpAddress) => {\n cy.get('table[aria-label=\"Sources table\"]')\n .contains('td', ovaAgentVmIpAddress)\n .parent()\n .find('input[type=\"radio\"]')\n .click()\n .should('be.checked');\n },\n nextButtonIsAvailable: () => {\n cy.contains('button', 'Next').should('exist');\n cy.contains('button', 'Next').should('be.enabled');\n },\n clickNextButton: () => {\n cy.contains('button', 'Next').should('exist');\n cy.contains('button', 'Next').click();\n },\n clickBackButton: () => {\n cy.contains('button', 'Back').should('exist');\n cy.contains('button', 'Back').click();\n },\n clickConfirmButton: () => {\n cy.contains('button', 'Confirm').should('exist');\n cy.contains('button', 'Confirm').click();\n },\n onDiscoveryReportPage: () => {\n cy.contains('h2', 'Discovery report').should('exist');\n },\n onPrepareForMigrationPage: () => {\n cy.contains('h2', 'Prepare for Migration').should('exist');\n },\n onConnectVmwareEnvPage: () => {\n cy.contains('h2', 'Connect your VMware environment').should('exist');\n },\n clickLetsCreateNewClusterButton: () => {\n cy.contains('button', \"Let's create a new cluster\").should('exist');\n cy.contains('button', \"Let's create a new cluster\").click();\n },\n clickDeleteSourceInVmwareEnvTable: (ovaAgentVmIpAddress) => {\n cy.get('table[aria-label=\"Sources table\"]')\n .contains('td', ovaAgentVmIpAddress)\n .parent()\n .find('button[data-ouia-component-id*=\"OUIA-Generated-Button-plain\"]')\n .first()\n .click();\n },\n agentVmSourceIsNotInVmwareEnvTable: (ovaAgentIpAddress) => {\n cy.get('table[aria-label=\"Sources table\"]')\n .contains('td', ovaAgentIpAddress)\n .should('not.exist');\n },\n workAroundForECOPROJECT_2491: () => {\n cy.get('table[aria-label=\"Sources table\"]')\n .contains('td', 'Example report')\n .parent()\n .find('input[type=\"radio\"]')\n .click()\n .should('be.checked');\n },\n};\n" | |
| }, | |
| { | |
| "element_type": "file", | |
| "project_name": "assisted-migration-auto-tests", | |
| "uuid": "f7247d29-b949-496e-992e-7aee03611197", | |
| "name": "assessmentStartPage.js", | |
| "imports": "", | |
| "file_location": "https://github.com/konveyor/assisted-migration-auto-tests/ui_tests/cypress/views/assessmentStartPage.js", | |
| "code": "/* eslint-disable cypress/unsafe-to-chain-command */\n\nexport const assessmentStartPage = {\n browseToAssesmentStartPage: () => {\n cy.visit(Cypress.env('ASSESSMENT_URL') + `/migrate`);\n },\n startMigrationJourneyButton: () => {\n cy.contains('Start your migration journey').click();\n },\n};\n" | |
| } | |
| ] |