diff --git a/backend/src/routes/api/health/healthUtils.ts b/backend/src/routes/api/health/healthUtils.ts index c0dc933324..d968b48cac 100644 --- a/backend/src/routes/api/health/healthUtils.ts +++ b/backend/src/routes/api/health/healthUtils.ts @@ -2,6 +2,7 @@ import { getDashboardConfig } from '../../../utils/resourceUtils'; import { KubeFastifyInstance } from '../../../types'; import { createCustomError } from '../../../utils/requestUtils'; +let count = 0; export const health = async (fastify: KubeFastifyInstance): Promise<{ health: string }> => { const kubeContext = fastify.kube?.currentContext || ''; if (!kubeContext && !kubeContext.trim()) { @@ -17,7 +18,9 @@ export const health = async (fastify: KubeFastifyInstance): Promise<{ health: st fastify.log.error(error, 'failed to get dashboard config'); throw error; } else { - throw new Error('this is a made up error for testing'); - // return { health: 'ok' }; + if (count++ < 3) { + throw new Error('this is a made up error for testing'); + } + return { health: 'ok' }; } }; diff --git a/frontend/@mf-types/@mf/model-registry/Test.d.ts b/frontend/@mf-types/@mf/model-registry/Test.d.ts new file mode 100644 index 0000000000..45672b39ed --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/Test.d.ts @@ -0,0 +1,2 @@ +export * from './compiled-types/src/Test'; +export { default } from './compiled-types/src/Test'; \ No newline at end of file diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/Test.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/Test.d.ts new file mode 100644 index 0000000000..1cd8ed5733 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/Test.d.ts @@ -0,0 +1,3 @@ +import React from 'react'; +declare const Test: React.FC; +export default Test; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/const.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/const.d.ts new file mode 100644 index 0000000000..2fcb281cb5 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/const.d.ts @@ -0,0 +1 @@ +export declare const BFF_API_VERSION = "v1"; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/ModelRegistryContext.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/ModelRegistryContext.d.ts new file mode 100644 index 0000000000..ed55c48dd3 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/ModelRegistryContext.d.ts @@ -0,0 +1,13 @@ +import * as React from 'react'; +import { ModelRegistryAPIState } from './useModelRegistryAPIState'; +export type ModelRegistryContextType = { + apiState: ModelRegistryAPIState; + refreshAPIState: () => void; +}; +type ModelRegistryContextProviderProps = { + children: React.ReactNode; + modelRegistryName: string; +}; +export declare const ModelRegistryContext: React.Context; +export declare const ModelRegistryContextProvider: React.FC; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/ModelRegistrySelectorContext.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/ModelRegistrySelectorContext.d.ts new file mode 100644 index 0000000000..36e358ed97 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/ModelRegistrySelectorContext.d.ts @@ -0,0 +1,17 @@ +import * as React from 'react'; +import { ModelRegistry } from '~/app/types'; +export type ModelRegistrySelectorContextType = { + modelRegistriesLoaded: boolean; + modelRegistriesLoadError?: Error; + modelRegistries: ModelRegistry[]; + preferredModelRegistry: ModelRegistry | undefined; + updatePreferredModelRegistry: (modelRegistry: ModelRegistry | undefined) => void; + apiPrefix: string; +}; +type ModelRegistrySelectorContextProviderProps = { + apiPrefix?: string; + children: React.ReactNode; +}; +export declare const ModelRegistrySelectorContext: React.Context; +export declare const ModelRegistrySelectorContextProvider: React.FC; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/NotificationContext.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/NotificationContext.d.ts new file mode 100644 index 0000000000..b5b9b2485d --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/NotificationContext.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; +import { Notification, NotificationAction } from '~/app/types'; +type NotificationContextProps = { + notifications: Notification[]; + notificationCount: number; + updateNotificationCount: React.Dispatch>; + dispatch: React.Dispatch; +}; +export declare const NotificationContext: React.Context; +type NotificationContextProviderProps = { + children: React.ReactNode; +}; +export declare const NotificationContextProvider: React.FC; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/useModelRegistryAPIState.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/useModelRegistryAPIState.d.ts new file mode 100644 index 0000000000..5ad4acf9b9 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/context/useModelRegistryAPIState.d.ts @@ -0,0 +1,5 @@ +import { APIState } from '~/shared/api/types'; +import { ModelRegistryAPIs } from '~/app/types'; +export type ModelRegistryAPIState = APIState; +declare const useModelRegistryAPIState: (hostPath: string | null) => [apiState: ModelRegistryAPIState, refreshAPIState: () => void]; +export default useModelRegistryAPIState; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelArtifactsByVersionId.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelArtifactsByVersionId.d.ts new file mode 100644 index 0000000000..cb135e5119 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelArtifactsByVersionId.d.ts @@ -0,0 +1,4 @@ +import { FetchState } from '~/shared/utilities/useFetchState'; +import { ModelArtifactList } from '~/app/types'; +declare const useModelArtifactsByVersionId: (modelVersionId?: string) => FetchState; +export default useModelArtifactsByVersionId; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelRegistries.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelRegistries.d.ts new file mode 100644 index 0000000000..94925e0e99 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelRegistries.d.ts @@ -0,0 +1,4 @@ +import { FetchState } from '~/shared/utilities/useFetchState'; +import { ModelRegistry } from '~/app/types'; +declare const useModelRegistries: (apiPrefix?: string) => FetchState; +export default useModelRegistries; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelRegistryAPI.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelRegistryAPI.d.ts new file mode 100644 index 0000000000..ce05aef017 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelRegistryAPI.d.ts @@ -0,0 +1,6 @@ +import { ModelRegistryAPIState } from '~/app/context/useModelRegistryAPIState'; +type UseModelRegistryAPI = ModelRegistryAPIState & { + refreshAllAPI: () => void; +}; +export declare const useModelRegistryAPI: () => UseModelRegistryAPI; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelVersionById.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelVersionById.d.ts new file mode 100644 index 0000000000..2775f3b2fb --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelVersionById.d.ts @@ -0,0 +1,4 @@ +import { FetchState } from '~/shared/utilities/useFetchState'; +import { ModelVersion } from '~/app/types'; +declare const useModelVersionById: (modelVersionId?: string) => FetchState; +export default useModelVersionById; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelVersionsByRegisteredModel.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelVersionsByRegisteredModel.d.ts new file mode 100644 index 0000000000..93b4137751 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useModelVersionsByRegisteredModel.d.ts @@ -0,0 +1,4 @@ +import { FetchState } from '~/shared/utilities/useFetchState'; +import { ModelVersionList } from '~/app/types'; +declare const useModelVersionsByRegisteredModel: (registeredModelId?: string) => FetchState; +export default useModelVersionsByRegisteredModel; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useNotification.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useNotification.d.ts new file mode 100644 index 0000000000..82c8b0e23b --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useNotification.d.ts @@ -0,0 +1,17 @@ +import React from 'react'; +declare enum NotificationTypes { + SUCCESS = "success", + ERROR = "error", + INFO = "info", + WARNING = "warning" +} +type NotificationProps = (title: string, message?: React.ReactNode) => void; +type NotificationRemoveProps = (id: number | undefined) => void; +type NotificationTypeFunc = { + [key in NotificationTypes]: NotificationProps; +}; +interface NotificationFunc extends NotificationTypeFunc { + remove: NotificationRemoveProps; +} +export declare const useNotification: () => NotificationFunc; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useRegisteredModelById.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useRegisteredModelById.d.ts new file mode 100644 index 0000000000..510797f5c3 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useRegisteredModelById.d.ts @@ -0,0 +1,4 @@ +import { FetchState } from '~/shared/utilities/useFetchState'; +import { RegisteredModel } from '~/app/types'; +declare const useRegisteredModelById: (registeredModel?: string) => FetchState; +export default useRegisteredModelById; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useRegisteredModels.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useRegisteredModels.d.ts new file mode 100644 index 0000000000..9e68f90fc9 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/hooks/useRegisteredModels.d.ts @@ -0,0 +1,4 @@ +import { FetchState } from '~/shared/utilities/useFetchState'; +import { RegisteredModelList } from '~/app/types'; +declare const useRegisteredModels: () => FetchState; +export default useRegisteredModels; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/ModelRegistryCoreLoader.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/ModelRegistryCoreLoader.d.ts new file mode 100644 index 0000000000..6a85ab8425 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/ModelRegistryCoreLoader.d.ts @@ -0,0 +1,6 @@ +import * as React from 'react'; +type ModelRegistryCoreLoaderProps = { + getInvalidRedirectPath: (modelRegistry: string) => string; +}; +declare const ModelRegistryCoreLoader: React.FC; +export default ModelRegistryCoreLoader; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/ModelRegistryRoutes.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/ModelRegistryRoutes.d.ts new file mode 100644 index 0000000000..400d985413 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/ModelRegistryRoutes.d.ts @@ -0,0 +1,4 @@ +import * as React from 'react'; +import '~/shared/style/MUI-theme.scss'; +declare const ModelRegistryRoutes: React.FC; +export default ModelRegistryRoutes; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/InvalidModelRegistry.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/InvalidModelRegistry.d.ts new file mode 100644 index 0000000000..11c7ca9197 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/InvalidModelRegistry.d.ts @@ -0,0 +1,7 @@ +import * as React from 'react'; +type InvalidModelRegistryProps = { + title?: string; + modelRegistry?: string; +}; +declare const InvalidModelRegistry: React.FC; +export default InvalidModelRegistry; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelPropertiesDescriptionListGroup.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelPropertiesDescriptionListGroup.d.ts new file mode 100644 index 0000000000..4f15468e9e --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelPropertiesDescriptionListGroup.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +import { ModelRegistryCustomProperties } from '~/app/types'; +type ModelPropertiesDescriptionListGroupProps = { + customProperties: ModelRegistryCustomProperties; + isArchive?: boolean; + saveEditedCustomProperties: (properties: ModelRegistryCustomProperties) => Promise; +}; +declare const ModelPropertiesDescriptionListGroup: React.FC; +export default ModelPropertiesDescriptionListGroup; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelPropertiesTableRow.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelPropertiesTableRow.d.ts new file mode 100644 index 0000000000..9419553f0a --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelPropertiesTableRow.d.ts @@ -0,0 +1,19 @@ +import * as React from 'react'; +import { KeyValuePair } from '~/shared/types'; +import { EitherNotBoth } from '~/shared/typeHelpers'; +type ModelPropertiesTableRowProps = { + allExistingKeys: string[]; + setIsEditing: (isEditing: boolean) => void; + isSavingEdits: boolean; + isArchive?: boolean; + setIsSavingEdits: (isSaving: boolean) => void; + saveEditedProperty: (oldKey: string, newPair: KeyValuePair) => Promise; +} & EitherNotBoth<{ + isAddRow: true; +}, { + isEditing: boolean; + keyValuePair: KeyValuePair; + deleteProperty: (key: string) => Promise; +}>; +declare const ModelPropertiesTableRow: React.FC; +export default ModelPropertiesTableRow; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelRegistry.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelRegistry.d.ts new file mode 100644 index 0000000000..0b43befa0b --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelRegistry.d.ts @@ -0,0 +1,5 @@ +import React from 'react'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; +type ModelRegistryProps = Omit, 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding' | 'removeChildrenTopPadding' | 'headerContent'>; +declare const ModelRegistry: React.FC; +export default ModelRegistry; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelRegistrySelector.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelRegistrySelector.d.ts new file mode 100644 index 0000000000..5f9bcabc8d --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelRegistrySelector.d.ts @@ -0,0 +1,8 @@ +import * as React from 'react'; +type ModelRegistrySelectorProps = { + modelRegistry: string; + onSelection: (modelRegistry: string) => void; + primary?: boolean; +}; +declare const ModelRegistrySelector: React.FC; +export default ModelRegistrySelector; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelRegistrySelectorNavigator.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelRegistrySelectorNavigator.d.ts new file mode 100644 index 0000000000..f9cbbf5ce4 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelRegistrySelectorNavigator.d.ts @@ -0,0 +1,7 @@ +import * as React from 'react'; +import ModelRegistrySelector from './ModelRegistrySelector'; +type ModelRegistrySelectorNavigatorProps = { + getRedirectPath: (namespace: string) => string; +} & Omit, 'onSelection' | 'modelRegistry'>; +declare const ModelRegistrySelectorNavigator: React.FC; +export default ModelRegistrySelectorNavigator; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetails.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetails.d.ts new file mode 100644 index 0000000000..aad13c4775 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetails.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; +import { ModelVersionDetailsTab } from './const'; +type ModelVersionsDetailProps = { + tab: ModelVersionDetailsTab; +} & Omit, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>; +declare const ModelVersionsDetails: React.FC; +export default ModelVersionsDetails; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsHeaderActions.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsHeaderActions.d.ts new file mode 100644 index 0000000000..89babd4ffd --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsHeaderActions.d.ts @@ -0,0 +1,7 @@ +import * as React from 'react'; +import { ModelVersion } from '~/app/types'; +interface ModelVersionsDetailsHeaderActionsProps { + mv: ModelVersion; +} +declare const ModelVersionsDetailsHeaderActions: React.FC; +export default ModelVersionsDetailsHeaderActions; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsTabs.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsTabs.d.ts new file mode 100644 index 0000000000..b2d7c64377 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsTabs.d.ts @@ -0,0 +1,11 @@ +import * as React from 'react'; +import { ModelVersion } from '~/app/types'; +import { ModelVersionDetailsTab } from './const'; +type ModelVersionDetailTabsProps = { + tab: ModelVersionDetailsTab; + modelVersion: ModelVersion; + isArchiveVersion?: boolean; + refresh: () => void; +}; +declare const ModelVersionDetailsTabs: React.FC; +export default ModelVersionDetailsTabs; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsView.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsView.d.ts new file mode 100644 index 0000000000..298261283e --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionDetailsView.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +import { ModelVersion } from '~/app/types'; +type ModelVersionDetailsViewProps = { + modelVersion: ModelVersion; + isArchiveVersion?: boolean; + refresh: () => void; +}; +declare const ModelVersionDetailsView: React.FC; +export default ModelVersionDetailsView; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionSelector.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionSelector.d.ts new file mode 100644 index 0000000000..d2f1b4ab7a --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/ModelVersionSelector.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +import { ModelVersion } from '~/app/types'; +type ModelVersionSelectorProps = { + rmId?: string; + selection: ModelVersion; + onSelect: (versionId: string) => void; +}; +declare const ModelVersionSelector: React.FC; +export default ModelVersionSelector; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/const.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/const.d.ts new file mode 100644 index 0000000000..380029097e --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionDetails/const.d.ts @@ -0,0 +1,6 @@ +export declare enum ModelVersionDetailsTab { + DETAILS = "details" +} +export declare enum ModelVersionDetailsTabTitle { + DETAILS = "Details" +} diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.d.ts new file mode 100644 index 0000000000..cd82e56e19 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelDetailsView.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +import { RegisteredModel } from '~/app/types'; +type ModelDetailsViewProps = { + registeredModel: RegisteredModel; + refresh: () => void; + isArchiveModel?: boolean; +}; +declare const ModelDetailsView: React.FC; +export default ModelDetailsView; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionListView.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionListView.d.ts new file mode 100644 index 0000000000..2a1040fe0f --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionListView.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { ModelVersion, RegisteredModel } from '~/app/types'; +type ModelVersionListViewProps = { + modelVersions: ModelVersion[]; + registeredModel?: RegisteredModel; + isArchiveModel?: boolean; + refresh: () => void; +}; +declare const ModelVersionListView: React.FC; +export default ModelVersionListView; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersions.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersions.d.ts new file mode 100644 index 0000000000..cf16ce3070 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersions.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { ModelVersionsTab } from '~/app/pages/modelRegistry/screens/ModelVersions/const'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; +type ModelVersionsProps = { + tab: ModelVersionsTab; +} & Omit, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>; +declare const ModelVersions: React.FC; +export default ModelVersions; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsHeaderActions.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsHeaderActions.d.ts new file mode 100644 index 0000000000..dbb68b8c39 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsHeaderActions.d.ts @@ -0,0 +1,7 @@ +import * as React from 'react'; +import { RegisteredModel } from '~/app/types'; +interface ModelVersionsHeaderActionsProps { + rm: RegisteredModel; +} +declare const ModelVersionsHeaderActions: React.FC; +export default ModelVersionsHeaderActions; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTable.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTable.d.ts new file mode 100644 index 0000000000..8016be2f87 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTable.d.ts @@ -0,0 +1,11 @@ +import * as React from 'react'; +import { Table } from '~/shared/components/table'; +import { ModelVersion } from '~/app/types'; +type ModelVersionsTableProps = { + clearFilters: () => void; + modelVersions: ModelVersion[]; + isArchiveModel?: boolean; + refresh: () => void; +} & Partial, 'toolbarContent'>>; +declare const ModelVersionsTable: React.FC; +export default ModelVersionsTable; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableColumns.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableColumns.d.ts new file mode 100644 index 0000000000..9296bea5f6 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableColumns.d.ts @@ -0,0 +1,3 @@ +import { SortableData } from '~/shared/components/table'; +import { ModelVersion } from '~/app/types'; +export declare const mvColumns: SortableData[]; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableRow.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableRow.d.ts new file mode 100644 index 0000000000..30c616e755 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTableRow.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { ModelVersion } from '~/app/types'; +type ModelVersionsTableRowProps = { + modelVersion: ModelVersion; + isArchiveRow?: boolean; + isArchiveModel?: boolean; + refresh: () => void; +}; +declare const ModelVersionsTableRow: React.FC; +export default ModelVersionsTableRow; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTabs.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTabs.d.ts new file mode 100644 index 0000000000..548e6380ad --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/ModelVersionsTabs.d.ts @@ -0,0 +1,13 @@ +import * as React from 'react'; +import { ModelVersion, RegisteredModel } from '~/app/types'; +import { ModelVersionsTab } from '~/app/pages/modelRegistry/screens/ModelVersions/const'; +type ModelVersionsTabProps = { + tab: ModelVersionsTab; + registeredModel: RegisteredModel; + modelVersions: ModelVersion[]; + isArchiveModel?: boolean; + refresh: () => void; + mvRefresh: () => void; +}; +declare const ModelVersionsTabs: React.FC; +export default ModelVersionsTabs; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/const.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/const.d.ts new file mode 100644 index 0000000000..92c0718045 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersions/const.d.ts @@ -0,0 +1,8 @@ +export declare enum ModelVersionsTab { + VERSIONS = "versions", + DETAILS = "details" +} +export declare enum ModelVersionsTabTitle { + VERSIONS = "Versions", + DETAILS = "Details" +} diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetails.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetails.d.ts new file mode 100644 index 0000000000..5e4627cd0e --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetails.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; +import { ModelVersionDetailsTab } from '~/app/pages/modelRegistry/screens/ModelVersionDetails/const'; +type ArchiveModelVersionDetailsProps = { + tab: ModelVersionDetailsTab; +} & Omit, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>; +declare const ArchiveModelVersionDetails: React.FC; +export default ArchiveModelVersionDetails; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetailsBreadcrumb.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetailsBreadcrumb.d.ts new file mode 100644 index 0000000000..d5cf258296 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ArchiveModelVersionDetailsBreadcrumb.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; +import { RegisteredModel } from '~/app/types'; +type ArchiveModelVersionDetailsBreadcrumbProps = { + preferredModelRegistry?: string; + registeredModel: RegisteredModel | null; + modelVersionName?: string; +}; +declare const ArchiveModelVersionDetailsBreadcrumb: React.FC; +export default ArchiveModelVersionDetailsBreadcrumb; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetails.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetails.d.ts new file mode 100644 index 0000000000..f73db28133 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetails.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; +import { ModelVersionDetailsTab } from '~/app/pages/modelRegistry/screens/ModelVersionDetails/const'; +type ModelVersionsArchiveDetailsProps = { + tab: ModelVersionDetailsTab; +} & Omit, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>; +declare const ModelVersionsArchiveDetails: React.FC; +export default ModelVersionsArchiveDetails; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetailsBreadcrumb.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetailsBreadcrumb.d.ts new file mode 100644 index 0000000000..ef5d6267b5 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionArchiveDetailsBreadcrumb.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; +import { RegisteredModel } from '~/app/types'; +type ModelVersionArchiveDetailsBreadcrumbProps = { + preferredModelRegistry?: string; + registeredModel: RegisteredModel | null; + modelVersionName?: string; +}; +declare const ModelVersionArchiveDetailsBreadcrumb: React.FC; +export default ModelVersionArchiveDetailsBreadcrumb; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchive.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchive.d.ts new file mode 100644 index 0000000000..936b19ebd5 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchive.d.ts @@ -0,0 +1,5 @@ +import React from 'react'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; +type ModelVersionsArchiveProps = Omit, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>; +declare const ModelVersionsArchive: React.FC; +export default ModelVersionsArchive; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveListView.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveListView.d.ts new file mode 100644 index 0000000000..b6b2fb4ef1 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveListView.d.ts @@ -0,0 +1,8 @@ +import * as React from 'react'; +import { ModelVersion } from '~/app/types'; +type ModelVersionsArchiveListViewProps = { + modelVersions: ModelVersion[]; + refresh: () => void; +}; +declare const ModelVersionsArchiveListView: React.FC; +export default ModelVersionsArchiveListView; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveTable.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveTable.d.ts new file mode 100644 index 0000000000..d2fda8b377 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/ModelVersionsArchive/ModelVersionsArchiveTable.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { Table } from '~/shared/components/table'; +import { ModelVersion } from '~/app/types'; +type ModelVersionsArchiveTableProps = { + clearFilters: () => void; + modelVersions: ModelVersion[]; + refresh: () => void; +} & Partial, 'toolbarContent'>>; +declare const ModelVersionsArchiveTable: React.FC; +export default ModelVersionsArchiveTable; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/PrefilledModelRegistryField.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/PrefilledModelRegistryField.d.ts new file mode 100644 index 0000000000..77564dbd72 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/PrefilledModelRegistryField.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +type PrefilledModelRegistryFieldProps = { + mrName?: string; +}; +declare const PrefilledModelRegistryField: React.FC; +export default PrefilledModelRegistryField; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.d.ts new file mode 100644 index 0000000000..dc8f0314de --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegisterModel.d.ts @@ -0,0 +1,3 @@ +import React from 'react'; +declare const RegisterModel: React.FC; +export default RegisterModel; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegisterVersion.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegisterVersion.d.ts new file mode 100644 index 0000000000..a6bf51fb35 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegisterVersion.d.ts @@ -0,0 +1,3 @@ +import React from 'react'; +declare const RegisterVersion: React.FC; +export default RegisterVersion; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegisteredModelSelector.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegisteredModelSelector.d.ts new file mode 100644 index 0000000000..4c4a5785ed --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegisteredModelSelector.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; +import { RegisteredModel } from '~/app/types'; +type RegisteredModelSelectorProps = { + registeredModels: RegisteredModel[]; + registeredModelId: string; + setRegisteredModelId: (id: string) => void; + isDisabled: boolean; +}; +declare const RegisteredModelSelector: React.FC; +export default RegisteredModelSelector; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationCommonFormSections.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationCommonFormSections.d.ts new file mode 100644 index 0000000000..d0b4ca7c0c --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationCommonFormSections.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +import { UpdateObjectAtPropAndValue } from '~/shared/types'; +import { ModelVersion } from '~/app/types'; +import { RegistrationCommonFormData } from './useRegisterModelData'; +type RegistrationCommonFormSectionsProps = { + formData: RegistrationCommonFormData; + setData: UpdateObjectAtPropAndValue; + isFirstVersion: boolean; + latestVersion?: ModelVersion; +}; +declare const RegistrationCommonFormSections: React.FC; +export default RegistrationCommonFormSections; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationFormFooter.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationFormFooter.d.ts new file mode 100644 index 0000000000..0dd2bf9134 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/RegistrationFormFooter.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +type RegistrationFormFooterProps = { + submitLabel: string; + submitError?: Error; + setSubmitError: (e?: Error) => void; + isSubmitDisabled: boolean; + isSubmitting: boolean; + onSubmit: () => void; + onCancel: () => void; +}; +declare const RegistrationFormFooter: React.FC; +export default RegistrationFormFooter; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/usePrefillRegisterVersionFields.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/usePrefillRegisterVersionFields.d.ts new file mode 100644 index 0000000000..5245840883 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/usePrefillRegisterVersionFields.d.ts @@ -0,0 +1,15 @@ +import { RegisteredModel, ModelVersion, ModelArtifact } from '~/app/types'; +import { UpdateObjectAtPropAndValue } from '~/shared/types'; +import { RegisterVersionFormData } from './useRegisterModelData'; +type UsePrefillRegisterVersionFieldsArgs = { + registeredModel?: RegisteredModel; + setData: UpdateObjectAtPropAndValue; +}; +type UsePrefillRegisterVersionFieldsReturnVal = { + loadedPrefillData: boolean; + loadPrefillDataError?: Error; + latestVersion?: ModelVersion; + latestArtifact?: ModelArtifact; +}; +export declare const usePrefillRegisterVersionFields: ({ registeredModel, setData, }: UsePrefillRegisterVersionFieldsArgs) => UsePrefillRegisterVersionFieldsReturnVal; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/useRegisterModelData.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/useRegisterModelData.d.ts new file mode 100644 index 0000000000..99c47e257e --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/useRegisterModelData.d.ts @@ -0,0 +1,26 @@ +import { GenericObjectState } from '~/shared/utilities/useGenericObjectState'; +export declare enum ModelLocationType { + ObjectStorage = "Object storage", + URI = "URI" +} +export type RegistrationCommonFormData = { + versionName: string; + versionDescription: string; + sourceModelFormat: string; + sourceModelFormatVersion: string; + modelLocationType: ModelLocationType; + modelLocationEndpoint: string; + modelLocationBucket: string; + modelLocationRegion: string; + modelLocationPath: string; + modelLocationURI: string; +}; +export type RegisterModelFormData = RegistrationCommonFormData & { + modelName: string; + modelDescription: string; +}; +export type RegisterVersionFormData = RegistrationCommonFormData & { + registeredModelId: string; +}; +export declare const useRegisterModelData: () => GenericObjectState; +export declare const useRegisterVersionData: (registeredModelId?: string) => GenericObjectState; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/useRegistrationCommonState.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/useRegistrationCommonState.d.ts new file mode 100644 index 0000000000..f58441db1e --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/useRegistrationCommonState.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import { ModelRegistryAPIState } from '~/app/context/useModelRegistryAPIState'; +type RegistrationCommonState = { + isSubmitting: boolean; + setIsSubmitting: React.Dispatch>; + submitError: Error | undefined; + setSubmitError: React.Dispatch>; + handleSubmit: (doSubmit: () => Promise) => void; + apiState: ModelRegistryAPIState; + author: string; +}; +export declare const useRegistrationCommonState: () => RegistrationCommonState; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/utils.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/utils.d.ts new file mode 100644 index 0000000000..d62c61f1e7 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisterModel/utils.d.ts @@ -0,0 +1,14 @@ +import { ModelArtifact, ModelVersion, RegisteredModel } from '~/app/types'; +import { ModelRegistryAPIState } from '~/app/context/useModelRegistryAPIState'; +import { RegisterModelFormData, RegisterVersionFormData } from './useRegisterModelData'; +export type RegisterModelCreatedResources = RegisterVersionCreatedResources & { + registeredModel: RegisteredModel; +}; +export type RegisterVersionCreatedResources = { + modelVersion: ModelVersion; + modelArtifact: ModelArtifact; +}; +export declare const registerModel: (apiState: ModelRegistryAPIState, formData: RegisterModelFormData, author: string) => Promise; +export declare const registerVersion: (apiState: ModelRegistryAPIState, registeredModel: RegisteredModel, formData: Omit, author: string) => Promise; +export declare const isRegisterModelSubmitDisabled: (formData: RegisterModelFormData) => boolean; +export declare const isRegisterVersionSubmitDisabled: (formData: RegisterVersionFormData) => boolean; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelListView.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelListView.d.ts new file mode 100644 index 0000000000..e127e3d2c2 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelListView.d.ts @@ -0,0 +1,8 @@ +import * as React from 'react'; +import { RegisteredModel } from '~/app/types'; +type RegisteredModelListViewProps = { + registeredModels: RegisteredModel[]; + refresh: () => void; +}; +declare const RegisteredModelListView: React.FC; +export default RegisteredModelListView; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTable.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTable.d.ts new file mode 100644 index 0000000000..d47f8761fa --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTable.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { Table } from '~/shared/components/table'; +import { RegisteredModel } from '~/app/types'; +type RegisteredModelTableProps = { + clearFilters: () => void; + registeredModels: RegisteredModel[]; + refresh: () => void; +} & Partial, 'toolbarContent'>>; +declare const RegisteredModelTable: React.FC; +export default RegisteredModelTable; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTableRow.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTableRow.d.ts new file mode 100644 index 0000000000..7a3129c224 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelTableRow.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +import { RegisteredModel } from '~/app/types'; +type RegisteredModelTableRowProps = { + registeredModel: RegisteredModel; + isArchiveRow?: boolean; + refresh: () => void; +}; +declare const RegisteredModelTableRow: React.FC; +export default RegisteredModelTableRow; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableColumns.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableColumns.d.ts new file mode 100644 index 0000000000..24c4c58adc --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableColumns.d.ts @@ -0,0 +1,3 @@ +import { SortableData } from '~/shared/components/table'; +import { RegisteredModel } from '~/app/types'; +export declare const rmColumns: SortableData[]; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableToolbar.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableToolbar.d.ts new file mode 100644 index 0000000000..0240c6c006 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelsTableToolbar.d.ts @@ -0,0 +1,6 @@ +import * as React from 'react'; +type RegisteredModelsTableToolbarProps = { + toggleGroupItems?: React.ReactNode; +}; +declare const RegisteredModelsTableToolbar: React.FC; +export default RegisteredModelsTableToolbar; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetails.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetails.d.ts new file mode 100644 index 0000000000..30d0a014b8 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetails.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; +import { ModelVersionsTab } from '~/app/pages/modelRegistry/screens/ModelVersions/const'; +type RegisteredModelsArchiveDetailsProps = { + tab: ModelVersionsTab; +} & Omit, 'breadcrumb' | 'title' | 'description' | 'loadError' | 'loaded' | 'provideChildrenPadding'>; +declare const RegisteredModelsArchiveDetails: React.FC; +export default RegisteredModelsArchiveDetails; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetailsBreadcrumb.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetailsBreadcrumb.d.ts new file mode 100644 index 0000000000..1a85ce5299 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelArchiveDetailsBreadcrumb.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { RegisteredModel } from '~/app/types'; +type RegisteredModelArchiveDetailsBreadcrumbProps = { + preferredModelRegistry?: string; + registeredModel: RegisteredModel | null; +}; +declare const RegisteredModelArchiveDetailsBreadcrumb: React.FC; +export default RegisteredModelArchiveDetailsBreadcrumb; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchive.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchive.d.ts new file mode 100644 index 0000000000..6b951c6547 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchive.d.ts @@ -0,0 +1,5 @@ +import React from 'react'; +import ApplicationsPage from '~/shared/components/ApplicationsPage'; +type RegisteredModelsArchiveProps = Omit, 'breadcrumb' | 'title' | 'loadError' | 'loaded' | 'provideChildrenPadding'>; +declare const RegisteredModelsArchive: React.FC; +export default RegisteredModelsArchive; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveListView.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveListView.d.ts new file mode 100644 index 0000000000..481894844b --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveListView.d.ts @@ -0,0 +1,8 @@ +import * as React from 'react'; +import { RegisteredModel } from '~/app/types'; +type RegisteredModelsArchiveListViewProps = { + registeredModels: RegisteredModel[]; + refresh: () => void; +}; +declare const RegisteredModelsArchiveListView: React.FC; +export default RegisteredModelsArchiveListView; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveTable.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveTable.d.ts new file mode 100644 index 0000000000..059dd60470 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/RegisteredModelsArchive/RegisteredModelsArchiveTable.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { Table } from '~/shared/components/table'; +import { RegisteredModel } from '~/app/types'; +type RegisteredModelsArchiveTableProps = { + clearFilters: () => void; + registeredModels: RegisteredModel[]; + refresh: () => void; +} & Partial, 'toolbarContent'>>; +declare const RegisteredModelsArchiveTable: React.FC; +export default RegisteredModelsArchiveTable; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ArchiveModelVersionModal.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ArchiveModelVersionModal.d.ts new file mode 100644 index 0000000000..470e435d47 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ArchiveModelVersionModal.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +interface ArchiveModelVersionModalProps { + onCancel: () => void; + onSubmit: () => void; + isOpen: boolean; + modelVersionName: string; +} +export declare const ArchiveModelVersionModal: React.FC; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ArchiveRegisteredModelModal.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ArchiveRegisteredModelModal.d.ts new file mode 100644 index 0000000000..6b240def29 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ArchiveRegisteredModelModal.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +interface ArchiveRegisteredModelModalProps { + onCancel: () => void; + onSubmit: () => void; + isOpen: boolean; + registeredModelName: string; +} +export declare const ArchiveRegisteredModelModal: React.FC; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/EmptyModelRegistryState.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/EmptyModelRegistryState.d.ts new file mode 100644 index 0000000000..d93208e3c8 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/EmptyModelRegistryState.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; +type EmptyModelRegistryStateType = { + testid?: string; + title: string; + description: string; + primaryActionText?: string; + primaryActionOnClick?: () => void; + secondaryActionText?: string; + secondaryActionOnClick?: () => void; + headerIcon?: React.ComponentType; + customAction?: React.ReactNode; +}; +declare const EmptyModelRegistryState: React.FC; +export default EmptyModelRegistryState; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/FormFieldset.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/FormFieldset.d.ts new file mode 100644 index 0000000000..5be183929d --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/FormFieldset.d.ts @@ -0,0 +1,8 @@ +import React, { ReactNode } from 'react'; +interface FormFieldsetProps { + component: ReactNode; + field?: string; + className?: string; +} +declare const FormFieldset: React.FC; +export default FormFieldset; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ModelLabels.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ModelLabels.d.ts new file mode 100644 index 0000000000..27c6dfa683 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ModelLabels.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { ModelVersion, RegisteredModel } from '~/app/types'; +type ModelLabelsProps = { + name: string; + customProperties: RegisteredModel['customProperties'] | ModelVersion['customProperties']; +}; +declare const ModelLabels: React.FC; +export default ModelLabels; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ModelTimestamp.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ModelTimestamp.d.ts new file mode 100644 index 0000000000..2b78d09271 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/ModelTimestamp.d.ts @@ -0,0 +1,6 @@ +import React from 'react'; +type ModelTimestampProps = { + timeSinceEpoch?: string; +}; +declare const ModelTimestamp: React.FC; +export default ModelTimestamp; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/RestoreModelVersionModal.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/RestoreModelVersionModal.d.ts new file mode 100644 index 0000000000..2d6ed525a5 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/RestoreModelVersionModal.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +interface RestoreModelVersionModalProps { + onCancel: () => void; + onSubmit: () => void; + isOpen: boolean; + modelVersionName: string; +} +export declare const RestoreModelVersionModal: React.FC; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/RestoreRegisteredModel.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/RestoreRegisteredModel.d.ts new file mode 100644 index 0000000000..59a75d99e9 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/components/RestoreRegisteredModel.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +interface RestoreRegisteredModelModalProps { + onCancel: () => void; + onSubmit: () => void; + isOpen: boolean; + registeredModelName: string; +} +export declare const RestoreRegisteredModelModal: React.FC; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/routeUtils.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/routeUtils.d.ts new file mode 100644 index 0000000000..354ae3b78e --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/routeUtils.d.ts @@ -0,0 +1,14 @@ +export declare const modelRegistryUrl: (preferredModelRegistry?: string) => string; +export declare const registeredModelsUrl: (preferredModelRegistry?: string) => string; +export declare const registeredModelUrl: (rmId?: string, preferredModelRegistry?: string) => string; +export declare const registeredModelArchiveUrl: (preferredModelRegistry?: string) => string; +export declare const registeredModelArchiveDetailsUrl: (rmId?: string, preferredModelRegistry?: string) => string; +export declare const modelVersionListUrl: (rmId?: string, preferredModelRegistry?: string) => string; +export declare const modelVersionUrl: (mvId: string, rmId?: string, preferredModelRegistry?: string) => string; +export declare const modelVersionArchiveUrl: (rmId?: string, preferredModelRegistry?: string) => string; +export declare const modelVersionArchiveDetailsUrl: (mvId: string, rmId?: string, preferredModelRegistry?: string) => string; +export declare const registerModelUrl: (preferredModelRegistry?: string) => string; +export declare const registerVersionUrl: (preferredModelRegistry?: string) => string; +export declare const registerVersionForModelUrl: (rmId?: string, preferredModelRegistry?: string) => string; +export declare const archiveModelVersionListUrl: (rmId?: string, preferredModelRegistry?: string) => string; +export declare const archiveModelVersionDetailsUrl: (mvId: string, rmId?: string, preferredModelRegistry?: string) => string; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/utils.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/utils.d.ts new file mode 100644 index 0000000000..6f7f7086ef --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/modelRegistry/screens/utils.d.ts @@ -0,0 +1,37 @@ +import { SearchType } from '~/shared/components/DashboardSearchField'; +import { ModelRegistryCustomProperties, ModelRegistryStringCustomProperties, ModelVersion, RegisteredModel } from '~/app/types'; +import { KeyValuePair } from '~/shared/types'; +export type ObjectStorageFields = { + endpoint: string; + bucket: string; + region?: string; + path: string; +}; +export declare const getLabels: (customProperties: T) => string[]; +export declare const mergeUpdatedLabels: (customProperties: ModelRegistryCustomProperties, updatedLabels: string[]) => ModelRegistryCustomProperties; +export declare const getProperties: (customProperties: T) => ModelRegistryStringCustomProperties; +export declare const mergeUpdatedProperty: (args: { + customProperties: ModelRegistryCustomProperties; +} & ({ + op: "create"; + newPair: KeyValuePair; +} | { + op: "update"; + oldKey: string; + newPair: KeyValuePair; +} | { + op: "delete"; + oldKey: string; +})) => ModelRegistryCustomProperties; +export declare const filterModelVersions: (unfilteredModelVersions: ModelVersion[], search: string, searchType: SearchType) => ModelVersion[]; +export declare const sortModelVersionsByCreateTime: (registeredModels: ModelVersion[]) => ModelVersion[]; +export declare const filterRegisteredModels: (unfilteredRegisteredModels: RegisteredModel[], search: string, searchType: SearchType) => RegisteredModel[]; +export declare const objectStorageFieldsToUri: (fields: ObjectStorageFields) => string | null; +export declare const getLastCreatedItem: (items?: T[]) => T | undefined; +export declare const filterArchiveVersions: (modelVersions: ModelVersion[]) => ModelVersion[]; +export declare const filterLiveVersions: (modelVersions: ModelVersion[]) => ModelVersion[]; +export declare const filterArchiveModels: (registeredModels: RegisteredModel[]) => RegisteredModel[]; +export declare const filterLiveModels: (registeredModels: RegisteredModel[]) => RegisteredModel[]; +export declare const uriToObjectStorageFields: (uri: string) => ObjectStorageFields | null; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistriesTable.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistriesTable.d.ts new file mode 100644 index 0000000000..d894b8f72d --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistriesTable.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import { ModelRegistry } from '~/app/types'; +type ModelRegistriesTableProps = { + modelRegistries: ModelRegistry[]; +}; +declare const ModelRegistriesTable: React.FC; +export default ModelRegistriesTable; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistriesTableRow.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistriesTableRow.d.ts new file mode 100644 index 0000000000..71626de531 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistriesTableRow.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; +import { ModelRegistry } from '~/app/types'; +type ModelRegistriesTableRowProps = { + modelRegistry: ModelRegistry; +}; +declare const ModelRegistriesTableRow: React.FC; +export default ModelRegistriesTableRow; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistrySettings.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistrySettings.d.ts new file mode 100644 index 0000000000..8bbb30d89a --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistrySettings.d.ts @@ -0,0 +1,3 @@ +import React from 'react'; +declare const ModelRegistrySettings: React.FC; +export default ModelRegistrySettings; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistrySettingsRoutes.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistrySettingsRoutes.d.ts new file mode 100644 index 0000000000..313b799c80 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/ModelRegistrySettingsRoutes.d.ts @@ -0,0 +1,3 @@ +import * as React from 'react'; +declare const ModelRegistrySettingsRoutes: React.FC; +export default ModelRegistrySettingsRoutes; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/columns.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/columns.d.ts new file mode 100644 index 0000000000..739fd8ae15 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/pages/settings/columns.d.ts @@ -0,0 +1,3 @@ +import { SortableData } from '~/shared/components/table'; +import { ModelRegistry } from '~/app/types'; +export declare const modelRegistryColumns: SortableData[]; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/types.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/types.d.ts new file mode 100644 index 0000000000..3e0db323b8 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/types.d.ts @@ -0,0 +1,150 @@ +import { AlertVariant } from '@patternfly/react-core'; +import { APIOptions } from '~/shared/api/types'; +export declare enum ModelState { + LIVE = "LIVE", + ARCHIVED = "ARCHIVED" +} +export declare enum ModelArtifactState { + UNKNOWN = "UNKNOWN", + PENDING = "PENDING", + LIVE = "LIVE", + MARKED_FOR_DELETION = "MARKED_FOR_DELETION", + DELETED = "DELETED", + ABANDONED = "ABANDONED", + REFERENCE = "REFERENCE" +} +export type ModelRegistry = { + name: string; + displayName: string; + description: string; +}; +export type ModelRegistryBody = { + data: T; + metadata?: Record; +}; +export declare enum ModelRegistryMetadataType { + INT = "MetadataIntValue", + DOUBLE = "MetadataDoubleValue", + STRING = "MetadataStringValue", + STRUCT = "MetadataStructValue", + PROTO = "MetadataProtoValue", + BOOL = "MetadataBoolValue" +} +export type ModelRegistryCustomPropertyInt = { + metadataType: ModelRegistryMetadataType.INT; + int_value: string; +}; +export type ModelRegistryCustomPropertyDouble = { + metadataType: ModelRegistryMetadataType.DOUBLE; + double_value: number; +}; +export type ModelRegistryCustomPropertyString = { + metadataType: ModelRegistryMetadataType.STRING; + string_value: string; +}; +export type ModelRegistryCustomPropertyStruct = { + metadataType: ModelRegistryMetadataType.STRUCT; + struct_value: string; +}; +export type ModelRegistryCustomPropertyProto = { + metadataType: ModelRegistryMetadataType.PROTO; + type: string; + proto_value: string; +}; +export type ModelRegistryCustomPropertyBool = { + metadataType: ModelRegistryMetadataType.BOOL; + bool_value: boolean; +}; +export type ModelRegistryCustomProperty = ModelRegistryCustomPropertyInt | ModelRegistryCustomPropertyDouble | ModelRegistryCustomPropertyString | ModelRegistryCustomPropertyStruct | ModelRegistryCustomPropertyProto | ModelRegistryCustomPropertyBool; +export type ModelRegistryCustomProperties = Record; +export type ModelRegistryStringCustomProperties = Record; +export type ModelRegistryBase = { + id: string; + name: string; + externalID?: string; + description?: string; + createTimeSinceEpoch: string; + lastUpdateTimeSinceEpoch: string; + customProperties: ModelRegistryCustomProperties; +}; +export type ModelArtifact = ModelRegistryBase & { + uri?: string; + state?: ModelArtifactState; + author?: string; + modelFormatName?: string; + storageKey?: string; + storagePath?: string; + modelFormatVersion?: string; + serviceAccountName?: string; + artifactType: string; +}; +export type ModelVersion = ModelRegistryBase & { + state?: ModelState; + author?: string; + registeredModelId: string; +}; +export type RegisteredModel = ModelRegistryBase & { + state?: ModelState; + owner?: string; +}; +export type CreateRegisteredModelData = Omit; +export type CreateModelVersionData = Omit; +export type CreateModelArtifactData = Omit; +export type ModelRegistryListParams = { + size: number; + pageSize: number; + nextPageToken: string; +}; +export type RegisteredModelList = ModelRegistryListParams & { + items: RegisteredModel[]; +}; +export type ModelVersionList = ModelRegistryListParams & { + items: ModelVersion[]; +}; +export type ModelArtifactList = ModelRegistryListParams & { + items: ModelArtifact[]; +}; +export type CreateRegisteredModel = (opts: APIOptions, data: CreateRegisteredModelData) => Promise; +export type CreateModelVersionForRegisteredModel = (opts: APIOptions, registeredModelId: string, data: CreateModelVersionData) => Promise; +export type CreateModelArtifactForModelVersion = (opts: APIOptions, modelVersionId: string, data: CreateModelArtifactData) => Promise; +export type GetRegisteredModel = (opts: APIOptions, registeredModelId: string) => Promise; +export type GetModelVersion = (opts: APIOptions, modelversionId: string) => Promise; +export type GetListRegisteredModels = (opts: APIOptions) => Promise; +export type GetModelVersionsByRegisteredModel = (opts: APIOptions, registeredmodelId: string) => Promise; +export type GetModelArtifactsByModelVersion = (opts: APIOptions, modelVersionId: string) => Promise; +export type PatchRegisteredModel = (opts: APIOptions, data: Partial, registeredModelId: string) => Promise; +export type PatchModelVersion = (opts: APIOptions, data: Partial, modelversionId: string) => Promise; +export type ModelRegistryAPIs = { + createRegisteredModel: CreateRegisteredModel; + createModelVersionForRegisteredModel: CreateModelVersionForRegisteredModel; + createModelArtifactForModelVersion: CreateModelArtifactForModelVersion; + getRegisteredModel: GetRegisteredModel; + getModelVersion: GetModelVersion; + listRegisteredModels: GetListRegisteredModels; + getModelVersionsByRegisteredModel: GetModelVersionsByRegisteredModel; + getModelArtifactsByModelVersion: GetModelArtifactsByModelVersion; + patchRegisteredModel: PatchRegisteredModel; + patchModelVersion: PatchModelVersion; +}; +export type Notification = { + id?: number; + status: AlertVariant; + title: string; + message?: React.ReactNode; + hidden?: boolean; + read?: boolean; + timestamp: Date; +}; +export declare enum NotificationActionTypes { + ADD_NOTIFICATION = "add_notification", + DELETE_NOTIFICATION = "delete_notification" +} +export type NotificationAction = { + type: NotificationActionTypes.ADD_NOTIFICATION; + payload: Notification; +} | { + type: NotificationActionTypes.DELETE_NOTIFICATION; + payload: { + id: Notification['id']; + }; +}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/utils.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/utils.d.ts new file mode 100644 index 0000000000..5ea602f0dc --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/app/utils.d.ts @@ -0,0 +1,5 @@ +import { SearchType } from '~/shared/components/DashboardSearchField'; +import { RegisteredModel } from '~/app/types'; +export declare const asEnumMember: (member: T[keyof T] | string | number | undefined | null, e: T) => T[keyof T] | null; +export declare const isEnumMember: (member: T[keyof T] | string | number | undefined | unknown | null, e: T) => member is T[keyof T]; +export declare const filterRegisteredModels: (unfilteredRegisteredModels: RegisteredModel[], search: string, searchType: SearchType) => RegisteredModel[]; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/plugin/index.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/plugin/index.d.ts new file mode 100644 index 0000000000..6dc5c21845 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/plugin/index.d.ts @@ -0,0 +1,19 @@ +import * as React from 'react'; +import { ModelRegistrySelectorContextProvider } from '~/app/context/ModelRegistrySelectorContext'; +declare const navItems: { + label: string; + href: string; +}[]; +declare const adminNavItems: { + label: string; + href: string; +}[]; +declare const routes: { + path: string; + element: React.JSX.Element; +}[]; +declare const adminRoutes: { + path: string; + element: React.JSX.Element; +}[]; +export { navItems, adminNavItems, routes, adminRoutes, ModelRegistrySelectorContextProvider }; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/apiUtils.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/apiUtils.d.ts new file mode 100644 index 0000000000..57cc30987f --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/apiUtils.d.ts @@ -0,0 +1,15 @@ +import { APIOptions } from '~/shared/api/types'; +import { ModelRegistryBody } from '~/app/types'; +export declare const mergeRequestInit: (opts?: APIOptions, specificOpts?: RequestInit) => RequestInit; +export declare const restGET: (host: string, path: string, queryParams?: Record, options?: APIOptions) => Promise; +/** Standard POST */ +export declare const restCREATE: (host: string, path: string, data: Record, queryParams?: Record, options?: APIOptions) => Promise; +/** POST -- but with file content instead of body data */ +export declare const restFILE: (host: string, path: string, fileContents: string, queryParams?: Record, options?: APIOptions) => Promise; +/** POST -- but no body data -- targets simple endpoints */ +export declare const restENDPOINT: (host: string, path: string, queryParams?: Record, options?: APIOptions) => Promise; +export declare const restUPDATE: (host: string, path: string, data: Record, queryParams?: Record, options?: APIOptions) => Promise; +export declare const restPATCH: (host: string, path: string, data: Record, options?: APIOptions) => Promise; +export declare const restDELETE: (host: string, path: string, data: Record, queryParams?: Record, options?: APIOptions) => Promise; +export declare const isModelRegistryResponse: (response: unknown) => response is ModelRegistryBody; +export declare const assembleModelRegistryBody: (data: T) => ModelRegistryBody; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/errorUtils.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/errorUtils.d.ts new file mode 100644 index 0000000000..abed1a6add --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/errorUtils.d.ts @@ -0,0 +1 @@ +export declare const handleRestFailures: (promise: Promise) => Promise; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/k8s.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/k8s.d.ts new file mode 100644 index 0000000000..d74e4b4d00 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/k8s.d.ts @@ -0,0 +1,3 @@ +import { APIOptions } from '~/shared/api/types'; +import { ModelRegistry } from '~/app/types'; +export declare const getListModelRegistries: (hostPath: string) => (opts: APIOptions) => Promise; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/service.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/service.d.ts new file mode 100644 index 0000000000..f3358fe3db --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/service.d.ts @@ -0,0 +1,18 @@ +import { CreateModelArtifactData, CreateModelVersionData, CreateRegisteredModelData, ModelArtifact, ModelArtifactList, ModelVersionList, ModelVersion, RegisteredModelList, RegisteredModel } from '~/app/types'; +import { APIOptions } from '~/shared/api/types'; +export declare const createRegisteredModel: (hostPath: string) => (opts: APIOptions, data: CreateRegisteredModelData) => Promise; +export declare const createModelVersion: (hostPath: string) => (opts: APIOptions, data: CreateModelVersionData) => Promise; +export declare const createModelVersionForRegisteredModel: (hostPath: string) => (opts: APIOptions, registeredModelId: string, data: CreateModelVersionData) => Promise; +export declare const createModelArtifact: (hostPath: string) => (opts: APIOptions, data: CreateModelArtifactData) => Promise; +export declare const createModelArtifactForModelVersion: (hostPath: string) => (opts: APIOptions, modelVersionId: string, data: CreateModelArtifactData) => Promise; +export declare const getRegisteredModel: (hostPath: string) => (opts: APIOptions, registeredModelId: string) => Promise; +export declare const getModelVersion: (hostPath: string) => (opts: APIOptions, modelversionId: string) => Promise; +export declare const getModelArtifact: (hostPath: string) => (opts: APIOptions, modelArtifactId: string) => Promise; +export declare const getListModelArtifacts: (hostPath: string) => (opts: APIOptions) => Promise; +export declare const getListModelVersions: (hostPath: string) => (opts: APIOptions) => Promise; +export declare const getListRegisteredModels: (hostPath: string) => (opts: APIOptions) => Promise; +export declare const getModelVersionsByRegisteredModel: (hostPath: string) => (opts: APIOptions, registeredmodelId: string) => Promise; +export declare const getModelArtifactsByModelVersion: (hostPath: string) => (opts: APIOptions, modelVersionId: string) => Promise; +export declare const patchRegisteredModel: (hostPath: string) => (opts: APIOptions, data: Partial, registeredModelId: string) => Promise; +export declare const patchModelVersion: (hostPath: string) => (opts: APIOptions, data: Partial, modelversionId: string) => Promise; +export declare const patchModelArtifact: (hostPath: string) => (opts: APIOptions, data: Partial, modelartifactId: string) => Promise; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/types.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/types.d.ts new file mode 100644 index 0000000000..0d27ad01fb --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/types.d.ts @@ -0,0 +1,17 @@ +export type APIOptions = { + dryRun?: boolean; + signal?: AbortSignal; + parseJSON?: boolean; +}; +export type APIError = { + error: { + code: string; + message: string; + }; +}; +export type APIState = { + /** If API will successfully call */ + apiAvailable: boolean; + /** The available API functions */ + api: T; +}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/useAPIState.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/useAPIState.d.ts new file mode 100644 index 0000000000..46ea31910b --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/api/useAPIState.d.ts @@ -0,0 +1,3 @@ +import { APIState } from '~/shared/api/types'; +declare const useAPIState: (hostPath: string | null, createAPI: (path: string) => T) => [apiState: APIState, refreshAPIState: () => void]; +export default useAPIState; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/ApplicationsPage.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/ApplicationsPage.d.ts new file mode 100644 index 0000000000..ba08c011a0 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/ApplicationsPage.d.ts @@ -0,0 +1,22 @@ +import React from 'react'; +type ApplicationsPageProps = { + title?: React.ReactNode; + breadcrumb?: React.ReactNode; + description?: React.ReactNode; + loaded: boolean; + empty: boolean; + loadError?: Error; + children?: React.ReactNode; + errorMessage?: string; + emptyMessage?: string; + emptyStatePage?: React.ReactNode; + headerAction?: React.ReactNode; + headerContent?: React.ReactNode; + provideChildrenPadding?: boolean; + removeChildrenTopPadding?: boolean; + subtext?: React.ReactNode; + loadingContent?: React.ReactNode; + noHeader?: boolean; +}; +declare const ApplicationsPage: React.FC; +export default ApplicationsPage; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardDescriptionListGroup.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardDescriptionListGroup.d.ts new file mode 100644 index 0000000000..7698c29224 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardDescriptionListGroup.d.ts @@ -0,0 +1,24 @@ +import * as React from 'react'; +import '~/shared/components/DashboardDescriptionListGroup.scss'; +type EditableProps = { + isEditing: boolean; + contentWhenEditing: React.ReactNode; + isSavingEdits?: boolean; + onEditClick: () => void; + onSaveEditsClick: () => void; + onDiscardEditsClick: () => void; +}; +export type DashboardDescriptionListGroupProps = { + title: string; + tooltip?: React.ReactNode; + action?: React.ReactNode; + isEmpty?: boolean; + contentWhenEmpty?: React.ReactNode; + children: React.ReactNode; +} & (({ + isEditable: true; +} & EditableProps) | ({ + isEditable?: false; +} & Partial)); +declare const DashboardDescriptionListGroup: React.FC; +export default DashboardDescriptionListGroup; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardEmptyTableView.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardEmptyTableView.d.ts new file mode 100644 index 0000000000..8f87253850 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardEmptyTableView.d.ts @@ -0,0 +1,9 @@ +import * as React from 'react'; +import { EmptyStateVariant } from '@patternfly/react-core'; +type DashboardEmptyTableViewProps = { + hasIcon?: boolean; + onClearFilters: (event: React.SyntheticEvent) => void; + variant?: EmptyStateVariant; +}; +declare const DashboardEmptyTableView: React.FC; +export default DashboardEmptyTableView; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardHelpTooltip.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardHelpTooltip.d.ts new file mode 100644 index 0000000000..5416ef0dfe --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardHelpTooltip.d.ts @@ -0,0 +1,6 @@ +import * as React from 'react'; +type DashboardHelpTooltipProps = { + content: React.ReactNode; +}; +declare const DashboardHelpTooltip: React.FC; +export default DashboardHelpTooltip; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardModalFooter.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardModalFooter.d.ts new file mode 100644 index 0000000000..11cbd6ba52 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardModalFooter.d.ts @@ -0,0 +1,13 @@ +import * as React from 'react'; +import { ButtonProps } from '@patternfly/react-core'; +type DashboardModalFooterProps = { + submitLabel: string; + submitButtonVariant?: ButtonProps['variant']; + onSubmit: () => void; + onCancel: () => void; + isSubmitDisabled: boolean; + isSubmitLoading?: boolean; + isCancelDisabled?: boolean; +}; +declare const DashboardModalFooter: React.FC; +export default DashboardModalFooter; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardSearchField.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardSearchField.d.ts new file mode 100644 index 0000000000..43f77ba864 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/DashboardSearchField.d.ts @@ -0,0 +1,28 @@ +import * as React from 'react'; +export declare enum SearchType { + NAME = "Name", + DESCRIPTION = "Description", + USER = "User", + PROJECT = "Project", + METRIC = "Metric", + PROTECTED_ATTRIBUTE = "Protected attribute", + PRIVILEGED_VALUE = "Privileged value", + UNPRIVILEGED_VALUE = "Unprivileged value", + OUTPUT = "Output", + OUTPUT_VALUE = "Output value", + PROVIDER = "Provider", + IDENTIFIER = "Identifier", + KEYWORD = "Keyword", + AUTHOR = "Author", + OWNER = "Owner" +} +type DashboardSearchFieldProps = { + types: SearchType[]; + searchType: SearchType; + onSearchTypeChange: (searchType: SearchType) => void; + searchValue: string; + onSearchValueChange: (searchValue: string) => void; + icon?: React.ReactNode; +}; +declare const DashboardSearchField: React.FC; +export default DashboardSearchField; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/EditableLabelsDescriptionListGroup.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/EditableLabelsDescriptionListGroup.d.ts new file mode 100644 index 0000000000..ca9f051324 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/EditableLabelsDescriptionListGroup.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { DashboardDescriptionListGroupProps } from '~/shared/components/DashboardDescriptionListGroup'; +type EditableTextDescriptionListGroupProps = Partial> & { + labels: string[]; + saveEditedLabels: (labels: string[]) => Promise; + allExistingKeys?: string[]; + isArchive?: boolean; +}; +declare const EditableLabelsDescriptionListGroup: React.FC; +export default EditableLabelsDescriptionListGroup; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/EditableTextDescriptionListGroup.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/EditableTextDescriptionListGroup.d.ts new file mode 100644 index 0000000000..3b0fd4bf74 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/EditableTextDescriptionListGroup.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { DashboardDescriptionListGroupProps } from '~/shared/components/DashboardDescriptionListGroup'; +type EditableTextDescriptionListGroupProps = Pick & { + value: string; + saveEditedValue: (value: string) => Promise; + testid?: string; + isArchive?: boolean; +}; +declare const EditableTextDescriptionListGroup: React.FC; +export default EditableTextDescriptionListGroup; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/EmptyStateErrorMessage.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/EmptyStateErrorMessage.d.ts new file mode 100644 index 0000000000..ba6ebbcb34 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/EmptyStateErrorMessage.d.ts @@ -0,0 +1,8 @@ +import * as React from 'react'; +type EmptyStateErrorMessageProps = { + children?: React.ReactNode; + title: string; + bodyText: string; +}; +declare const EmptyStateErrorMessage: React.FC; +export default EmptyStateErrorMessage; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/InlineTruncatedClipboardCopy.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/InlineTruncatedClipboardCopy.d.ts new file mode 100644 index 0000000000..4e34efb42d --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/InlineTruncatedClipboardCopy.d.ts @@ -0,0 +1,12 @@ +import * as React from 'react'; +import './InlineTruncatedClipboardCopy.scss'; +type Props = { + textToCopy: string; + testId?: string; +}; +/** Hopefully PF will add some flexibility with ClipboardCopy + * in the future and this will not be necessary + * https://github.com/patternfly/patternfly-react/issues/10890 + **/ +declare const InlineTruncatedClipboardCopy: React.FC; +export default InlineTruncatedClipboardCopy; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/MarkdownView.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/MarkdownView.d.ts new file mode 100644 index 0000000000..2acba43859 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/MarkdownView.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; +import './MarkdownView.scss'; +type MarkdownViewProps = { + markdown?: string; + className?: string; + /** Strips some padding out so the content can fit as an inline-block effort */ + conciseDisplay?: boolean; + component?: 'div' | 'span'; +}; +declare const MarkdownView: React.FC>; +export default MarkdownView; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/SimpleSelect.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/SimpleSelect.d.ts new file mode 100644 index 0000000000..478451fd28 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/SimpleSelect.d.ts @@ -0,0 +1,31 @@ +import * as React from 'react'; +import { Select, MenuToggleProps } from '@patternfly/react-core'; +import './SimpleSelect.scss'; +export type SimpleSelectOption = { + key: string; + label: string; + description?: React.ReactNode; + dropdownLabel?: React.ReactNode; + isPlaceholder?: boolean; + isDisabled?: boolean; +}; +export type SimpleGroupSelectOption = { + key: string; + label: string; + options: SimpleSelectOption[]; +}; +type SimpleSelectProps = { + options?: SimpleSelectOption[]; + groupedOptions?: SimpleGroupSelectOption[]; + value?: string; + toggleLabel?: React.ReactNode; + placeholder?: string; + onChange: (key: string, isPlaceholder: boolean) => void; + isFullWidth?: boolean; + toggleProps?: MenuToggleProps; + isDisabled?: boolean; + icon?: React.ReactNode; + dataTestId?: string; +} & Omit, 'isOpen' | 'toggle' | 'dropdownItems' | 'onChange' | 'selected'>; +declare const SimpleSelect: React.FC; +export default SimpleSelect; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/browserStorage/BrowserStorageContext.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/browserStorage/BrowserStorageContext.d.ts new file mode 100644 index 0000000000..418c6a824e --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/browserStorage/BrowserStorageContext.d.ts @@ -0,0 +1,24 @@ +import * as React from 'react'; +export type BrowserStorageContextType = { + /** Based on parseJSON it can be any jsonify-able item */ + getValue: (storageKey: string, parseJSON: boolean, isSessionStorage?: boolean) => unknown; + /** Returns a boolean if it was able to json-ify it. */ + setJSONValue: (storageKey: string, value: unknown, isSessionStorage?: boolean) => boolean; + setStringValue: (storageKey: string, value: string, isSessionStorage?: boolean) => void; +}; +/** + * @returns {boolean} if it was successful, false if it was not + */ +export type SetBrowserStorageHook = (value: T) => boolean; +/** + * useBrowserStorage will handle all the effort behind managing localStorage or sessionStorage. + */ +export declare const useBrowserStorage: (storageKey: string, defaultValue: T, jsonify?: boolean, isSessionStorage?: boolean) => [T, SetBrowserStorageHook]; +type BrowserStorageContextProviderProps = { + children: React.ReactNode; +}; +/** + * @see useBrowserStorage + */ +export declare const BrowserStorageContextProvider: React.FC; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/browserStorage/index.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/browserStorage/index.d.ts new file mode 100644 index 0000000000..d2c825ef5d --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/browserStorage/index.d.ts @@ -0,0 +1 @@ +export { useBrowserStorage } from './BrowserStorageContext'; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/design/TitleWithIcon.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/design/TitleWithIcon.d.ts new file mode 100644 index 0000000000..4cd0dd16d2 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/design/TitleWithIcon.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { ProjectObjectType } from '~/shared/components/design/utils'; +interface TitleWithIconProps { + title: React.ReactNode; + objectType: ProjectObjectType; + iconSize?: number; + padding?: number; +} +declare const TitleWithIcon: React.FC; +export default TitleWithIcon; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/design/utils.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/design/utils.d.ts new file mode 100644 index 0000000000..93363eea9b --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/design/utils.d.ts @@ -0,0 +1,7 @@ +import './vars.scss'; +export declare enum ProjectObjectType { + registeredModels = "registered-models" +} +export declare const typedBackgroundColor: (objectType: ProjectObjectType) => string; +export declare const typedObjectImage: (objectType: ProjectObjectType) => string; +export declare const typedEmptyImage: (objectType: ProjectObjectType, option?: string) => string; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/pf-overrides/FormSection.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/pf-overrides/FormSection.d.ts new file mode 100644 index 0000000000..aa238529e5 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/pf-overrides/FormSection.d.ts @@ -0,0 +1,8 @@ +import * as React from 'react'; +import { FormSectionProps } from '@patternfly/react-core'; +import './FormSection.scss'; +type Props = FormSectionProps & { + description?: React.ReactNode; +}; +declare const FormSection: React.FC; +export default FormSection; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/CheckboxTd.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/CheckboxTd.d.ts new file mode 100644 index 0000000000..e4a4c8aed4 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/CheckboxTd.d.ts @@ -0,0 +1,11 @@ +import * as React from 'react'; +import { Td } from '@patternfly/react-table'; +type CheckboxTrProps = { + id: string; + isChecked: boolean | null; + onToggle: () => void; + isDisabled?: boolean; + tooltip?: string; +} & React.ComponentProps; +declare const CheckboxTd: React.FC; +export default CheckboxTd; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/Table.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/Table.d.ts new file mode 100644 index 0000000000..85c1c60dd2 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/Table.d.ts @@ -0,0 +1,13 @@ +import * as React from 'react'; +import { TbodyProps } from '@patternfly/react-table'; +import { EitherNotBoth } from '~/shared/typeHelpers'; +import TableBase from './TableBase'; +type TableProps = Omit>, 'itemCount' | 'onPerPageSelect' | 'onSetPage' | 'page' | 'perPage'> & EitherNotBoth<{ + disableRowRenderSupport?: boolean; +}, { + tbodyProps?: TbodyProps & { + ref?: React.Ref; + }; +}>; +declare const Table: ({ data: allData, columns, subColumns, enablePagination, defaultSortColumn, truncateRenderingAt, ...props }: TableProps) => React.ReactElement; +export default Table; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/TableBase.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/TableBase.d.ts new file mode 100644 index 0000000000..f306aa59cf --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/TableBase.d.ts @@ -0,0 +1,39 @@ +import * as React from 'react'; +import { PaginationProps, ToolbarGroup, ToolbarItem } from '@patternfly/react-core'; +import { Tr, TableProps, TbodyProps } from '@patternfly/react-table'; +import { EitherNotBoth } from '~/shared/typeHelpers'; +import { GetColumnSort, SortableData } from './types'; +type Props = { + loading?: boolean; + data: DataType[]; + columns: SortableData[]; + subColumns?: SortableData[]; + hasNestedHeader?: boolean; + defaultSortColumn?: number; + rowRenderer: (data: DataType, rowIndex: number) => React.ReactNode; + enablePagination?: boolean | 'compact'; + truncateRenderingAt?: number; + toolbarContent?: React.ReactElement; + bottomToolbarContent?: React.ReactElement; + emptyTableView?: React.ReactNode; + caption?: string; + footerRow?: (pageNumber: number) => React.ReactElement | null; + selectAll?: { + onSelect: (value: boolean) => void; + selected: boolean; + disabled?: boolean; + tooltip?: string; + }; + getColumnSort?: GetColumnSort; + disableItemCount?: boolean; + hasStickyColumns?: boolean; +} & EitherNotBoth<{ + disableRowRenderSupport?: boolean; +}, { + tbodyProps?: TbodyProps & { + ref?: React.Ref; + }; +}> & Omit & Pick; +export declare const MIN_PAGE_SIZE = 10; +declare const TableBase: ({ data, columns, subColumns, hasNestedHeader, rowRenderer, enablePagination, toolbarContent, bottomToolbarContent, emptyTableView, caption, disableRowRenderSupport, selectAll, footerRow, tbodyProps, perPage, page, perPageOptions, onSetPage, onNextClick, onPreviousClick, onPerPageSelect, getColumnSort, itemCount, loading, toggleTemplate, disableItemCount, hasStickyColumns, ...props }: Props) => React.ReactElement; +export default TableBase; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/TableRowTitleDescription.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/TableRowTitleDescription.d.ts new file mode 100644 index 0000000000..d909137db7 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/TableRowTitleDescription.d.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +type TableRowTitleDescriptionProps = { + title: React.ReactNode; + subtitle?: React.ReactNode; + description?: string; + descriptionAsMarkdown?: boolean; + label?: React.ReactNode; +}; +declare const TableRowTitleDescription: React.FC; +export default TableRowTitleDescription; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/const.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/const.d.ts new file mode 100644 index 0000000000..9aac927b54 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/const.d.ts @@ -0,0 +1,7 @@ +import { SortableData } from './types'; +export declare const CHECKBOX_FIELD_ID = "checkbox"; +export declare const KEBAB_FIELD_ID = "kebab"; +export declare const EXPAND_FIELD_ID = "expand"; +export declare const checkboxTableColumn: () => SortableData; +export declare const kebabTableColumn: () => SortableData; +export declare const expandTableColumn: () => SortableData; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/index.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/index.d.ts new file mode 100644 index 0000000000..05b0ff5359 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/index.d.ts @@ -0,0 +1,10 @@ +export * from './types'; +export * from './const'; +export { default as Table } from './Table'; +export { default as TableBase } from './TableBase'; +export { default as useCheckboxTable } from './useCheckboxTable'; +export { default as useCheckboxTableBase } from './useCheckboxTableBase'; +export type { UseCheckboxTableBaseProps } from './useCheckboxTableBase'; +export { default as TableRowTitleDescription } from './TableRowTitleDescription'; +export { default as CheckboxTd } from './CheckboxTd'; +export { getTableColumnSort } from './useTableColumnSort'; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/types.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/types.d.ts new file mode 100644 index 0000000000..f5701ddd23 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/types.d.ts @@ -0,0 +1,15 @@ +import { ThProps } from '@patternfly/react-table'; +export type GetColumnSort = (columnIndex: number) => ThProps['sort']; +export type SortableData = Pick & { + label: string; + field: string; + colSpan?: number; + rowSpan?: number; + /** + * Set to false to disable sort. + * Set to true to handle string and number fields automatically (everything else is equal). + * Pass a function that will get the two results and what field needs to be matched. + * Assume ASC -- the result will be inverted internally if needed. + */ + sortable: boolean | ((a: T, b: T, keyField: string) => number); +}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/useCheckboxTable.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/useCheckboxTable.d.ts new file mode 100644 index 0000000000..85f0628c33 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/useCheckboxTable.d.ts @@ -0,0 +1,11 @@ +import * as React from 'react'; +import type Table from './Table'; +type UseCheckboxTable = { + selections: string[]; + tableProps: Required, 'selectAll'>>; + toggleSelection: (id: string) => void; + isSelected: (id: string) => boolean; + setSelections: (selections: string[]) => void; +}; +declare const useCheckboxTable: (dataIds: string[], defaultSelectedIds?: string[], persistSelections?: boolean) => UseCheckboxTable; +export default useCheckboxTable; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/useCheckboxTableBase.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/useCheckboxTableBase.d.ts new file mode 100644 index 0000000000..33add7427e --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/useCheckboxTableBase.d.ts @@ -0,0 +1,18 @@ +import * as React from 'react'; +import type Table from './Table'; +export type UseCheckboxTableBaseProps = { + selections: DataType[]; + tableProps: Required, 'selectAll'>>; + toggleSelection: (selection: DataType) => void; + isSelected: (selection: DataType) => boolean; + disableCheck: (item: DataType, enabled: boolean) => void; + setSelections: React.Dispatch>; +}; +declare const useCheckboxTableBase: (data: T[], selectedData: T[], setSelectedData: React.Dispatch>, dataMappingHelper: (selectData: T) => string, options?: { + selectAll?: { + selected?: boolean; + disabled?: boolean; + }; + persistSelections?: boolean; +}) => UseCheckboxTableBaseProps; +export default useCheckboxTableBase; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/useTableColumnSort.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/useTableColumnSort.d.ts new file mode 100644 index 0000000000..47cb3dbd43 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/components/table/useTableColumnSort.d.ts @@ -0,0 +1,25 @@ +import { GetColumnSort, SortableData } from './types'; +type TableColumnSortProps = { + columns: SortableData[]; + subColumns?: SortableData[]; + sortDirection?: 'asc' | 'desc'; + setSortDirection: (dir: 'asc' | 'desc') => void; +}; +type TableColumnSortByFieldProps = TableColumnSortProps & { + sortField?: string; + setSortField: (field: string) => void; +}; +export declare const getTableColumnSort: ({ columns, subColumns, sortField, setSortField, ...sortProps }: TableColumnSortByFieldProps) => GetColumnSort; +/** + * Using PF Composable Tables, this utility will help with handling sort logic. + * + * Use `transformData` on your data before you render rows. + * Use `getColumnSort` on your Th.sort as you render it (using the index of your column) + * + * @see https://www.patternfly.org/v4/components/table + */ +declare const useTableColumnSort: (columns: SortableData[], subColumns: SortableData[], defaultSortColIndex?: number) => { + transformData: (data: T[]) => T[]; + getColumnSort: GetColumnSort; +}; +export default useTableColumnSort; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/typeHelpers.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/typeHelpers.d.ts new file mode 100644 index 0000000000..6d2f524c06 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/typeHelpers.d.ts @@ -0,0 +1,146 @@ +/** + * The type `{}` doesn't mean "any empty object", it means "any non-nullish value". + * + * Use the `AnyObject` type for objects whose structure is unknown. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492 + */ +export type AnyObject = Record; +/** + * Takes a type and makes all properties partial within it. + * + * TODO: Implement the SDK & Patch logic -- this should stop being needed as things will be defined as Patches + */ +export type RecursivePartial = T extends object ? { + [P in keyof T]?: RecursivePartial; +} : T; +/** + * Partial only some properties. + * + * eg. PartialSome + */ +export type PartialSome = Pick, Keys> & Omit; +/** + * Unions all values of an object togethers -- antithesis to `keyof myObj`. + */ +export type ValueOf = T[keyof T]; +/** + * Never allow any properties of `Type`. + * + * Utility type, probably never a reason to export. + */ +type Never = { + [K in keyof Type]?: never; +}; +/** + * Either TypeA properties or TypeB properties -- never both. + * + * @example + * ```ts + * type MyType = EitherNotBoth<{ foo: boolean }, { bar: boolean }>; + * + * // Valid usages: + * const objA: MyType = { + * foo: true, + * }; + * const objB: MyType = { + * bar: true, + * }; + * + * // TS Error -- can't have both properties: + * const objBoth: MyType = { + * foo: true, + * bar: true, + * }; + * + * // TS Error -- must have at least one property: + * const objNeither: MyType = { + * }; + * ``` + */ +export type EitherNotBoth = (TypeA & Never) | (TypeB & Never); +/** + * Either TypeA properties or TypeB properties or neither of the properties -- never both. + * + * @example + * ```ts + * type MyType = EitherOrBoth<{ foo: boolean }, { bar: boolean }>; + * + * // Valid usages: + * const objA: MyType = { + * foo: true, + * }; + * const objB: MyType = { + * bar: true, + * }; + * const objBoth: MyType = { + * foo: true, + * bar: true, + * }; + * + * // TS Error -- can't omit both properties: + * const objNeither: MyType = { + * }; + * ``` + */ +export type EitherOrBoth = EitherNotBoth | (TypeA & TypeB); +/** + * Either TypeA properties or TypeB properties or neither of the properties -- never both. + * + * @example + * ```ts + * type MyType = EitherOrNone<{ foo: boolean }, { bar: boolean }>; + * + * // Valid usages: + * const objA: MyType = { + * foo: true, + * }; + * const objB: MyType = { + * bar: true, + * }; + * const objNeither: MyType = { + * }; + * + * // TS Error -- can't have both properties: + * const objBoth: MyType = { + * foo: true, + * bar: true, + * }; + * ``` + */ +export type EitherOrNone = EitherNotBoth | (Never & Never); +type Explode = keyof T extends infer K ? K extends unknown ? { + [I in keyof T]: I extends K ? T[I] : never; +} : never : never; +type AtMostOne = Explode>; +type AtLeastOne; +}> = Partial & U[keyof U]; +/** + * Create a type where exactly one of multiple properties must be supplied. + * + * @example + * ```ts + * type Foo = ExactlyOne<{ a: number, b: string, c: boolean}>; + * + * // Valid usages: + * const objA: Foo = { + * a: 1, + * }; + * const objB: Foo = { + * b: 'hi', + * }; + * const objC: Foo = { + * c: true, + * }; + * + * // TS Error -- can't have more than one property: + * const objAll: Foo = { + * a: 1, + * b: 'hi', + * c: true, + * }; + * ``` + */ +export type ExactlyOne = AtMostOne & AtLeastOne; +export {}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/types.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/types.d.ts new file mode 100644 index 0000000000..867a2ed259 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/types.d.ts @@ -0,0 +1,20 @@ +import { ValueOf } from '~/shared/typeHelpers'; +export type UserSettings = { + username: string; + isAdmin: boolean; + isAllowed: boolean; +}; +export type ConfigSettings = { + common: CommonConfig; +}; +export type CommonConfig = { + featureFlags: FeatureFlag; +}; +export type FeatureFlag = { + modelRegistry: boolean; +}; +export type KeyValuePair = { + key: string; + value: string; +}; +export type UpdateObjectAtPropAndValue = (propKey: keyof T, propValue: ValueOf) => void; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/const.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/const.d.ts new file mode 100644 index 0000000000..e2c6c39d5a --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/const.d.ts @@ -0,0 +1,9 @@ +declare const POLL_INTERVAL = 30000; +export declare enum Theme { + Default = "default-theme", + MUI = "mui-theme" +} +export declare const isMUITheme: () => boolean; +export declare const STYLE_THEME: string; +export declare const USER_ACCESS_TOKEN = "x-forwarded-access-token"; +export { POLL_INTERVAL }; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/markdown.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/markdown.d.ts new file mode 100644 index 0000000000..2ab85be435 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/markdown.d.ts @@ -0,0 +1,3 @@ +export declare const markdownConverter: { + makeHtml: (markdown: string) => string; +}; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/time.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/time.d.ts new file mode 100644 index 0000000000..84ef4f6fa1 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/time.d.ts @@ -0,0 +1 @@ +export declare const relativeTime: (current: number, previous: number) => string; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useDebounceCallback.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useDebounceCallback.d.ts new file mode 100644 index 0000000000..1c4b069586 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useDebounceCallback.d.ts @@ -0,0 +1,3 @@ +import * as _ from 'lodash-es'; +declare const useDebounceCallback: any>(fn: T, delay?: number) => ReturnType>; +export default useDebounceCallback; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useDeepCompareMemoize.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useDeepCompareMemoize.d.ts new file mode 100644 index 0000000000..5c6df8b9f4 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useDeepCompareMemoize.d.ts @@ -0,0 +1 @@ +export declare const useDeepCompareMemoize: (value: T) => T; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useEventListener.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useEventListener.d.ts new file mode 100644 index 0000000000..96ec979b12 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useEventListener.d.ts @@ -0,0 +1 @@ +export declare const useEventListener: (eventTarget: EventTarget, event: keyof WindowEventMap, cb: EventListener) => void; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useFetchState.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useFetchState.d.ts new file mode 100644 index 0000000000..8d0d0ab985 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useFetchState.d.ts @@ -0,0 +1,82 @@ +import { APIOptions } from '~/shared/api/types'; +/** + * Allows "I'm not ready" rejections if you lack a lazy provided prop + * e.g. Promise.reject(new NotReadyError('Do not have namespace')) + */ +export declare class NotReadyError extends Error { + constructor(reason: string); +} +/** + * Checks to see if it's a standard error handled by useStateFetch .catch block. + */ +export declare const isCommonStateError: (e: Error) => boolean; +/** Provided as a promise, so you can await a refresh before enabling buttons / closing modals. + * Returns the successful value or nothing if the call was cancelled / didn't complete. */ +export type FetchStateRefreshPromise = () => Promise; +/** Return state */ +export type FetchState = [ + data: Type, + loaded: boolean, + loadError: Error | undefined, + /** This promise should never throw to the .catch */ + refresh: FetchStateRefreshPromise +]; +type SetStateLazy = (lastState: Type) => Type; +export type AdHocUpdate = (updateLater: (updater: SetStateLazy) => void) => void; +/** + * All callbacks will receive a APIOptions, which includes a signal to provide to a RequestInit. + * This will allow the call to be cancelled if the hook needs to unload. It is recommended that you + * upgrade your API handlers to support this. + */ +type FetchStateCallbackPromiseReturn = (opts: APIOptions) => Return; +/** + * Standard usage. Your callback should return a Promise that resolves to your data. + */ +export type FetchStateCallbackPromise = FetchStateCallbackPromiseReturn>; +/** + * Advanced usage. If you have a need to include a lazy refresh state to your data, you can use this + * functionality. It works on the lazy React.setState functionality. + * + * Note: When using, you're giving up immediate setState, so you'll want to call the setStateLater + * function immediately to get back that functionality. + * + * Example: + * ``` + * React.useCallback(() => + * new Promise(() => { + * MyAPICall().then((...) => + * resolve((setStateLater) => { // << providing a function instead of the value + * setStateLater({ ...someInitialData }) + * // ...some time later, after more calls / in a callback / etc + * setStateLater((lastState) => ({ ...lastState, data: additionalData })) + * }) + * ) + * }) + * ); + * ``` + */ +export type FetchStateCallbackPromiseAdHoc = FetchStateCallbackPromiseReturn>>; +export type FetchOptions = { + /** To enable auto refresh */ + refreshRate: number; + /** + * Makes your promise pure from the sense of if it changes you do not want the previous data. When + * you recompute your fetchCallbackPromise, do you want to drop the values stored? This will + * reset everything; result, loaded, & error state. Intended purpose is if your promise is keyed + * off of a value that if it changes you should drop all data as it's fundamentally a different + * thing - sharing old state is misleading. + * + * Note: Doing this could have undesired side effects. Consider your hook's dependents and the + * state of your data. + * Note: This is only read as initial value; changes do nothing. + */ + initialPromisePurity: boolean; +}; +/** + * A boilerplate helper utility. Given a callback that returns a promise, it will store state and + * handle refreshes on intervals as needed. + * + * Note: Your callback *should* support the opts property so the call can be cancelled. + */ +declare const useFetchState: (fetchCallbackPromise: FetchStateCallbackPromise>, initialDefaultState: Type, { refreshRate, initialPromisePurity }?: Partial) => FetchState; +export default useFetchState; diff --git a/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useGenericObjectState.d.ts b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useGenericObjectState.d.ts new file mode 100644 index 0000000000..c1778b7f83 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/compiled-types/src/shared/utilities/useGenericObjectState.d.ts @@ -0,0 +1,8 @@ +import { UpdateObjectAtPropAndValue } from '~/shared/types'; +export type GenericObjectState = [ + data: T, + setData: UpdateObjectAtPropAndValue, + resetDefault: () => void +]; +declare const useGenericObjectState: (defaultData: T) => GenericObjectState; +export default useGenericObjectState; diff --git a/frontend/@mf-types/@mf/model-registry/plugin.d.ts b/frontend/@mf-types/@mf/model-registry/plugin.d.ts new file mode 100644 index 0000000000..08d026d593 --- /dev/null +++ b/frontend/@mf-types/@mf/model-registry/plugin.d.ts @@ -0,0 +1,2 @@ +export * from './compiled-types/src/plugin/index'; +export { default } from './compiled-types/src/plugin/index'; \ No newline at end of file