From 01be858bdc6938dd8dc216025c039063381282a8 Mon Sep 17 00:00:00 2001 From: Walid Baruni Date: Mon, 16 Sep 2024 09:50:36 +0200 Subject: [PATCH] webui error handling + openapi gen update (#4413) This PR improves API error handling in the WebUI as well as adding connection status indicator to tell if the backend (orchestrator node) is alive and reachable or not. In addition to that: - Migrate OpenAPI typescript code generator library to a maintainable one as the existing one is deprecated - Fixes echo custom error handler to reflect correct error code, and serializing RequestID and Status in the APIError in addition to the headers to simplify error handling in non-go clients --- docs/swagger.json | 10 +- pkg/jobstore/boltdb/store.go | 8 +- pkg/models/error.go | 15 +- pkg/publicapi/apimodels/agent.go | 2 +- pkg/publicapi/apimodels/error.go | 59 +- pkg/publicapi/endpoint/agent/endpoint.go | 2 +- pkg/publicapi/middleware/error_handler.go | 54 +- .../middleware/error_handler_test.go | 121 + pkg/swagger/docs.go | 10 +- pkg/swagger/swagger.json | 10 +- webui/app/layout.tsx | 2 + webui/app/providers/ApiProvider.tsx | 15 +- webui/components/ConnectionStatus.tsx | 11 + .../components/ConnectionStatusIndicator.tsx | 94 + webui/components/ErrorDisplay.tsx | 37 + webui/components/jobs/details/JobActions.tsx | 21 +- webui/components/jobs/details/JobDetails.tsx | 75 +- .../components/jobs/details/JobExecutions.tsx | 3 +- webui/components/jobs/details/JobHistory.tsx | 3 +- .../jobs/details/JobInformation.tsx | 6 +- webui/components/jobs/details/JobLogs.tsx | 12 +- webui/components/jobs/list/JobsOverview.tsx | 35 +- webui/components/jobs/list/JobsTable.tsx | 3 +- webui/components/nodes/NodeStatus.tsx | 5 +- .../components/nodes/details/NodeActions.tsx | 51 +- .../components/nodes/details/NodeDetails.tsx | 52 +- .../components/nodes/details/NodeInspect.tsx | 2 +- webui/components/nodes/list/NodesOverview.tsx | 23 +- webui/hooks/useApiOperation.ts | 32 + webui/hooks/useConnectionMonitor.tsx | 39 + webui/lib/api/errors.ts | 68 + webui/lib/api/generated/core/ApiError.ts | 25 - .../api/generated/core/ApiRequestOptions.ts | 17 - webui/lib/api/generated/core/ApiResult.ts | 11 - .../api/generated/core/CancelablePromise.ts | 140 -- webui/lib/api/generated/core/OpenAPI.ts | 32 - webui/lib/api/generated/core/request.ts | 323 --- webui/lib/api/generated/index.ts | 114 +- .../models/apimodels_GetJobResponse.ts | 13 - .../models/apimodels_GetNodeResponse.ts | 9 - .../models/apimodels_GetVersionResponse.ts | 14 - .../models/apimodels_HTTPCredential.ts | 22 - .../apimodels_ListJobExecutionsResponse.ts | 10 - .../apimodels_ListJobHistoryResponse.ts | 10 - .../apimodels_ListJobResultsResponse.ts | 10 - .../models/apimodels_ListJobsResponse.ts | 10 - .../models/apimodels_ListNodesResponse.ts | 10 - .../models/apimodels_PutJobRequest.ts | 13 - .../models/apimodels_PutJobResponse.ts | 10 - .../models/apimodels_PutNodeRequest.ts | 14 - .../models/apimodels_PutNodeResponse.ts | 9 - .../models/apimodels_StopJobResponse.ts | 8 - .../api/generated/models/authn_MethodType.ts | 8 - ...lhau_pkg_config_legacy_types_AuthConfig.ts | 40 - ...config_legacy_types_AuthenticatorConfig.ts | 10 - ...calhau_pkg_config_legacy_types_Duration.ts | 14 - ...hau_pkg_config_legacy_types_JobDefaults.ts | 11 - ...au_pkg_config_legacy_types_UpdateConfig.ts | 10 - .../api/generated/models/logger_LogMode.ts | 11 - .../models/models_AllocatedResources.ts | 9 - .../models/models_BuildVersionInfo.ts | 14 - .../models/models_ComputeNodeInfo.ts | 17 - .../api/generated/models/models_DebugInfo.ts | 9 - .../lib/api/generated/models/models_Event.ts | 26 - .../api/generated/models/models_Execution.ts | 90 - .../models_ExecutionDesiredStateType.ts | 9 - .../generated/models/models_ExecutionLog.ts | 10 - .../models/models_ExecutionLogType.ts | 9 - .../models/models_ExecutionStateType.ts | 16 - .../models_FailureInjectionRequesterConfig.ts | 8 - webui/lib/api/generated/models/models_GPU.ts | 29 - .../api/generated/models/models_GPUVendor.ts | 9 - .../generated/models/models_InputSource.ts | 21 - webui/lib/api/generated/models/models_Job.ts | 69 - .../api/generated/models/models_JobHistory.ts | 25 - .../generated/models/models_JobHistoryType.ts | 9 - .../models/models_JobSelectionDataLocality.ts | 8 - .../models/models_JobSelectionPolicy.ts | 30 - .../generated/models/models_JobStateType.ts | 13 - .../models/models_LabelSelectorRequirement.ts | 23 - .../api/generated/models/models_Network.ts | 9 - .../generated/models/models_NetworkConfig.ts | 10 - .../models/models_NodeConnectionState.ts | 14 - .../api/generated/models/models_NodeInfo.ts | 18 - .../models/models_NodeMembershipState.ts | 16 - .../api/generated/models/models_NodeState.ts | 13 - .../api/generated/models/models_NodeType.ts | 9 - .../api/generated/models/models_Resources.ts | 28 - .../models/models_ResourcesConfig.ts | 20 - .../api/generated/models/models_ResultPath.ts | 15 - .../models/models_RunCommandResult.ts | 31 - .../api/generated/models/models_SpecConfig.ts | 15 - ...s_StateChange_models_ExecutionStateType.ts | 10 - .../models_StateChange_models_JobStateType.ts | 10 - ..._State_models_ExecutionDesiredStateType.ts | 16 - .../models_State_models_ExecutionStateType.ts | 16 - .../models_State_models_JobStateType.ts | 16 - webui/lib/api/generated/models/models_Task.ts | 42 - .../generated/models/models_TimeoutConfig.ts | 23 - .../generated/models/selection_Operator.ts | 15 - .../generated/models/shared_VersionRequest.ts | 8 - .../models/shared_VersionResponse.ts | 9 - .../api/generated/models/types_APIConfig.ts | 27 - .../generated/models/types_BacalhauConfig.ts | 21 - .../generated/models/types_CapacityConfig.ts | 18 - .../generated/models/types_ClientTLSConfig.ts | 22 - .../generated/models/types_ComputeConfig.ts | 25 - .../models/types_ComputeControlPlaneConfig.ts | 27 - .../models/types_DockerCacheConfig.ts | 11 - .../models/types_EvaluationBrokerConfig.ts | 12 - .../generated/models/types_FeatureConfig.ts | 10 - .../api/generated/models/types_FreeSpace.ts | 10 - .../api/generated/models/types_HealthInfo.ts | 9 - .../api/generated/models/types_IpfsConfig.ts | 11 - .../generated/models/types_JobStoreConfig.ts | 10 - .../models/types_JobTimeoutConfig.ts | 32 - .../models/types_LocalPublisherConfig.ts | 10 - .../generated/models/types_LogStreamConfig.ts | 11 - .../generated/models/types_LoggingConfig.ts | 12 - .../generated/models/types_MetricsConfig.ts | 8 - .../api/generated/models/types_MountStatus.ts | 10 - .../models/types_NetworkClusterConfig.ts | 11 - .../generated/models/types_NetworkConfig.ts | 14 - .../api/generated/models/types_NodeConfig.ts | 58 - .../generated/models/types_RequesterConfig.ts | 47 - .../types_RequesterControlPlaneConfig.ts | 24 - .../models/types_S3StorageProviderConfig.ts | 10 - .../generated/models/types_SchedulerConfig.ts | 10 - .../models/types_StorageProviderConfig.ts | 9 - .../api/generated/models/types_StorageType.ts | 8 - .../models/types_TLSConfiguration.ts | 33 - .../api/generated/models/types_UserConfig.ts | 13 - .../api/generated/models/types_WebUIConfig.ts | 9 - .../generated/models/types_WorkerConfig.ts | 12 - webui/lib/api/generated/schemas.gen.ts | 2004 ----------------- webui/lib/api/generated/services.gen.ts | 680 +++--- .../generated/services/ComputeNodeService.ts | 23 - .../lib/api/generated/services/MiscService.ts | 31 - .../lib/api/generated/services/OpsService.ts | 80 - .../generated/services/OrchestratorService.ts | 348 --- .../api/generated/services/UtilsService.ts | 69 - webui/lib/api/generated/types.gen.ts | 657 +++--- webui/lib/api/index.ts | 32 +- webui/lib/api/schema/swagger.json | 10 +- webui/lib/api/utils.ts | 71 +- webui/lib/time.ts | 65 + webui/openapi-ts.config.ts | 32 + webui/package.json | 4 +- webui/yarn.lock | 298 ++- 149 files changed, 1724 insertions(+), 5858 deletions(-) create mode 100644 pkg/publicapi/middleware/error_handler_test.go create mode 100644 webui/components/ConnectionStatus.tsx create mode 100644 webui/components/ConnectionStatusIndicator.tsx create mode 100644 webui/components/ErrorDisplay.tsx create mode 100644 webui/hooks/useApiOperation.ts create mode 100644 webui/hooks/useConnectionMonitor.tsx create mode 100644 webui/lib/api/errors.ts delete mode 100644 webui/lib/api/generated/core/ApiError.ts delete mode 100644 webui/lib/api/generated/core/ApiRequestOptions.ts delete mode 100644 webui/lib/api/generated/core/ApiResult.ts delete mode 100644 webui/lib/api/generated/core/CancelablePromise.ts delete mode 100644 webui/lib/api/generated/core/OpenAPI.ts delete mode 100644 webui/lib/api/generated/core/request.ts delete mode 100644 webui/lib/api/generated/models/apimodels_GetJobResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_GetNodeResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_GetVersionResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_HTTPCredential.ts delete mode 100644 webui/lib/api/generated/models/apimodels_ListJobExecutionsResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_ListJobHistoryResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_ListJobResultsResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_ListJobsResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_ListNodesResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_PutJobRequest.ts delete mode 100644 webui/lib/api/generated/models/apimodels_PutJobResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_PutNodeRequest.ts delete mode 100644 webui/lib/api/generated/models/apimodels_PutNodeResponse.ts delete mode 100644 webui/lib/api/generated/models/apimodels_StopJobResponse.ts delete mode 100644 webui/lib/api/generated/models/authn_MethodType.ts delete mode 100644 webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig.ts delete mode 100644 webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig.ts delete mode 100644 webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration.ts delete mode 100644 webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults.ts delete mode 100644 webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig.ts delete mode 100644 webui/lib/api/generated/models/logger_LogMode.ts delete mode 100644 webui/lib/api/generated/models/models_AllocatedResources.ts delete mode 100644 webui/lib/api/generated/models/models_BuildVersionInfo.ts delete mode 100644 webui/lib/api/generated/models/models_ComputeNodeInfo.ts delete mode 100644 webui/lib/api/generated/models/models_DebugInfo.ts delete mode 100644 webui/lib/api/generated/models/models_Event.ts delete mode 100644 webui/lib/api/generated/models/models_Execution.ts delete mode 100644 webui/lib/api/generated/models/models_ExecutionDesiredStateType.ts delete mode 100644 webui/lib/api/generated/models/models_ExecutionLog.ts delete mode 100644 webui/lib/api/generated/models/models_ExecutionLogType.ts delete mode 100644 webui/lib/api/generated/models/models_ExecutionStateType.ts delete mode 100644 webui/lib/api/generated/models/models_FailureInjectionRequesterConfig.ts delete mode 100644 webui/lib/api/generated/models/models_GPU.ts delete mode 100644 webui/lib/api/generated/models/models_GPUVendor.ts delete mode 100644 webui/lib/api/generated/models/models_InputSource.ts delete mode 100644 webui/lib/api/generated/models/models_Job.ts delete mode 100644 webui/lib/api/generated/models/models_JobHistory.ts delete mode 100644 webui/lib/api/generated/models/models_JobHistoryType.ts delete mode 100644 webui/lib/api/generated/models/models_JobSelectionDataLocality.ts delete mode 100644 webui/lib/api/generated/models/models_JobSelectionPolicy.ts delete mode 100644 webui/lib/api/generated/models/models_JobStateType.ts delete mode 100644 webui/lib/api/generated/models/models_LabelSelectorRequirement.ts delete mode 100644 webui/lib/api/generated/models/models_Network.ts delete mode 100644 webui/lib/api/generated/models/models_NetworkConfig.ts delete mode 100644 webui/lib/api/generated/models/models_NodeConnectionState.ts delete mode 100644 webui/lib/api/generated/models/models_NodeInfo.ts delete mode 100644 webui/lib/api/generated/models/models_NodeMembershipState.ts delete mode 100644 webui/lib/api/generated/models/models_NodeState.ts delete mode 100644 webui/lib/api/generated/models/models_NodeType.ts delete mode 100644 webui/lib/api/generated/models/models_Resources.ts delete mode 100644 webui/lib/api/generated/models/models_ResourcesConfig.ts delete mode 100644 webui/lib/api/generated/models/models_ResultPath.ts delete mode 100644 webui/lib/api/generated/models/models_RunCommandResult.ts delete mode 100644 webui/lib/api/generated/models/models_SpecConfig.ts delete mode 100644 webui/lib/api/generated/models/models_StateChange_models_ExecutionStateType.ts delete mode 100644 webui/lib/api/generated/models/models_StateChange_models_JobStateType.ts delete mode 100644 webui/lib/api/generated/models/models_State_models_ExecutionDesiredStateType.ts delete mode 100644 webui/lib/api/generated/models/models_State_models_ExecutionStateType.ts delete mode 100644 webui/lib/api/generated/models/models_State_models_JobStateType.ts delete mode 100644 webui/lib/api/generated/models/models_Task.ts delete mode 100644 webui/lib/api/generated/models/models_TimeoutConfig.ts delete mode 100644 webui/lib/api/generated/models/selection_Operator.ts delete mode 100644 webui/lib/api/generated/models/shared_VersionRequest.ts delete mode 100644 webui/lib/api/generated/models/shared_VersionResponse.ts delete mode 100644 webui/lib/api/generated/models/types_APIConfig.ts delete mode 100644 webui/lib/api/generated/models/types_BacalhauConfig.ts delete mode 100644 webui/lib/api/generated/models/types_CapacityConfig.ts delete mode 100644 webui/lib/api/generated/models/types_ClientTLSConfig.ts delete mode 100644 webui/lib/api/generated/models/types_ComputeConfig.ts delete mode 100644 webui/lib/api/generated/models/types_ComputeControlPlaneConfig.ts delete mode 100644 webui/lib/api/generated/models/types_DockerCacheConfig.ts delete mode 100644 webui/lib/api/generated/models/types_EvaluationBrokerConfig.ts delete mode 100644 webui/lib/api/generated/models/types_FeatureConfig.ts delete mode 100644 webui/lib/api/generated/models/types_FreeSpace.ts delete mode 100644 webui/lib/api/generated/models/types_HealthInfo.ts delete mode 100644 webui/lib/api/generated/models/types_IpfsConfig.ts delete mode 100644 webui/lib/api/generated/models/types_JobStoreConfig.ts delete mode 100644 webui/lib/api/generated/models/types_JobTimeoutConfig.ts delete mode 100644 webui/lib/api/generated/models/types_LocalPublisherConfig.ts delete mode 100644 webui/lib/api/generated/models/types_LogStreamConfig.ts delete mode 100644 webui/lib/api/generated/models/types_LoggingConfig.ts delete mode 100644 webui/lib/api/generated/models/types_MetricsConfig.ts delete mode 100644 webui/lib/api/generated/models/types_MountStatus.ts delete mode 100644 webui/lib/api/generated/models/types_NetworkClusterConfig.ts delete mode 100644 webui/lib/api/generated/models/types_NetworkConfig.ts delete mode 100644 webui/lib/api/generated/models/types_NodeConfig.ts delete mode 100644 webui/lib/api/generated/models/types_RequesterConfig.ts delete mode 100644 webui/lib/api/generated/models/types_RequesterControlPlaneConfig.ts delete mode 100644 webui/lib/api/generated/models/types_S3StorageProviderConfig.ts delete mode 100644 webui/lib/api/generated/models/types_SchedulerConfig.ts delete mode 100644 webui/lib/api/generated/models/types_StorageProviderConfig.ts delete mode 100644 webui/lib/api/generated/models/types_StorageType.ts delete mode 100644 webui/lib/api/generated/models/types_TLSConfiguration.ts delete mode 100644 webui/lib/api/generated/models/types_UserConfig.ts delete mode 100644 webui/lib/api/generated/models/types_WebUIConfig.ts delete mode 100644 webui/lib/api/generated/models/types_WorkerConfig.ts delete mode 100644 webui/lib/api/generated/schemas.gen.ts delete mode 100644 webui/lib/api/generated/services/ComputeNodeService.ts delete mode 100644 webui/lib/api/generated/services/MiscService.ts delete mode 100644 webui/lib/api/generated/services/OpsService.ts delete mode 100644 webui/lib/api/generated/services/OrchestratorService.ts delete mode 100644 webui/lib/api/generated/services/UtilsService.ts create mode 100644 webui/lib/time.ts create mode 100644 webui/openapi-ts.config.ts diff --git a/docs/swagger.json b/docs/swagger.json index 75e92c6fca..968c355b00 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -51,7 +51,7 @@ "200": { "description": "OK", "schema": { - "type": "string" + "$ref": "#/definitions/apimodels.IsAliveResponse" } } } @@ -1045,6 +1045,14 @@ } } }, + "apimodels.IsAliveResponse": { + "type": "object", + "properties": { + "Status": { + "type": "string" + } + } + }, "apimodels.ListJobExecutionsResponse": { "type": "object", "properties": { diff --git a/pkg/jobstore/boltdb/store.go b/pkg/jobstore/boltdb/store.go index e330969516..735576bf2a 100644 --- a/pkg/jobstore/boltdb/store.go +++ b/pkg/jobstore/boltdb/store.go @@ -21,7 +21,6 @@ import ( "github.com/bacalhau-project/bacalhau/pkg/lib/marshaller" "github.com/bacalhau-project/bacalhau/pkg/lib/math" "github.com/bacalhau-project/bacalhau/pkg/models" - "github.com/bacalhau-project/bacalhau/pkg/publicapi/apimodels" "github.com/bacalhau-project/bacalhau/pkg/util" "github.com/bacalhau-project/bacalhau/pkg/util/idgen" ) @@ -179,7 +178,7 @@ func (b *BoltJobStore) getJob(tx *bolt.Tx, jobID string) (models.Job, error) { data := GetBucketData(tx, NewBucketPath(BucketJobs, jobID), SpecKey) if data == nil { - return job, apimodels.NewJobNotFound(jobID) + return job, jobstore.NewErrJobNotFound(jobID) } err = b.marshaller.Unmarshal(data, &job) @@ -912,7 +911,10 @@ func (b *BoltJobStore) deleteJob(tx *bolt.Tx, jobID string) error { job, err := b.getJob(tx, jobID) if err != nil { - apimodels.NewJobNotFound(jobID) + if models.IsBaseError(err) { + return err + } + return NewBoltDbError(err) } tx.OnCommit(func() { diff --git a/pkg/models/error.go b/pkg/models/error.go index 77a693bd7a..19b8a35801 100644 --- a/pkg/models/error.go +++ b/pkg/models/error.go @@ -1,6 +1,7 @@ package models import ( + "errors" "fmt" "net/http" ) @@ -91,6 +92,13 @@ type BaseError struct { code ErrorCode } +// IsBaseError is a helper function that checks if an error is a BaseError. +func IsBaseError(err error) bool { + var baseError *BaseError + ok := errors.As(err, &baseError) + return ok +} + // NewBaseError is a constructor function that creates a new BaseError with // only the message field set. func NewBaseError(format string, a ...any) *BaseError { @@ -180,11 +188,16 @@ func (e *BaseError) Details() map[string]string { return e.details } -// Details a Unique Code to identify the error +// Code returns a unique code to identify the error func (e *BaseError) Code() ErrorCode { return e.code } +// Component is a method that returns the component field of BaseError. +func (e *BaseError) Component() string { + return e.component +} + // HTTPStatusCode is a method that returns the httpStatusCode field of BaseError. // If no specific HTTP status code has been set, it returns 0. // This method can be used to retrieve the HTTP status code associated with the error, diff --git a/pkg/publicapi/apimodels/agent.go b/pkg/publicapi/apimodels/agent.go index 4705a1b656..a4177bbb1b 100644 --- a/pkg/publicapi/apimodels/agent.go +++ b/pkg/publicapi/apimodels/agent.go @@ -5,7 +5,7 @@ import "github.com/bacalhau-project/bacalhau/pkg/models" // IsAliveResponse is the response to the IsAlive request. type IsAliveResponse struct { BaseGetResponse `json:",omitempty,inline" yaml:",omitempty,inline"` - Status string + Status string `json:"Status"` } func (r *IsAliveResponse) IsReady() bool { diff --git a/pkg/publicapi/apimodels/error.go b/pkg/publicapi/apimodels/error.go index 34ae3d67f2..588c7a6c49 100644 --- a/pkg/publicapi/apimodels/error.go +++ b/pkg/publicapi/apimodels/error.go @@ -8,7 +8,7 @@ import ( "net/http" ) -// apierror represents a standardized error response for the api. +// APIError represents a standardized error response for the api. // // it encapsulates: // - an http status code @@ -30,20 +30,20 @@ import ( type APIError struct { // httpstatuscode is the http status code associated with this error. // it should correspond to standard http status codes (e.g., 400, 404, 500). - HTTPStatusCode int `json:"-"` + HTTPStatusCode int `json:"Status"` // message is a short, human-readable description of the error. // it should be concise and provide a clear indication of what went wrong. - Message string `json:"message"` + Message string `json:"Message"` // RequestID is the request ID of the request that caused the error. - RequestID string `json:"-"` + RequestID string `json:"RequestID"` // Code is the error code of the error. - Code string `json:"code"` + Code string `json:"Code"` // Component is the component that caused the error. - Component string `json:"component"` + Component string `json:"Component"` } // NewAPIError creates a new APIError with the given HTTP status code and message. @@ -54,58 +54,11 @@ func NewAPIError(statusCode int, message string) *APIError { } } -// NewBadRequestError creates an APIError for Bad Request (400) errors. -func NewBadRequestError(message string) *APIError { - return NewAPIError(http.StatusBadRequest, message) -} - // NewUnauthorizedError creates an APIError for Unauthorized (401) errors. func NewUnauthorizedError(message string) *APIError { return NewAPIError(http.StatusUnauthorized, message) } -// NewForbiddenError creates an APIError for Forbidden (403) errors. -func NewForbiddenError(message string) *APIError { - return NewAPIError(http.StatusForbidden, message) -} - -// NewNotFoundError creates an APIError for Not Found (404) errors. -func NewNotFoundError(message string) *APIError { - return NewAPIError(http.StatusNotFound, message) -} - -// NewConflictError creates an APIError for Conflict (409) errors. -func NewConflictError(message string) *APIError { - return NewAPIError(http.StatusConflict, message) -} - -// NewInternalServerError creates an APIError for Internal Server Error (500) errors. -func NewInternalServerError(message string) *APIError { - return NewAPIError(http.StatusInternalServerError, message) -} - -func NewJobNotFound(jobID string) *APIError { - return NewAPIError(http.StatusNotFound, fmt.Sprintf("job id %s not found", jobID)) -} - -// IsNotFound checks if the error is an APIError with a Not Found status. -func IsNotFound(err error) bool { - apiErr, ok := err.(*APIError) - return ok && apiErr.HTTPStatusCode == http.StatusNotFound -} - -// IsBadRequest checks if the error is an APIError with a Bad Request status. -func IsBadRequest(err error) bool { - apiErr, ok := err.(*APIError) - return ok && apiErr.HTTPStatusCode == http.StatusBadRequest -} - -// IsInternalServerError checks if the error is an APIError with an Internal Server Error status. -func IsInternalServerError(err error) bool { - apiErr, ok := err.(*APIError) - return ok && apiErr.HTTPStatusCode == http.StatusInternalServerError -} - // Error implements the error interface, allowing APIError to be used as a standard Go error. func (e *APIError) Error() string { return e.Message diff --git a/pkg/publicapi/endpoint/agent/endpoint.go b/pkg/publicapi/endpoint/agent/endpoint.go index d4429d7687..e254edfb06 100644 --- a/pkg/publicapi/endpoint/agent/endpoint.go +++ b/pkg/publicapi/endpoint/agent/endpoint.go @@ -51,7 +51,7 @@ func NewEndpoint(params EndpointParams) *Endpoint { // @ID agent/alive // @Tags Ops // @Produce text/plain -// @Success 200 {string} string "OK" +// @Success 200 {object} apimodels.IsAliveResponse // @Router /api/v1/agent/alive [get] func (e *Endpoint) alive(c echo.Context) error { return c.JSON(http.StatusOK, &apimodels.IsAliveResponse{ diff --git a/pkg/publicapi/middleware/error_handler.go b/pkg/publicapi/middleware/error_handler.go index d32398ded1..fb16d4938b 100644 --- a/pkg/publicapi/middleware/error_handler.go +++ b/pkg/publicapi/middleware/error_handler.go @@ -3,18 +3,20 @@ package middleware import ( "net/http" - "github.com/bacalhau-project/bacalhau/pkg/models" - "github.com/bacalhau-project/bacalhau/pkg/publicapi/apimodels" "github.com/labstack/echo/v4" "github.com/rs/zerolog/log" + + "github.com/bacalhau-project/bacalhau/pkg/models" + "github.com/bacalhau-project/bacalhau/pkg/publicapi/apimodels" ) func CustomHTTPErrorHandler(err error, c echo.Context) { - - var code int - var message string - var errorCode string - var component string + var ( + code int + message string + errorCode string + component string + ) switch e := err.(type) { @@ -23,6 +25,7 @@ func CustomHTTPErrorHandler(err error, c echo.Context) { code = e.HTTPStatusCode() message = e.Error() errorCode = string(e.Code()) + component = e.Component() case *echo.HTTPError: // This is needed, in case any other middleware throws an error. In @@ -30,42 +33,47 @@ func CustomHTTPErrorHandler(err error, c echo.Context) { // One such example being when request body size is larger then the max // size accepted code = e.Code - message = e.Message.(string) + message, _ = e.Message.(string) errorCode = string(models.InternalError) component = "APIServer" + if c.Echo().Debug && e.Internal != nil { + message += ". " + e.Internal.Error() + } default: // In an ideal world this should never happen. We should always have are errors // from server as APIError. If output is this generic string, one should evaluate // and map it to APIError and send in appropriate message.= http.StatusInternalServerError - message = "internal server error" - code = c.Response().Status + code = http.StatusInternalServerError + message = "Internal server error" errorCode = string(models.InternalError) component = "Unknown" if c.Echo().Debug { - message = err.Error() + message += ". " + err.Error() } } - requestID := c.Request().Header.Get(echo.HeaderXRequestID) - // Don't override the status code if it is already been set. // This is something that is advised by ECHO framework. if !c.Response().Committed { + apiError := apimodels.APIError{ + HTTPStatusCode: code, + Message: message, + RequestID: c.Request().Header.Get(echo.HeaderXRequestID), + Code: errorCode, + Component: component, + } + var responseErr error if c.Request().Method == http.MethodHead { - err = c.NoContent(code) + responseErr = c.NoContent(code) } else { - err = c.JSON(code, apimodels.APIError{ - HTTPStatusCode: code, - Message: message, - RequestID: requestID, - Code: errorCode, - Component: component, - }) + responseErr = c.JSON(code, apiError) } - if err != nil { - log.Info().Msg("unable to send json response while handling error.") + if responseErr != nil { + log.Error().Err(responseErr). + Str("original_error", err.Error()). + Msg("Failed to send error response") } } diff --git a/pkg/publicapi/middleware/error_handler_test.go b/pkg/publicapi/middleware/error_handler_test.go new file mode 100644 index 0000000000..205942b7ca --- /dev/null +++ b/pkg/publicapi/middleware/error_handler_test.go @@ -0,0 +1,121 @@ +//go:build unit || !integration + +package middleware + +import ( + "encoding/json" + "errors" + "net/http" + "net/http/httptest" + "testing" + + "github.com/labstack/echo/v4" + "github.com/stretchr/testify/suite" + + "github.com/bacalhau-project/bacalhau/pkg/models" + "github.com/bacalhau-project/bacalhau/pkg/publicapi/apimodels" +) + +type CustomHTTPErrorHandlerTestSuite struct { + suite.Suite + echo *echo.Echo +} + +func (suite *CustomHTTPErrorHandlerTestSuite) SetupTest() { + suite.echo = echo.New() + suite.echo.HTTPErrorHandler = CustomHTTPErrorHandler +} + +func (suite *CustomHTTPErrorHandlerTestSuite) TestBaseError() { + req := httptest.NewRequest(http.MethodGet, "/", nil) + rec := httptest.NewRecorder() + c := suite.echo.NewContext(req, rec) + + err := models.NewBaseError("test base error"). + WithHTTPStatusCode(http.StatusBadRequest). + WithCode("TEST_ERROR"). + WithComponent("TEST_COMPONENT") + CustomHTTPErrorHandler(err, c) + + suite.Equal(http.StatusBadRequest, rec.Result().StatusCode) + + var apiError apimodels.APIError + suite.Require().NoError(json.NewDecoder(rec.Body).Decode(&apiError)) + + suite.Equal("test base error", apiError.Message) + suite.Equal("TEST_ERROR", apiError.Code) + suite.Equal("TEST_COMPONENT", apiError.Component) +} + +func (suite *CustomHTTPErrorHandlerTestSuite) TestEchoHTTPError() { + req := httptest.NewRequest(http.MethodGet, "/", nil) + rec := httptest.NewRecorder() + c := suite.echo.NewContext(req, rec) + + err := echo.NewHTTPError(http.StatusUnauthorized, "unauthorized access") + + CustomHTTPErrorHandler(err, c) + + suite.Equal(http.StatusUnauthorized, rec.Result().StatusCode) + + var apiError apimodels.APIError + suite.Require().NoError(json.NewDecoder(rec.Body).Decode(&apiError)) + + suite.Equal("unauthorized access", apiError.Message) + suite.Equal(string(models.InternalError), apiError.Code) + suite.Equal("APIServer", apiError.Component) +} + +func (suite *CustomHTTPErrorHandlerTestSuite) TestDefaultError() { + req := httptest.NewRequest(http.MethodGet, "/", nil) + rec := httptest.NewRecorder() + c := suite.echo.NewContext(req, rec) + + err := errors.New("unknown error") + + CustomHTTPErrorHandler(err, c) + + suite.Equal(http.StatusInternalServerError, rec.Result().StatusCode) + + var apiError apimodels.APIError + suite.Require().NoError(json.NewDecoder(rec.Body).Decode(&apiError)) + + suite.Equal("Internal server error", apiError.Message) + suite.Equal(string(models.InternalError), apiError.Code) + suite.Equal("Unknown", apiError.Component) +} + +func (suite *CustomHTTPErrorHandlerTestSuite) TestHeadRequest() { + req := httptest.NewRequest(http.MethodHead, "/", nil) + rec := httptest.NewRecorder() + c := suite.echo.NewContext(req, rec) + + err := errors.New("test error") + + CustomHTTPErrorHandler(err, c) + + suite.Equal(http.StatusInternalServerError, rec.Result().StatusCode) + suite.Empty(rec.Body.String()) +} + +func (suite *CustomHTTPErrorHandlerTestSuite) TestRequestIDPropagation() { + req := httptest.NewRequest(http.MethodGet, "/", nil) + req.Header.Set(echo.HeaderXRequestID, "test-request-id") + rec := httptest.NewRecorder() + c := suite.echo.NewContext(req, rec) + + err := errors.New("test error") + + CustomHTTPErrorHandler(err, c) + + suite.Equal(http.StatusInternalServerError, rec.Result().StatusCode) + + var apiError apimodels.APIError + suite.Require().NoError(json.NewDecoder(rec.Body).Decode(&apiError)) + + suite.Equal("test-request-id", apiError.RequestID) +} + +func TestCustomHTTPErrorHandlerTestSuite(t *testing.T) { + suite.Run(t, new(CustomHTTPErrorHandlerTestSuite)) +} diff --git a/pkg/swagger/docs.go b/pkg/swagger/docs.go index c63a29f29d..07a875e009 100644 --- a/pkg/swagger/docs.go +++ b/pkg/swagger/docs.go @@ -55,7 +55,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "type": "string" + "$ref": "#/definitions/apimodels.IsAliveResponse" } } } @@ -1049,6 +1049,14 @@ const docTemplate = `{ } } }, + "apimodels.IsAliveResponse": { + "type": "object", + "properties": { + "Status": { + "type": "string" + } + } + }, "apimodels.ListJobExecutionsResponse": { "type": "object", "properties": { diff --git a/pkg/swagger/swagger.json b/pkg/swagger/swagger.json index 75e92c6fca..968c355b00 100644 --- a/pkg/swagger/swagger.json +++ b/pkg/swagger/swagger.json @@ -51,7 +51,7 @@ "200": { "description": "OK", "schema": { - "type": "string" + "$ref": "#/definitions/apimodels.IsAliveResponse" } } } @@ -1045,6 +1045,14 @@ } } }, + "apimodels.IsAliveResponse": { + "type": "object", + "properties": { + "Status": { + "type": "string" + } + } + }, "apimodels.ListJobExecutionsResponse": { "type": "object", "properties": { diff --git a/webui/app/layout.tsx b/webui/app/layout.tsx index f3c6cb50a4..283e1bd35e 100644 --- a/webui/app/layout.tsx +++ b/webui/app/layout.tsx @@ -5,6 +5,7 @@ import { ApiProvider, ThemeProvider } from './providers' import { Sidebar } from '@/components/layout/Sidebar' import { Header } from '@/components/layout/Header' import './globals.css' +import { ConnectionStatus } from '@/components/ConnectionStatus' const font = Open_Sans({ subsets: ['latin'] }) @@ -34,6 +35,7 @@ export default function RootLayout({
{children} +
diff --git a/webui/app/providers/ApiProvider.tsx b/webui/app/providers/ApiProvider.tsx index 6cfee5752d..56c82367a9 100644 --- a/webui/app/providers/ApiProvider.tsx +++ b/webui/app/providers/ApiProvider.tsx @@ -7,15 +7,24 @@ import { useState, useEffect, } from 'react' -import { useApiInitialization } from '@/lib/api' +import { useApiInitialization, useApiUrl } from '@/lib/api' -const ApiContext = createContext({ isInitialized: false }) +interface ApiContextType { + isInitialized: boolean + apiUrl: string | null +} + +const ApiContext = createContext({ + isInitialized: false, + apiUrl: null, +}) export function ApiProvider({ children }: { children: ReactNode }) { const isInitialized = useApiInitialization() + const apiUrl = useApiUrl() return ( - + {children} ) diff --git a/webui/components/ConnectionStatus.tsx b/webui/components/ConnectionStatus.tsx new file mode 100644 index 0000000000..9ffd800b4d --- /dev/null +++ b/webui/components/ConnectionStatus.tsx @@ -0,0 +1,11 @@ +import { ConnectionStatusIndicator } from './ConnectionStatusIndicator' +import { Toaster } from '@/components/ui/toaster' + +export function ConnectionStatus() { + return ( + <> + + + + ) +} diff --git a/webui/components/ConnectionStatusIndicator.tsx b/webui/components/ConnectionStatusIndicator.tsx new file mode 100644 index 0000000000..4aa0a98808 --- /dev/null +++ b/webui/components/ConnectionStatusIndicator.tsx @@ -0,0 +1,94 @@ +'use client' + +import React, { useEffect, useState } from 'react' +import { Wifi, WifiOff } from 'lucide-react' +import { useToast } from '@/hooks/use-toast' +import { useConnectionMonitor } from '@/hooks/useConnectionMonitor' +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from '@/components/ui/tooltip' + +export function ConnectionStatusIndicator() { + const { isOnline, clientUrl } = useConnectionMonitor() + const { toast } = useToast() + const [prevOnlineState, setPrevOnlineState] = useState( + undefined + ) + + useEffect(() => { + if (isOnline === undefined) return + + if (!isOnline && prevOnlineState !== false) { + // Connection lost + toast({ + variant: 'destructive', + title: 'Connection Lost', + description: `You are currently offline. Please check your connection to ${clientUrl}.`, + duration: Infinity, + }) + } else if (isOnline && prevOnlineState === false) { + // Reconnected + toast({ + className: 'group border-green-500 bg-green-500 text-white', + title: 'Connected', + description: 'Your connection has been re-established.', + duration: 3000, + style: { color: 'white' }, + }) + } + + setPrevOnlineState(isOnline) + }, [isOnline, prevOnlineState, toast, clientUrl]) + + const getIconColor = () => { + if (isOnline === undefined) return 'text-gray-500' + return isOnline ? 'text-green-500' : 'text-red-500' + } + + const tooltipContent = + isOnline === undefined + ? 'Checking connection...' + : `${isOnline ? 'Connected to' : 'Failed to connect to'} ${clientUrl}` + + return ( + <> + + + + +
+ {isOnline === undefined ? ( +
+ +
+ ) : isOnline ? ( + + ) : ( + + )} +
+
+ +

{tooltipContent}

+
+
+
+ + ) +} diff --git a/webui/components/ErrorDisplay.tsx b/webui/components/ErrorDisplay.tsx new file mode 100644 index 0000000000..4434bfd7a5 --- /dev/null +++ b/webui/components/ErrorDisplay.tsx @@ -0,0 +1,37 @@ +import React from 'react' +import { AlertCircle } from 'lucide-react' +import { Alert, AlertTitle, AlertDescription } from '@/components/ui/alert' +import { ApiError } from '@/lib/api/errors' + +interface ErrorDisplayProps { + error: ApiError +} + +export const ErrorDisplay: React.FC = ({ error }) => ( + + + + Error {error.Status} + + +
+

{error.Message}

+ {error.Code && ( +

+ Error Code: {error.Code} +

+ )} + {error.Component && ( +

+ Component: {error.Component} +

+ )} + {error.RequestId && ( +

+ Request ID: {error.RequestId} +

+ )} +
+
+
+) diff --git a/webui/components/jobs/details/JobActions.tsx b/webui/components/jobs/details/JobActions.tsx index 47bf162437..e9897db79d 100644 --- a/webui/components/jobs/details/JobActions.tsx +++ b/webui/components/jobs/details/JobActions.tsx @@ -2,8 +2,7 @@ import React, { useState } from 'react' import { Button } from '@/components/ui/button' import { StopCircle } from 'lucide-react' import { isTerminalJobState } from '@/lib/api/utils' -import { models_Job } from '@/lib/api/generated' -import { OrchestratorService } from '@/lib/api/generated/services/OrchestratorService' +import { Orchestrator, models_Job } from '@/lib/api/generated' import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert' import { AlertDialog, @@ -28,17 +27,25 @@ const JobActions = ({ const [stopJobError, setStopJobError] = useState(null) if (job.ID === undefined) { - return null + return ( + + Error + + Job ID is undefined. Cannot perform actions. + + + ) } const handleStopJob = async () => { setIsStoppingJob(true) setStopJobError(null) try { - await OrchestratorService.orchestratorStopJob( - job.ID!, - 'User requested stop' - ) + await Orchestrator.stopJob({ + path: { id: job.ID! }, + query: { reason: 'User requested stop' }, + throwOnError: true, + }) onJobUpdated() // Trigger re-render of parent component } catch (error) { console.error('Error stopping job:', error) diff --git a/webui/components/jobs/details/JobDetails.tsx b/webui/components/jobs/details/JobDetails.tsx index 3e0465131e..2912ae9a6d 100644 --- a/webui/components/jobs/details/JobDetails.tsx +++ b/webui/components/jobs/details/JobDetails.tsx @@ -1,51 +1,40 @@ 'use client' -import React, { useState, useEffect, useCallback } from 'react' -import { - OrchestratorService, - apimodels_GetJobResponse, -} from '@/lib/api/generated' -import { useApi } from '@/app/providers/ApiProvider' +import React, { useEffect, useCallback } from 'react' +import { Orchestrator, apimodels_GetJobResponse } from '@/lib/api/generated' import { JobInformation } from './JobInformation' import JobActions from './JobActions' import JobTabs from './JobTabs' +import { useApiOperation } from '@/hooks/useApiOperation' +import { ErrorDisplay } from '@/components/ErrorDisplay' +import { Skeleton } from '@/components/ui/skeleton' const JobDetails = ({ jobId }: { jobId: string }) => { - const [jobData, setJobData] = useState(null) - const [isLoading, setIsLoading] = useState(true) - const [error, setError] = useState(null) - const { isInitialized } = useApi() + const { + data: jobData, + isLoading, + error, + execute, + } = useApiOperation() - const fetchJobData = useCallback(async () => { - if (!isInitialized) return - - setIsLoading(true) - setError(null) - try { - const response = await OrchestratorService.orchestratorGetJob( - jobId, - 'history,executions', - undefined // limit - ) - setJobData(response) - } catch (error) { - console.error('Error fetching job data:', error) - setError('Failed to fetch job data. Please try again.') - } finally { - setIsLoading(false) - } - }, [isInitialized, jobId]) + const fetchJobData = useCallback(() => { + execute(() => + Orchestrator.getJob({ + path: { id: jobId }, + query: { + include: 'history,executions', + }, + throwOnError: true, + }).then((response) => response.data) + ) + }, [execute, jobId]) useEffect(() => { fetchJobData() }, [fetchJobData]) - const handleJobUpdated = () => { - fetchJobData() - } - - if (isLoading) return
Loading...
- if (error) return
{error}
- if (!jobData || !jobData.Job) return
Job not found.
+ if (isLoading) return + if (error) return + if (!jobData || !jobData.Job) return const { Job, History, Executions } = jobData @@ -53,7 +42,7 @@ const JobDetails = ({ jobId }: { jobId: string }) => {

{Job.Name}

- +
@@ -61,4 +50,16 @@ const JobDetails = ({ jobId }: { jobId: string }) => { ) } +const JobDetailsSkeleton = () => ( +
+
+ + +
+ + + +
+) + export default JobDetails diff --git a/webui/components/jobs/details/JobExecutions.tsx b/webui/components/jobs/details/JobExecutions.tsx index 1aff85fffd..60c761ed16 100644 --- a/webui/components/jobs/details/JobExecutions.tsx +++ b/webui/components/jobs/details/JobExecutions.tsx @@ -10,12 +10,11 @@ import { } from '@/components/ui/table' import { apimodels_ListJobExecutionsResponse } from '@/lib/api/generated' import { - formatTimestamp, getExecutionDesiredStateLabel, getExecutionStateLabel, - getJobStateLabel, shortID, } from '@/lib/api/utils' +import { formatTimestamp } from '@/lib/time' const JobExecutions = ({ executions, diff --git a/webui/components/jobs/details/JobHistory.tsx b/webui/components/jobs/details/JobHistory.tsx index 3154b61f8c..8428b02340 100644 --- a/webui/components/jobs/details/JobHistory.tsx +++ b/webui/components/jobs/details/JobHistory.tsx @@ -13,7 +13,8 @@ import { Switch } from '@/components/ui/switch' import { Button } from '@/components/ui/button' import { Filter, X } from 'lucide-react' import { apimodels_ListJobHistoryResponse } from '@/lib/api/generated' -import { shortID, formatTime } from '@/lib/api/utils' +import { shortID } from '@/lib/api/utils' +import { formatTime } from '@/lib/time' const colors = [ 'text-blue-800', diff --git a/webui/components/jobs/details/JobInformation.tsx b/webui/components/jobs/details/JobInformation.tsx index 3b514ae9d2..f451216f36 100644 --- a/webui/components/jobs/details/JobInformation.tsx +++ b/webui/components/jobs/details/JobInformation.tsx @@ -1,12 +1,12 @@ import React from 'react' -import { Card, CardHeader, CardContent, CardTitle } from '@/components/ui/card' -import { Badge } from '@/components/ui/badge' +import { Card, CardContent } from '@/components/ui/card' import { models_Job } from '@/lib/api/generated' -import { formatTimestamp, getJobRunTime } from '@/lib/api/utils' +import { getJobRunTime } from '@/lib/api/utils' import JobStatusBadge from '@/components/jobs/JobStatusBadge' import JobEngineDisplay from '@/components/jobs/JobEngine' import Labels from '@/components/Labels' import InfoItem from '@/components/InfoItem' +import { formatTimestamp } from '@/lib/time' interface JobInformationProps { job: models_Job diff --git a/webui/components/jobs/details/JobLogs.tsx b/webui/components/jobs/details/JobLogs.tsx index fc3a23b8c3..d86f9b3830 100644 --- a/webui/components/jobs/details/JobLogs.tsx +++ b/webui/components/jobs/details/JobLogs.tsx @@ -9,7 +9,7 @@ import { CheckCircle, } from 'lucide-react' import { useApi } from '@/app/providers/ApiProvider' -import { OpenAPI } from '@/lib/api' +import { client } from '@/lib/api/generated' interface LogEntry { type: number @@ -43,7 +43,15 @@ const JobLogs = ({ jobId }: { jobId: string | undefined }) => { setError(null) setIsStreamEnded(false) - const wsUrl = `${OpenAPI.BASE.replace(/^http/, 'ws')}/api/v1/orchestrator/jobs/${jobId}/logs?follow=true` + const baseUrl = client.getConfig().baseUrl + if (!baseUrl) { + console.error('Base URL is not set') + setError( + 'Failed to connect to log stream. Client not configured properly.' + ) + return + } + const wsUrl = `${baseUrl.replace(/^http/, 'ws')}/api/v1/orchestrator/jobs/${jobId}/logs?follow=true` console.log('Attempting to connect to:', wsUrl) const ws = new WebSocket(wsUrl) diff --git a/webui/components/jobs/list/JobsOverview.tsx b/webui/components/jobs/list/JobsOverview.tsx index c85de76074..cd7f8aa88b 100644 --- a/webui/components/jobs/list/JobsOverview.tsx +++ b/webui/components/jobs/list/JobsOverview.tsx @@ -4,7 +4,7 @@ import React, { useState, useEffect, useCallback } from 'react' import { JobsTable } from './JobsTable' import { Input } from '@/components/ui/input' import { Button } from '@/components/ui/button' -import { models_Job, OrchestratorService } from '@/lib/api/generated' +import { Orchestrator, models_Job } from '@/lib/api/generated' import { useApi } from '@/app/providers/ApiProvider' import { useRefreshContent } from '@/hooks/useRefreshContent' import { RefreshCw, Plus } from 'lucide-react' @@ -15,27 +15,30 @@ export function JobsOverview() { const { isInitialized } = useApi() const [pageSize, setPageSize] = useState(10) const [pageIndex, setPageIndex] = useState(0) - const [nextToken, setNextToken] = useState(undefined) + const [tokens, setTokens] = useState<(string | undefined)[]>([undefined]) const [isRefreshDisabled, setIsRefreshDisabled] = useState(false) const fetchJobs = useCallback(async () => { if (!isInitialized) return try { - const response = await OrchestratorService.orchestratorListJobs( - undefined, // namespace - pageSize, - pageIndex === 0 ? undefined : nextToken, - true, // reverse - undefined // orderBy - ) - setJobs(response.Items ?? []) - setNextToken(response.NextToken) + const response = await Orchestrator.listJobs({ + query: { + limit: pageSize, + next_token: tokens[pageIndex], + reverse: true, + }, + throwOnError: true, + }) + setJobs(response.data.Items ?? []) + if (response.data.NextToken && pageIndex === tokens.length - 1) { + setTokens([...tokens, response.data.NextToken]) + } } catch (error) { console.error('Error fetching jobs:', error) setJobs([]) } - }, [isInitialized, pageSize, pageIndex, nextToken]) + }, [isInitialized, pageSize, pageIndex, tokens]) useEffect(() => { fetchJobs() @@ -44,7 +47,7 @@ export function JobsOverview() { const handleRefresh = useCallback(() => { setIsRefreshDisabled(true) setPageIndex(0) - setNextToken(undefined) + setTokens([undefined]) fetchJobs().then(() => { // Re-enable the refresh button after a short delay setTimeout(() => setIsRefreshDisabled(false), 1000) @@ -67,7 +70,7 @@ export function JobsOverview() { } const handleNextPage = () => { - if (nextToken) { + if (pageIndex < tokens.length - 1) { setPageIndex(pageIndex + 1) } } @@ -75,7 +78,7 @@ export function JobsOverview() { const handlePageSizeChange = (newSize: number) => { setPageSize(newSize) setPageIndex(0) - setNextToken(undefined) + setTokens([undefined]) } return ( @@ -113,7 +116,7 @@ export function JobsOverview() { pageIndex={pageIndex} onPreviousPage={handlePreviousPage} onNextPage={handleNextPage} - hasNextPage={!!nextToken} + hasNextPage={pageIndex < tokens.length - 1} />
) diff --git a/webui/components/jobs/list/JobsTable.tsx b/webui/components/jobs/list/JobsTable.tsx index c1e6ae79bd..b633ab6522 100644 --- a/webui/components/jobs/list/JobsTable.tsx +++ b/webui/components/jobs/list/JobsTable.tsx @@ -10,7 +10,7 @@ import { } from '@/components/ui/table' import TruncatedTextWithTooltip from '@/components/TruncatedTextWithTooltip' import JobStatusBadge from '@/components/jobs/JobStatusBadge' -import { formatTimestamp, getJobRunTime } from '@/lib/api/utils' +import { getJobRunTime } from '@/lib/api/utils' import JobEngineDisplay from '@/components/jobs/JobEngine' import { Button } from '@/components/ui/button' import { @@ -20,6 +20,7 @@ import { SelectTrigger, SelectValue, } from '@/components/ui/select' +import { formatTimestamp } from '@/lib/time' interface JobsTableProps { jobs: models_Job[] diff --git a/webui/components/nodes/NodeStatus.tsx b/webui/components/nodes/NodeStatus.tsx index 55c68c6ef3..edd15989fc 100644 --- a/webui/components/nodes/NodeStatus.tsx +++ b/webui/components/nodes/NodeStatus.tsx @@ -1,9 +1,6 @@ import React from 'react' import { Badge } from '@/components/ui/badge' -import { - models_NodeState, - models_NodeMembershipState, -} from '@/lib/api/generated' +import { models_NodeState } from '@/lib/api/generated' import { getNodeConnectionStatus, getNodeMembershipStatus, diff --git a/webui/components/nodes/details/NodeActions.tsx b/webui/components/nodes/details/NodeActions.tsx index eca37f5a5d..ed53f5bdc4 100644 --- a/webui/components/nodes/details/NodeActions.tsx +++ b/webui/components/nodes/details/NodeActions.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { models_NodeState, OrchestratorService } from '@/lib/api/generated' +import { models_NodeState, Orchestrator } from '@/lib/api/generated' import { Button } from '@/components/ui/button' import { useToast } from '@/hooks/use-toast' @@ -11,54 +11,35 @@ interface NodeActionsProps { const NodeActions: React.FC = ({ node, onNodeUpdated }) => { const { toast } = useToast() - const handleApprove = async () => { - try { - await OrchestratorService.orchestratorUpdateNode( - node.Info?.NodeID ?? '', - { - Action: 'approve', - NodeID: node.Info?.NodeID, - } - ) - toast({ - title: 'Node Approved', - description: `Node ${node.Info?.NodeID} has been approved.`, - }) - onNodeUpdated() - } catch (error) { - console.error('Error approving node:', error) - toast({ - title: 'Error', - description: 'Failed to approve the node. Please try again.', - variant: 'destructive', - }) - } - } - const handleReject = async () => { + const handleUpdateNode = async (action: 'approve' | 'reject') => { try { - await OrchestratorService.orchestratorUpdateNode( - node.Info?.NodeID ?? '', - { - Action: 'reject', + await Orchestrator.updateNode({ + path: { id: node.Info?.NodeID ?? '' }, + body: { + Action: action, NodeID: node.Info?.NodeID, - } - ) + }, + throwOnError: true, + }) toast({ - title: 'Node Rejected', - description: `Node ${node.Info?.NodeID} has been rejected.`, + title: `Node ${action === 'approve' ? 'Approved' : 'Rejected'}`, + description: `Node ${node.Info?.NodeID} has been ${action === 'approve' ? 'approved' : 'rejected'}.`, }) onNodeUpdated() } catch (error) { - console.error('Error rejecting node:', error) + console.error(`Error ${action}ing node:`, error) toast({ title: 'Error', - description: 'Failed to reject the node. Please try again.', + description: `Failed to ${action} the node. Please try again.`, variant: 'destructive', }) } } + const handleApprove = () => handleUpdateNode('approve') + const handleReject = () => handleUpdateNode('reject') + return (
{node.Membership?.membership !== 2 && ( diff --git a/webui/components/nodes/details/NodeDetails.tsx b/webui/components/nodes/details/NodeDetails.tsx index 0e8e8cf2ff..4c8d802057 100644 --- a/webui/components/nodes/details/NodeDetails.tsx +++ b/webui/components/nodes/details/NodeDetails.tsx @@ -1,52 +1,42 @@ -import React, { useState, useEffect, useCallback } from 'react' +import React, { useEffect, useCallback } from 'react' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' -import { Alert } from '@/components/ui/alert' import { Skeleton } from '@/components/ui/skeleton' -import { OrchestratorService, models_NodeState } from '@/lib/api/generated' -import { useApi } from '@/app/providers/ApiProvider' +import { Orchestrator, models_NodeState } from '@/lib/api/generated' import NodeInformation from './NodeInformation' import NodeInspect from './NodeInspect' -import NodeActions from './NodeActions' +import { useApiOperation } from '@/hooks/useApiOperation' +import { ErrorDisplay } from '@/components/ErrorDisplay' const NodeDetails = ({ nodeId }: { nodeId: string }) => { - const [nodeData, setNodeData] = useState(null) - const [isLoading, setIsLoading] = useState(true) - const [error, setError] = useState(null) - const { isInitialized } = useApi() + const { + data: nodeData, + isLoading, + error, + execute, + } = useApiOperation() - const fetchNodeData = useCallback(async () => { - if (!isInitialized) return - - setIsLoading(true) - setError(null) - try { - const response = await OrchestratorService.orchestratorGetNode(nodeId) - setNodeData(response.Node!) - } catch (error) { - console.error('Error fetching node data:', error) - setError('Failed to fetch node data. Please try again.') - } finally { - setIsLoading(false) - } - }, [isInitialized, nodeId]) + const fetchNodeData = useCallback(() => { + execute(() => + Orchestrator.getNode({ + path: { id: nodeId }, + throwOnError: true, + }).then((response) => response.data.Node!) + ) + }, [execute, nodeId]) useEffect(() => { fetchNodeData() }, [fetchNodeData]) - const handleNodeUpdated = () => { - fetchNodeData() - } - if (isLoading) return - if (error) return {error} - if (!nodeData) return Node not found. + if (error) return + if (!nodeData) return return (

{nodeData.Info?.NodeID}

- {/**/} + {/**/}
diff --git a/webui/components/nodes/details/NodeInspect.tsx b/webui/components/nodes/details/NodeInspect.tsx index 393909c801..a5f1ad2fbb 100644 --- a/webui/components/nodes/details/NodeInspect.tsx +++ b/webui/components/nodes/details/NodeInspect.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' +import { Card, CardContent } from '@/components/ui/card' import { models_NodeState } from '@/lib/api/generated' import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter' import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism' diff --git a/webui/components/nodes/list/NodesOverview.tsx b/webui/components/nodes/list/NodesOverview.tsx index 1fdf215bec..e7f9f93e40 100644 --- a/webui/components/nodes/list/NodesOverview.tsx +++ b/webui/components/nodes/list/NodesOverview.tsx @@ -4,7 +4,7 @@ import React, { useState, useEffect, useCallback } from 'react' import { NodesTable } from './NodesTable' import { Input } from '@/components/ui/input' import { Button } from '@/components/ui/button' -import { models_NodeState, OrchestratorService } from '@/lib/api/generated' +import { Orchestrator, models_NodeState } from '@/lib/api/generated' import { useApi } from '@/app/providers/ApiProvider' import { useRefreshContent } from '@/hooks/useRefreshContent' import { RefreshCw } from 'lucide-react' @@ -22,16 +22,17 @@ export function NodesOverview() { if (!isInitialized) return try { - const response = await OrchestratorService.orchestratorListNodes( - pageSize, - pageIndex === 0 ? undefined : nextToken, - true, // reverse - undefined, // orderBy - undefined, // filterApproval - undefined // filterStatus - ) - setNodes(response.Nodes ?? []) - setNextToken(response.NextToken) + const response = await Orchestrator.listNodes({ + query: { + limit: pageSize, + next_token: pageIndex === 0 ? undefined : nextToken, + reverse: true, + }, + throwOnError: true, + }) + + setNodes(response.data.Nodes ?? []) + setNextToken(response.data.NextToken) } catch (error) { console.error('Error fetching nodes:', error) setNodes([]) diff --git a/webui/hooks/useApiOperation.ts b/webui/hooks/useApiOperation.ts new file mode 100644 index 0000000000..cc0eaad675 --- /dev/null +++ b/webui/hooks/useApiOperation.ts @@ -0,0 +1,32 @@ +import { useState, useCallback } from 'react' +import { ApiError, handleApiError } from '@/lib/api/errors' +import { useApi } from '@/app/providers/ApiProvider' + +export function useApiOperation() { + const [data, setData] = useState(null) + const [isLoading, setIsLoading] = useState(false) + const [error, setError] = useState(null) + const { isInitialized } = useApi() + + const execute = useCallback( + async (apiCall: () => Promise) => { + if (!isInitialized) return + + setIsLoading(true) + setError(null) + try { + const result = await apiCall() + setData(result) + return result + } catch (error) { + const apiError = handleApiError(error) + setError(apiError) + } finally { + setIsLoading(false) + } + }, + [isInitialized] + ) + + return { data, isLoading, error, execute } +} diff --git a/webui/hooks/useConnectionMonitor.tsx b/webui/hooks/useConnectionMonitor.tsx new file mode 100644 index 0000000000..d7702d7487 --- /dev/null +++ b/webui/hooks/useConnectionMonitor.tsx @@ -0,0 +1,39 @@ +'use client' + +import { useState, useEffect, useCallback } from 'react' +import { useApi } from '@/app/providers/ApiProvider' +import { Ops } from '@/lib/api/generated' + +export const useConnectionMonitor = (checkInterval = 5000) => { + const { isInitialized, apiUrl } = useApi() + const [isOnline, setIsOnline] = useState(undefined) + const [error, setError] = useState(null) + + const checkConnection = useCallback(async () => { + if (!isInitialized) { + setIsOnline(undefined) + setError('API not initialized') + return + } + try { + const response = await Ops.agentAlive({ throwOnError: true }) + if (response.data.Status === 'OK') { + setIsOnline(true) + setError(null) + } else { + throw new Error('Unexpected response from agent') + } + } catch (err) { + setIsOnline(false) + setError(err instanceof Error ? err.message : 'An unknown error occurred') + } + }, [isInitialized]) + + useEffect(() => { + checkConnection() // Immediate check on mount + const intervalId = setInterval(checkConnection, checkInterval) + return () => clearInterval(intervalId) + }, [checkConnection, checkInterval]) + + return { isOnline, checkConnection, clientUrl: apiUrl, error } +} diff --git a/webui/lib/api/errors.ts b/webui/lib/api/errors.ts new file mode 100644 index 0000000000..d3083650ae --- /dev/null +++ b/webui/lib/api/errors.ts @@ -0,0 +1,68 @@ +import { toast } from '@/hooks/use-toast' + +export interface ApiError { + Status: number + Message: string + RequestId?: string + Code?: string + Component?: string +} + +export function handleApiError(error: unknown): ApiError { + if (error instanceof Error) { + try { + const parsedError = JSON.parse(error.message) + return { + Status: parsedError.Status, + Message: parsedError.Message || 'An unexpected error occurred', + RequestId: parsedError.RequestId, + Code: parsedError.Code, + Component: parsedError.Component, + } + } catch (parseError) { + // If parsing fails, it's not a JSON string + return { + Status: 500, + Message: error.message, + } + } + } + + // Fallback for unexpected error structures + return { + Status: 500, + Message: 'An unexpected error occurred: ' + String(error), + } +} + +export function displayApiError(error: ApiError) { + let description = error.Message + if (error.Code) { + description += `\nError Code: ${error.Code}` + } + if (error.Component) { + description += `\nComponent: ${error.Component}` + } + if (error.RequestId) { + description += `\nRequest ID: ${error.RequestId}` + } + + toast({ + variant: 'destructive', + title: `Error ${error.Status}`, + description: description, + duration: 7000, + }) +} + +export function isNotFound(error: ApiError): boolean { + return error.Status === 404 || error.Code === 'NotFound' +} + +export function isBadRequest(error: ApiError): boolean { + return error.Status === 400 || error.Code === 'BadRequest' +} + +export function isInternalServerError(error: ApiError): boolean { + return error.Status === 500 +} diff --git a/webui/lib/api/generated/core/ApiError.ts b/webui/lib/api/generated/core/ApiError.ts deleted file mode 100644 index ec7b16af6f..0000000000 --- a/webui/lib/api/generated/core/ApiError.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: any; - public readonly request: ApiRequestOptions; - - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} diff --git a/webui/lib/api/generated/core/ApiRequestOptions.ts b/webui/lib/api/generated/core/ApiRequestOptions.ts deleted file mode 100644 index 93143c3ce1..0000000000 --- a/webui/lib/api/generated/core/ApiRequestOptions.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiRequestOptions = { - readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; - readonly url: string; - readonly path?: Record; - readonly cookies?: Record; - readonly headers?: Record; - readonly query?: Record; - readonly formData?: Record; - readonly body?: any; - readonly mediaType?: string; - readonly responseHeader?: string; - readonly errors?: Record; -}; diff --git a/webui/lib/api/generated/core/ApiResult.ts b/webui/lib/api/generated/core/ApiResult.ts deleted file mode 100644 index ee1126e2cc..0000000000 --- a/webui/lib/api/generated/core/ApiResult.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiResult = { - readonly url: string; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly body: any; -}; diff --git a/webui/lib/api/generated/core/CancelablePromise.ts b/webui/lib/api/generated/core/CancelablePromise.ts deleted file mode 100644 index d813feca75..0000000000 --- a/webui/lib/api/generated/core/CancelablePromise.ts +++ /dev/null @@ -1,140 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export class CancelError extends Error { - - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - // Manually added - // ref: https://github.com/ferdikoomen/openapi-typescript-codegen/issues/1992 - // @ts-ignore - #isResolved: boolean; - // @ts-ignore - #isRejected: boolean; - // @ts-ignore - #isCancelled: boolean; - // @ts-ignore - readonly #cancelHandlers: (() => void)[]; - // @ts-ignore - readonly #promise: Promise; - // @ts-ignore - #resolve?: (value: T | PromiseLike) => void; - // @ts-ignore - #reject?: (reason?: any) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, - onCancel: OnCancel - ) => void - ) { - this.#isResolved = false; - this.#isRejected = false; - this.#isCancelled = false; - this.#cancelHandlers = []; - this.#promise = new Promise((resolve, reject) => { - this.#resolve = resolve; - this.#reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isResolved = true; - if (this.#resolve) this.#resolve(value); - }; - - const onReject = (reason?: any): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isRejected = true; - if (this.#reject) this.#reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this.#isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this.#isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this.#isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: any) => TResult2 | PromiseLike) | null - ): Promise { - return this.#promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: any) => TResult | PromiseLike) | null - ): Promise { - return this.#promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.#promise.finally(onFinally); - } - - public cancel(): void { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isCancelled = true; - if (this.#cancelHandlers.length) { - try { - for (const cancelHandler of this.#cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.#cancelHandlers.length = 0; - if (this.#reject) this.#reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this.#isCancelled; - } -} diff --git a/webui/lib/api/generated/core/OpenAPI.ts b/webui/lib/api/generated/core/OpenAPI.ts deleted file mode 100644 index 7a89eed24e..0000000000 --- a/webui/lib/api/generated/core/OpenAPI.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions'; - -type Resolver = (options: ApiRequestOptions) => Promise; -type Headers = Record; - -export type OpenAPIConfig = { - BASE: string; - VERSION: string; - WITH_CREDENTIALS: boolean; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - HEADERS?: Headers | Resolver | undefined; - ENCODE_PATH?: ((path: string) => string) | undefined; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: 'http://localhost:1234', - VERSION: '1.0', - WITH_CREDENTIALS: false, - CREDENTIALS: 'include', - TOKEN: undefined, - USERNAME: undefined, - PASSWORD: undefined, - HEADERS: undefined, - ENCODE_PATH: undefined, -}; diff --git a/webui/lib/api/generated/core/request.ts b/webui/lib/api/generated/core/request.ts deleted file mode 100644 index 1dc6fef4aa..0000000000 --- a/webui/lib/api/generated/core/request.ts +++ /dev/null @@ -1,323 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import axios from 'axios'; -import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios'; -import FormData from 'form-data'; - -import { ApiError } from './ApiError'; -import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { ApiResult } from './ApiResult'; -import { CancelablePromise } from './CancelablePromise'; -import type { OnCancel } from './CancelablePromise'; -import type { OpenAPIConfig } from './OpenAPI'; - -export const isDefined = (value: T | null | undefined): value is Exclude => { - return value !== undefined && value !== null; -}; - -export const isString = (value: any): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: any): value is string => { - return isString(value) && value !== ''; -}; - -export const isBlob = (value: any): value is Blob => { - return ( - typeof value === 'object' && - typeof value.type === 'string' && - typeof value.stream === 'function' && - typeof value.arrayBuffer === 'function' && - typeof value.constructor === 'function' && - typeof value.constructor.name === 'string' && - /^(Blob|File)$/.test(value.constructor.name) && - /^(Blob|File)$/.test(value[Symbol.toStringTag]) - ); -}; - -export const isFormData = (value: any): value is FormData => { - return value instanceof FormData; -}; - -export const isSuccess = (status: number): boolean => { - return status >= 200 && status < 300; -}; - -export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -export const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: any) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const process = (key: string, value: any) => { - if (isDefined(value)) { - if (Array.isArray(value)) { - value.forEach(v => { - process(key, v); - }); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => { - process(`${key}[${k}]`, v); - }); - } else { - append(key, value); - } - } - }; - - Object.entries(params).forEach(([key, value]) => { - process(key, value); - }); - - if (qs.length > 0) { - return `?${qs.join('&')}`; - } - - return ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = `${config.BASE}${path}`; - if (options.query) { - return `${url}${getQueryString(options.query)}`; - } - return url; -}; - -export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: any) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([_, value]) => isDefined(value)) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions, formData?: FormData): Promise> => { - const [token, username, password, additionalHeaders] = await Promise.all([ - resolve(options, config.TOKEN), - resolve(options, config.USERNAME), - resolve(options, config.PASSWORD), - resolve(options, config.HEADERS), - ]); - - const formHeaders = typeof formData?.getHeaders === 'function' && formData?.getHeaders() || {} - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - ...formHeaders, - }) - .filter(([_, value]) => isDefined(value)) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body !== undefined) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return headers; -}; - -export const getRequestBody = (options: ApiRequestOptions): any => { - if (options.body) { - return options.body; - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Record, - onCancel: OnCancel, - axiosClient: AxiosInstance -): Promise> => { - const source = axios.CancelToken.source(); - - const requestConfig: AxiosRequestConfig = { - url, - headers, - data: body ?? formData, - method: options.method, - withCredentials: config.WITH_CREDENTIALS, - withXSRFToken: config.CREDENTIALS === 'include' ? config.WITH_CREDENTIALS : false, - cancelToken: source.token, - }; - - onCancel(() => source.cancel('The user aborted a request.')); - - try { - return await axiosClient.request(requestConfig); - } catch (error) { - const axiosError = error as AxiosError; - if (axiosError.response) { - return axiosError.response; - } - throw error; - } -}; - -export const getResponseHeader = (response: AxiosResponse, responseHeader?: string): string | undefined => { - if (responseHeader) { - const content = response.headers[responseHeader]; - if (isString(content)) { - return content; - } - } - return undefined; -}; - -export const getResponseBody = (response: AxiosResponse): any => { - if (response.status !== 204) { - return response.data; - } - return undefined; -}; - -export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 403: 'Forbidden', - 404: 'Not Found', - 500: 'Internal Server Error', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - ...options.errors, - } - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); - - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @param axiosClient The axios client instance to use - * @returns CancelablePromise - * @throws ApiError - */ -export const request = (config: OpenAPIConfig, options: ApiRequestOptions, axiosClient: AxiosInstance = axios): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options, formData); - - if (!onCancel.isCancelled) { - const response = await sendRequest(config, options, url, body, formData, headers, onCancel, axiosClient); - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - - const result: ApiResult = { - url, - ok: isSuccess(response.status), - status: response.status, - statusText: response.statusText, - body: responseHeader ?? responseBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; diff --git a/webui/lib/api/generated/index.ts b/webui/lib/api/generated/index.ts index 1d94f88d39..e11f63ca07 100644 --- a/webui/lib/api/generated/index.ts +++ b/webui/lib/api/generated/index.ts @@ -1,111 +1,3 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; -export { OpenAPI } from './core/OpenAPI'; -export type { OpenAPIConfig } from './core/OpenAPI'; - -export type { apimodels_GetJobResponse } from './models/apimodels_GetJobResponse'; -export type { apimodels_GetNodeResponse } from './models/apimodels_GetNodeResponse'; -export type { apimodels_GetVersionResponse } from './models/apimodels_GetVersionResponse'; -export type { apimodels_HTTPCredential } from './models/apimodels_HTTPCredential'; -export type { apimodels_ListJobExecutionsResponse } from './models/apimodels_ListJobExecutionsResponse'; -export type { apimodels_ListJobHistoryResponse } from './models/apimodels_ListJobHistoryResponse'; -export type { apimodels_ListJobResultsResponse } from './models/apimodels_ListJobResultsResponse'; -export type { apimodels_ListJobsResponse } from './models/apimodels_ListJobsResponse'; -export type { apimodels_ListNodesResponse } from './models/apimodels_ListNodesResponse'; -export type { apimodels_PutJobRequest } from './models/apimodels_PutJobRequest'; -export type { apimodels_PutJobResponse } from './models/apimodels_PutJobResponse'; -export type { apimodels_PutNodeRequest } from './models/apimodels_PutNodeRequest'; -export type { apimodels_PutNodeResponse } from './models/apimodels_PutNodeResponse'; -export type { apimodels_StopJobResponse } from './models/apimodels_StopJobResponse'; -export { authn_MethodType } from './models/authn_MethodType'; -export type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig } from './models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig'; -export type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig } from './models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig'; -export { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults } from './models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults'; -export type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig } from './models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig'; -export { logger_LogMode } from './models/logger_LogMode'; -export type { models_AllocatedResources } from './models/models_AllocatedResources'; -export type { models_BuildVersionInfo } from './models/models_BuildVersionInfo'; -export type { models_ComputeNodeInfo } from './models/models_ComputeNodeInfo'; -export type { models_DebugInfo } from './models/models_DebugInfo'; -export type { models_Event } from './models/models_Event'; -export type { models_Execution } from './models/models_Execution'; -export { models_ExecutionDesiredStateType } from './models/models_ExecutionDesiredStateType'; -export type { models_ExecutionLog } from './models/models_ExecutionLog'; -export { models_ExecutionLogType } from './models/models_ExecutionLogType'; -export { models_ExecutionStateType } from './models/models_ExecutionStateType'; -export type { models_FailureInjectionRequesterConfig } from './models/models_FailureInjectionRequesterConfig'; -export type { models_GPU } from './models/models_GPU'; -export { models_GPUVendor } from './models/models_GPUVendor'; -export type { models_InputSource } from './models/models_InputSource'; -export type { models_Job } from './models/models_Job'; -export type { models_JobHistory } from './models/models_JobHistory'; -export { models_JobHistoryType } from './models/models_JobHistoryType'; -export { models_JobSelectionDataLocality } from './models/models_JobSelectionDataLocality'; -export type { models_JobSelectionPolicy } from './models/models_JobSelectionPolicy'; -export { models_JobStateType } from './models/models_JobStateType'; -export type { models_LabelSelectorRequirement } from './models/models_LabelSelectorRequirement'; -export { models_Network } from './models/models_Network'; -export type { models_NetworkConfig } from './models/models_NetworkConfig'; -export { models_NodeConnectionState } from './models/models_NodeConnectionState'; -export type { models_NodeInfo } from './models/models_NodeInfo'; -export { models_NodeMembershipState } from './models/models_NodeMembershipState'; -export type { models_NodeState } from './models/models_NodeState'; -export { models_NodeType } from './models/models_NodeType'; -export type { models_Resources } from './models/models_Resources'; -export type { models_ResourcesConfig } from './models/models_ResourcesConfig'; -export type { models_ResultPath } from './models/models_ResultPath'; -export type { models_RunCommandResult } from './models/models_RunCommandResult'; -export type { models_SpecConfig } from './models/models_SpecConfig'; -export type { models_State_models_ExecutionDesiredStateType } from './models/models_State_models_ExecutionDesiredStateType'; -export type { models_State_models_ExecutionStateType } from './models/models_State_models_ExecutionStateType'; -export type { models_State_models_JobStateType } from './models/models_State_models_JobStateType'; -export type { models_StateChange_models_ExecutionStateType } from './models/models_StateChange_models_ExecutionStateType'; -export type { models_StateChange_models_JobStateType } from './models/models_StateChange_models_JobStateType'; -export type { models_Task } from './models/models_Task'; -export type { models_TimeoutConfig } from './models/models_TimeoutConfig'; -export { selection_Operator } from './models/selection_Operator'; -export type { shared_VersionRequest } from './models/shared_VersionRequest'; -export type { shared_VersionResponse } from './models/shared_VersionResponse'; -export type { types_APIConfig } from './models/types_APIConfig'; -export type { types_BacalhauConfig } from './models/types_BacalhauConfig'; -export type { types_CapacityConfig } from './models/types_CapacityConfig'; -export type { types_ClientTLSConfig } from './models/types_ClientTLSConfig'; -export type { types_ComputeConfig } from './models/types_ComputeConfig'; -export type { types_ComputeControlPlaneConfig } from './models/types_ComputeControlPlaneConfig'; -export type { types_DockerCacheConfig } from './models/types_DockerCacheConfig'; -export type { types_EvaluationBrokerConfig } from './models/types_EvaluationBrokerConfig'; -export type { types_FeatureConfig } from './models/types_FeatureConfig'; -export type { types_FreeSpace } from './models/types_FreeSpace'; -export type { types_HealthInfo } from './models/types_HealthInfo'; -export type { types_IpfsConfig } from './models/types_IpfsConfig'; -export type { types_JobStoreConfig } from './models/types_JobStoreConfig'; -export type { types_JobTimeoutConfig } from './models/types_JobTimeoutConfig'; -export type { types_LocalPublisherConfig } from './models/types_LocalPublisherConfig'; -export type { types_LoggingConfig } from './models/types_LoggingConfig'; -export type { types_LogStreamConfig } from './models/types_LogStreamConfig'; -export type { types_MetricsConfig } from './models/types_MetricsConfig'; -export type { types_MountStatus } from './models/types_MountStatus'; -export type { types_NetworkClusterConfig } from './models/types_NetworkClusterConfig'; -export type { types_NetworkConfig } from './models/types_NetworkConfig'; -export type { types_NodeConfig } from './models/types_NodeConfig'; -export type { types_RequesterConfig } from './models/types_RequesterConfig'; -export type { types_RequesterControlPlaneConfig } from './models/types_RequesterControlPlaneConfig'; -export type { types_S3StorageProviderConfig } from './models/types_S3StorageProviderConfig'; -export type { types_SchedulerConfig } from './models/types_SchedulerConfig'; -export type { types_StorageProviderConfig } from './models/types_StorageProviderConfig'; -export { types_StorageType } from './models/types_StorageType'; -export type { types_TLSConfiguration } from './models/types_TLSConfiguration'; -export type { types_UserConfig } from './models/types_UserConfig'; -export type { types_WebUIConfig } from './models/types_WebUIConfig'; -export type { types_WorkerConfig } from './models/types_WorkerConfig'; - -export { ComputeNodeService } from './services/ComputeNodeService'; -export { MiscService } from './services/MiscService'; -export { OpsService } from './services/OpsService'; -export { OrchestratorService } from './services/OrchestratorService'; -export { UtilsService } from './services/UtilsService'; +// This file is auto-generated by @hey-api/openapi-ts +export * from './services.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/webui/lib/api/generated/models/apimodels_GetJobResponse.ts b/webui/lib/api/generated/models/apimodels_GetJobResponse.ts deleted file mode 100644 index 321dd604f2..0000000000 --- a/webui/lib/api/generated/models/apimodels_GetJobResponse.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { apimodels_ListJobExecutionsResponse } from './apimodels_ListJobExecutionsResponse'; -import type { apimodels_ListJobHistoryResponse } from './apimodels_ListJobHistoryResponse'; -import type { models_Job } from './models_Job'; -export type apimodels_GetJobResponse = { - Executions?: apimodels_ListJobExecutionsResponse; - History?: apimodels_ListJobHistoryResponse; - Job?: models_Job; -}; - diff --git a/webui/lib/api/generated/models/apimodels_GetNodeResponse.ts b/webui/lib/api/generated/models/apimodels_GetNodeResponse.ts deleted file mode 100644 index e5bef87ffd..0000000000 --- a/webui/lib/api/generated/models/apimodels_GetNodeResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_NodeState } from './models_NodeState'; -export type apimodels_GetNodeResponse = { - Node?: models_NodeState; -}; - diff --git a/webui/lib/api/generated/models/apimodels_GetVersionResponse.ts b/webui/lib/api/generated/models/apimodels_GetVersionResponse.ts deleted file mode 100644 index 4ba6bd9bb5..0000000000 --- a/webui/lib/api/generated/models/apimodels_GetVersionResponse.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type apimodels_GetVersionResponse = { - BuildDate?: string; - GOARCH?: string; - GOOS?: string; - GitCommit?: string; - GitVersion?: string; - Major?: string; - Minor?: string; -}; - diff --git a/webui/lib/api/generated/models/apimodels_HTTPCredential.ts b/webui/lib/api/generated/models/apimodels_HTTPCredential.ts deleted file mode 100644 index 403004f13d..0000000000 --- a/webui/lib/api/generated/models/apimodels_HTTPCredential.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type apimodels_HTTPCredential = { - /** - * For authorization schemes that provide multiple values, a map of names to - * values providing the credential - */ - params?: Record; - /** - * An HTTP authorization scheme, such as one registered with IANA - * https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml - */ - scheme?: string; - /** - * For authorization schemes that only provide a single value, such as - * Basic, the single string value providing the credential - */ - value?: string; -}; - diff --git a/webui/lib/api/generated/models/apimodels_ListJobExecutionsResponse.ts b/webui/lib/api/generated/models/apimodels_ListJobExecutionsResponse.ts deleted file mode 100644 index fa08b7394f..0000000000 --- a/webui/lib/api/generated/models/apimodels_ListJobExecutionsResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_Execution } from './models_Execution'; -export type apimodels_ListJobExecutionsResponse = { - Items?: Array; - NextToken?: string; -}; - diff --git a/webui/lib/api/generated/models/apimodels_ListJobHistoryResponse.ts b/webui/lib/api/generated/models/apimodels_ListJobHistoryResponse.ts deleted file mode 100644 index 62081f0362..0000000000 --- a/webui/lib/api/generated/models/apimodels_ListJobHistoryResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_JobHistory } from './models_JobHistory'; -export type apimodels_ListJobHistoryResponse = { - Items?: Array; - NextToken?: string; -}; - diff --git a/webui/lib/api/generated/models/apimodels_ListJobResultsResponse.ts b/webui/lib/api/generated/models/apimodels_ListJobResultsResponse.ts deleted file mode 100644 index 8efbf35650..0000000000 --- a/webui/lib/api/generated/models/apimodels_ListJobResultsResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_SpecConfig } from './models_SpecConfig'; -export type apimodels_ListJobResultsResponse = { - Items?: Array; - NextToken?: string; -}; - diff --git a/webui/lib/api/generated/models/apimodels_ListJobsResponse.ts b/webui/lib/api/generated/models/apimodels_ListJobsResponse.ts deleted file mode 100644 index 95676ceaa6..0000000000 --- a/webui/lib/api/generated/models/apimodels_ListJobsResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_Job } from './models_Job'; -export type apimodels_ListJobsResponse = { - Items?: Array; - NextToken?: string; -}; - diff --git a/webui/lib/api/generated/models/apimodels_ListNodesResponse.ts b/webui/lib/api/generated/models/apimodels_ListNodesResponse.ts deleted file mode 100644 index 893116ba83..0000000000 --- a/webui/lib/api/generated/models/apimodels_ListNodesResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_NodeState } from './models_NodeState'; -export type apimodels_ListNodesResponse = { - NextToken?: string; - Nodes?: Array; -}; - diff --git a/webui/lib/api/generated/models/apimodels_PutJobRequest.ts b/webui/lib/api/generated/models/apimodels_PutJobRequest.ts deleted file mode 100644 index de3a6405de..0000000000 --- a/webui/lib/api/generated/models/apimodels_PutJobRequest.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { apimodels_HTTPCredential } from './apimodels_HTTPCredential'; -import type { models_Job } from './models_Job'; -export type apimodels_PutJobRequest = { - Job?: models_Job; - credential?: apimodels_HTTPCredential; - idempotencyToken?: string; - namespace?: string; -}; - diff --git a/webui/lib/api/generated/models/apimodels_PutJobResponse.ts b/webui/lib/api/generated/models/apimodels_PutJobResponse.ts deleted file mode 100644 index 8f0c995012..0000000000 --- a/webui/lib/api/generated/models/apimodels_PutJobResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type apimodels_PutJobResponse = { - EvaluationID?: string; - JobID?: string; - Warnings?: Array; -}; - diff --git a/webui/lib/api/generated/models/apimodels_PutNodeRequest.ts b/webui/lib/api/generated/models/apimodels_PutNodeRequest.ts deleted file mode 100644 index 6f4ea8e5ab..0000000000 --- a/webui/lib/api/generated/models/apimodels_PutNodeRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { apimodels_HTTPCredential } from './apimodels_HTTPCredential'; -export type apimodels_PutNodeRequest = { - Action?: string; - Message?: string; - NodeID?: string; - credential?: apimodels_HTTPCredential; - idempotencyToken?: string; - namespace?: string; -}; - diff --git a/webui/lib/api/generated/models/apimodels_PutNodeResponse.ts b/webui/lib/api/generated/models/apimodels_PutNodeResponse.ts deleted file mode 100644 index 4fdaea1857..0000000000 --- a/webui/lib/api/generated/models/apimodels_PutNodeResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type apimodels_PutNodeResponse = { - Error?: string; - Success?: boolean; -}; - diff --git a/webui/lib/api/generated/models/apimodels_StopJobResponse.ts b/webui/lib/api/generated/models/apimodels_StopJobResponse.ts deleted file mode 100644 index a6e7d201c2..0000000000 --- a/webui/lib/api/generated/models/apimodels_StopJobResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type apimodels_StopJobResponse = { - EvaluationID?: string; -}; - diff --git a/webui/lib/api/generated/models/authn_MethodType.ts b/webui/lib/api/generated/models/authn_MethodType.ts deleted file mode 100644 index c8a1c6acb3..0000000000 --- a/webui/lib/api/generated/models/authn_MethodType.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum authn_MethodType { - MethodTypeChallenge = 'challenge', - MethodTypeAsk = 'ask', -} diff --git a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig.ts b/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig.ts deleted file mode 100644 index 6ee3dccb16..0000000000 --- a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig'; -export type github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig = { - /** - * AccessPolicyPath is the path to a file or directory that will be loaded as - * the policy to apply to all inbound API requests. If unspecified, a policy - * that permits access to all API endpoints to both authenticated and - * unauthenticated users (the default as of v1.2.0) will be used. - */ - accessPolicyPath?: string; - /** - * Methods maps "method names" to authenticator implementations. A method - * name is a human-readable string chosen by the person configuring the - * system that is shown to users to help them pick the authentication method - * they want to use. There can be multiple usages of the same Authenticator - * *type* but with different configs and parameters, each identified with a - * unique method name. - * - * For example, if an implementation wants to allow users to log in with - * Github or Bitbucket, they might both use an authenticator implementation - * of type "oidc", and each would appear once on this provider with key / - * method name "github" and "bitbucket". - * - * By default, only a single authentication method that accepts - * authentication via client keys will be enabled. - */ - methods?: Record; - /** - * TokensPath is the location where a state file of tokens will be stored. - * By default it will be local to the Bacalhau repo, but can be any location - * in the host filesystem. Tokens are sensitive and should be stored in a - * location that is only readable to the current user. - * Deprecated: replaced by cfg.AuthTokensPath() - */ - tokensPath?: string; -}; - diff --git a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig.ts b/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig.ts deleted file mode 100644 index 1082068797..0000000000 --- a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { authn_MethodType } from './authn_MethodType'; -export type github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig = { - policyPath?: string; - type?: authn_MethodType; -}; - diff --git a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration.ts b/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration.ts deleted file mode 100644 index 1af44521ee..0000000000 --- a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration { - minDuration = -9223372036854776000, - maxDuration = 9223372036854776000, - Nanosecond = 1, - Microsecond = 1000, - Millisecond = 1000000, - Second = 1000000000, - Minute = 60000000000, - Hour = 3600000000000, -} diff --git a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults.ts b/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults.ts deleted file mode 100644 index 6291973ee5..0000000000 --- a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults = { - executionTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - queueTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - totalTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; -}; - diff --git a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig.ts b/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig.ts deleted file mode 100644 index 3eb066388d..0000000000 --- a/webui/lib/api/generated/models/github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig = { - checkFrequency?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - skipChecks?: boolean; -}; - diff --git a/webui/lib/api/generated/models/logger_LogMode.ts b/webui/lib/api/generated/models/logger_LogMode.ts deleted file mode 100644 index c501944edc..0000000000 --- a/webui/lib/api/generated/models/logger_LogMode.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum logger_LogMode { - LogModeDefault = 'default', - LogModeStation = 'station', - LogModeJSON = 'json', - LogModeCombined = 'combined', - LogModeEvent = 'event', -} diff --git a/webui/lib/api/generated/models/models_AllocatedResources.ts b/webui/lib/api/generated/models/models_AllocatedResources.ts deleted file mode 100644 index c292bcbf83..0000000000 --- a/webui/lib/api/generated/models/models_AllocatedResources.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_Resources } from './models_Resources'; -export type models_AllocatedResources = { - Tasks?: Record; -}; - diff --git a/webui/lib/api/generated/models/models_BuildVersionInfo.ts b/webui/lib/api/generated/models/models_BuildVersionInfo.ts deleted file mode 100644 index b91f0868c7..0000000000 --- a/webui/lib/api/generated/models/models_BuildVersionInfo.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_BuildVersionInfo = { - BuildDate?: string; - GOARCH?: string; - GOOS?: string; - GitCommit?: string; - GitVersion?: string; - Major?: string; - Minor?: string; -}; - diff --git a/webui/lib/api/generated/models/models_ComputeNodeInfo.ts b/webui/lib/api/generated/models/models_ComputeNodeInfo.ts deleted file mode 100644 index 8760650672..0000000000 --- a/webui/lib/api/generated/models/models_ComputeNodeInfo.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_Resources } from './models_Resources'; -export type models_ComputeNodeInfo = { - AvailableCapacity?: models_Resources; - EnqueuedExecutions?: number; - ExecutionEngines?: Array; - MaxCapacity?: models_Resources; - MaxJobRequirements?: models_Resources; - Publishers?: Array; - QueueCapacity?: models_Resources; - RunningExecutions?: number; - StorageSources?: Array; -}; - diff --git a/webui/lib/api/generated/models/models_DebugInfo.ts b/webui/lib/api/generated/models/models_DebugInfo.ts deleted file mode 100644 index a97c5f6b4c..0000000000 --- a/webui/lib/api/generated/models/models_DebugInfo.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_DebugInfo = { - component?: string; - info?: any; -}; - diff --git a/webui/lib/api/generated/models/models_Event.ts b/webui/lib/api/generated/models/models_Event.ts deleted file mode 100644 index 748cff1091..0000000000 --- a/webui/lib/api/generated/models/models_Event.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_Event = { - /** - * Any additional metadata that the system or user may need to know about - * the event in order to handle it properly. - */ - Details?: Record; - /** - * A human-readable string giving the user all the information they need to - * understand and respond to an Event, if a response is required. - */ - Message?: string; - /** - * The moment the event occurred, which may be different to the moment it - * was recorded. - */ - Timestamp?: string; - /** - * The topic of the event. See the documentation on EventTopic. - */ - Topic?: string; -}; - diff --git a/webui/lib/api/generated/models/models_Execution.ts b/webui/lib/api/generated/models/models_Execution.ts deleted file mode 100644 index 07c27b04d4..0000000000 --- a/webui/lib/api/generated/models/models_Execution.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_AllocatedResources } from './models_AllocatedResources'; -import type { models_Job } from './models_Job'; -import type { models_RunCommandResult } from './models_RunCommandResult'; -import type { models_SpecConfig } from './models_SpecConfig'; -import type { models_State_models_ExecutionDesiredStateType } from './models_State_models_ExecutionDesiredStateType'; -import type { models_State_models_ExecutionStateType } from './models_State_models_ExecutionStateType'; -export type models_Execution = { - /** - * AllocatedResources is the total resources allocated for the execution tasks. - */ - AllocatedResources?: models_AllocatedResources; - /** - * ComputeState observed state of the execution on the compute node - */ - ComputeState?: models_State_models_ExecutionStateType; - /** - * CreateTime is the time the execution has finished scheduling and been - * verified by the plan applier. - */ - CreateTime?: number; - /** - * DesiredState of the execution on the compute node - */ - DesiredState?: models_State_models_ExecutionDesiredStateType; - /** - * ID of the evaluation that generated this execution - */ - EvalID?: string; - /** - * FollowupEvalID captures a follow up evaluation created to handle a failed execution - * that can be rescheduled in the future - */ - FollowupEvalID?: string; - /** - * ID of the execution (UUID) - */ - ID?: string; - /** - * TODO: evaluate using a copy of the job instead of a pointer - */ - Job?: models_Job; - /** - * Job is the parent job of the task being allocated. - * This is copied at execution time to avoid issues if the job - * definition is updated. - */ - JobID?: string; - /** - * ModifyTime is the time the execution was last updated. - */ - ModifyTime?: number; - /** - * Name is a logical name of the execution. - */ - Name?: string; - /** - * Namespace is the namespace the execution is created in - */ - Namespace?: string; - /** - * NextExecution is the execution that this execution is being replaced by - */ - NextExecution?: string; - /** - * NodeID is the node this is being placed on - */ - NodeID?: string; - /** - * PreviousExecution is the execution that this execution is replacing - */ - PreviousExecution?: string; - /** - * the published results for this execution - */ - PublishedResult?: models_SpecConfig; - /** - * Revision is increment each time the execution is updated. - */ - Revision?: number; - /** - * RunOutput is the output of the run command - * TODO: evaluate removing this from execution spec in favour of calling `bacalhau job logs` - */ - RunOutput?: models_RunCommandResult; -}; - diff --git a/webui/lib/api/generated/models/models_ExecutionDesiredStateType.ts b/webui/lib/api/generated/models/models_ExecutionDesiredStateType.ts deleted file mode 100644 index b0016b3aa3..0000000000 --- a/webui/lib/api/generated/models/models_ExecutionDesiredStateType.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum models_ExecutionDesiredStateType { - ExecutionDesiredStatePending = 0, - ExecutionDesiredStateRunning = 1, - ExecutionDesiredStateStopped = 2, -} diff --git a/webui/lib/api/generated/models/models_ExecutionLog.ts b/webui/lib/api/generated/models/models_ExecutionLog.ts deleted file mode 100644 index d30b6386b7..0000000000 --- a/webui/lib/api/generated/models/models_ExecutionLog.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_ExecutionLogType } from './models_ExecutionLogType'; -export type models_ExecutionLog = { - line?: string; - type?: models_ExecutionLogType; -}; - diff --git a/webui/lib/api/generated/models/models_ExecutionLogType.ts b/webui/lib/api/generated/models/models_ExecutionLogType.ts deleted file mode 100644 index 2723ae66a4..0000000000 --- a/webui/lib/api/generated/models/models_ExecutionLogType.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum models_ExecutionLogType { - executionLogTypeUnknown = 0, - ExecutionLogTypeSTDOUT = 1, - ExecutionLogTypeSTDERR = 2, -} diff --git a/webui/lib/api/generated/models/models_ExecutionStateType.ts b/webui/lib/api/generated/models/models_ExecutionStateType.ts deleted file mode 100644 index 6d9a816d91..0000000000 --- a/webui/lib/api/generated/models/models_ExecutionStateType.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum models_ExecutionStateType { - ExecutionStateUndefined = 0, - ExecutionStateNew = 1, - ExecutionStateAskForBid = 2, - ExecutionStateAskForBidAccepted = 3, - ExecutionStateAskForBidRejected = 4, - ExecutionStateBidAccepted = 5, - ExecutionStateBidRejected = 6, - ExecutionStateCompleted = 7, - ExecutionStateFailed = 8, - ExecutionStateCancelled = 9, -} diff --git a/webui/lib/api/generated/models/models_FailureInjectionRequesterConfig.ts b/webui/lib/api/generated/models/models_FailureInjectionRequesterConfig.ts deleted file mode 100644 index 8d80dc8ad5..0000000000 --- a/webui/lib/api/generated/models/models_FailureInjectionRequesterConfig.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_FailureInjectionRequesterConfig = { - isBadActor?: boolean; -}; - diff --git a/webui/lib/api/generated/models/models_GPU.ts b/webui/lib/api/generated/models/models_GPU.ts deleted file mode 100644 index e9e0d6eb92..0000000000 --- a/webui/lib/api/generated/models/models_GPU.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_GPUVendor } from './models_GPUVendor'; -export type models_GPU = { - /** - * Self-reported index of the device in the system - */ - index?: number; - /** - * Total GPU memory in mebibytes (MiB) - */ - memory?: number; - /** - * Model name of the GPU e.g. Tesla T4 - */ - name?: string; - /** - * PCI address of the device, in the format AAAA:BB:CC.C - * Used to discover the correct device rendering cards - */ - pciaddress?: string; - /** - * Maker of the GPU, e.g. NVidia, AMD, Intel - */ - vendor?: models_GPUVendor; -}; - diff --git a/webui/lib/api/generated/models/models_GPUVendor.ts b/webui/lib/api/generated/models/models_GPUVendor.ts deleted file mode 100644 index b54793e59f..0000000000 --- a/webui/lib/api/generated/models/models_GPUVendor.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum models_GPUVendor { - GPUVendorNvidia = 'NVIDIA', - GPUVendorAMDATI = 'AMD/ATI', - GPUVendorIntel = 'Intel', -} diff --git a/webui/lib/api/generated/models/models_InputSource.ts b/webui/lib/api/generated/models/models_InputSource.ts deleted file mode 100644 index 00f6ebcc65..0000000000 --- a/webui/lib/api/generated/models/models_InputSource.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_SpecConfig } from './models_SpecConfig'; -export type models_InputSource = { - /** - * Alias is an optional reference to this input source that can be used for - * dynamic linking to this input. (e.g. dynamic import in wasm by alias) - */ - Alias?: string; - /** - * Source is the source of the artifact to be downloaded, e.g a URL, S3 bucket, etc. - */ - Source?: models_SpecConfig; - /** - * Target is the path where the artifact should be mounted on - */ - Target?: string; -}; - diff --git a/webui/lib/api/generated/models/models_Job.ts b/webui/lib/api/generated/models/models_Job.ts deleted file mode 100644 index 4efc8a1f97..0000000000 --- a/webui/lib/api/generated/models/models_Job.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_LabelSelectorRequirement } from './models_LabelSelectorRequirement'; -import type { models_State_models_JobStateType } from './models_State_models_JobStateType'; -import type { models_Task } from './models_Task'; -export type models_Job = { - /** - * Constraints is a selector which must be true for the compute node to run this job. - */ - Constraints?: Array; - /** - * Count is the number of replicas that should be scheduled. - */ - Count?: number; - CreateTime?: number; - /** - * ID is a unique identifier assigned to this job. - * It helps to distinguish jobs with the same name after they have been deleted and re-created. - * The ID is generated by the server and should not be set directly by the client. - */ - ID?: string; - /** - * Labels is used to associate arbitrary labels with this job, which can be used - * for filtering. - * key=value - */ - Labels?: Record; - /** - * Meta is used to associate arbitrary metadata with this job. - */ - Meta?: Record; - ModifyTime?: number; - /** - * Name is the logical name of the job used to refer to it. - * Submitting a job with the same name as an existing job will result in an - * update to the existing job. - */ - Name?: string; - /** - * Namespace is the namespace this job is running in. - */ - Namespace?: string; - /** - * Priority defines the scheduling priority of this job. - */ - Priority?: number; - /** - * Revision is a per-job monotonically increasing revision number that is incremented - * on each update to the job's state or specification - */ - Revision?: number; - /** - * State is the current state of the job. - */ - State?: models_State_models_JobStateType; - Tasks?: Array; - /** - * Type is the type of job this is, e.g. "daemon" or "batch". - */ - Type?: string; - /** - * Version is a per-job monotonically increasing version number that is incremented - * on each job specification update. - */ - Version?: number; -}; - diff --git a/webui/lib/api/generated/models/models_JobHistory.ts b/webui/lib/api/generated/models/models_JobHistory.ts deleted file mode 100644 index effda489c3..0000000000 --- a/webui/lib/api/generated/models/models_JobHistory.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_Event } from './models_Event'; -import type { models_JobHistoryType } from './models_JobHistoryType'; -import type { models_StateChange_models_ExecutionStateType } from './models_StateChange_models_ExecutionStateType'; -import type { models_StateChange_models_JobStateType } from './models_StateChange_models_JobStateType'; -export type models_JobHistory = { - Event?: models_Event; - ExecutionID?: string; - /** - * Deprecated: Left for backward compatibility with v1.4.x clients - */ - ExecutionState?: models_StateChange_models_ExecutionStateType; - JobID?: string; - /** - * TODO: remove with v1.5 - * Deprecated: Left for backward compatibility with v1.4.x clients - */ - JobState?: models_StateChange_models_JobStateType; - Time?: string; - Type?: models_JobHistoryType; -}; - diff --git a/webui/lib/api/generated/models/models_JobHistoryType.ts b/webui/lib/api/generated/models/models_JobHistoryType.ts deleted file mode 100644 index 7f3c06e35d..0000000000 --- a/webui/lib/api/generated/models/models_JobHistoryType.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum models_JobHistoryType { - JobHistoryTypeUndefined = 0, - JobHistoryTypeJobLevel = 1, - JobHistoryTypeExecutionLevel = 2, -} diff --git a/webui/lib/api/generated/models/models_JobSelectionDataLocality.ts b/webui/lib/api/generated/models/models_JobSelectionDataLocality.ts deleted file mode 100644 index 08f94533e0..0000000000 --- a/webui/lib/api/generated/models/models_JobSelectionDataLocality.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum models_JobSelectionDataLocality { - Local = 0, - Anywhere = 1, -} diff --git a/webui/lib/api/generated/models/models_JobSelectionPolicy.ts b/webui/lib/api/generated/models/models_JobSelectionPolicy.ts deleted file mode 100644 index 019bb091d6..0000000000 --- a/webui/lib/api/generated/models/models_JobSelectionPolicy.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_JobSelectionDataLocality } from './models_JobSelectionDataLocality'; -export type models_JobSelectionPolicy = { - /** - * should we accept jobs that specify networking - * the default is "reject" - */ - accept_networked_jobs?: boolean; - /** - * this describes if we should run a job based on - * where the data is located - i.e. if the data is "local" - * or if the data is "anywhere" - */ - locality?: models_JobSelectionDataLocality; - probe_exec?: string; - /** - * external hooks that decide if we should take on the job or not - * if either of these are given they will override the data locality settings - */ - probe_http?: string; - /** - * should we reject jobs that don't specify any data - * the default is "accept" - */ - reject_stateless_jobs?: boolean; -}; - diff --git a/webui/lib/api/generated/models/models_JobStateType.ts b/webui/lib/api/generated/models/models_JobStateType.ts deleted file mode 100644 index 7b7dab7e5f..0000000000 --- a/webui/lib/api/generated/models/models_JobStateType.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum models_JobStateType { - JobStateTypeUndefined = 0, - JobStateTypePending = 1, - JobStateTypeQueued = 2, - JobStateTypeRunning = 3, - JobStateTypeCompleted = 4, - JobStateTypeFailed = 5, - JobStateTypeStopped = 6, -} diff --git a/webui/lib/api/generated/models/models_LabelSelectorRequirement.ts b/webui/lib/api/generated/models/models_LabelSelectorRequirement.ts deleted file mode 100644 index 36bbabd0a0..0000000000 --- a/webui/lib/api/generated/models/models_LabelSelectorRequirement.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { selection_Operator } from './selection_Operator'; -export type models_LabelSelectorRequirement = { - /** - * key is the label key that the selector applies to. - */ - Key?: string; - /** - * operator represents a key's relationship to a set of values. - * Valid operators are In, NotIn, Exists and KeyNotInImap. - */ - Operator?: selection_Operator; - /** - * values is an array of string values. If the operator is In or NotIn, - * the values array must be non-empty. If the operator is Exists or KeyNotInImap, - * the values array must be empty. This array is replaced during a strategic - */ - Values?: Array; -}; - diff --git a/webui/lib/api/generated/models/models_Network.ts b/webui/lib/api/generated/models/models_Network.ts deleted file mode 100644 index 7134120778..0000000000 --- a/webui/lib/api/generated/models/models_Network.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum models_Network { - NetworkNone = 0, - NetworkFull = 1, - NetworkHTTP = 2, -} diff --git a/webui/lib/api/generated/models/models_NetworkConfig.ts b/webui/lib/api/generated/models/models_NetworkConfig.ts deleted file mode 100644 index ac29449663..0000000000 --- a/webui/lib/api/generated/models/models_NetworkConfig.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_Network } from './models_Network'; -export type models_NetworkConfig = { - Domains?: Array; - Type?: models_Network; -}; - diff --git a/webui/lib/api/generated/models/models_NodeConnectionState.ts b/webui/lib/api/generated/models/models_NodeConnectionState.ts deleted file mode 100644 index 18de8f058e..0000000000 --- a/webui/lib/api/generated/models/models_NodeConnectionState.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_NodeConnectionState = { - connection?: models_NodeConnectionState.connection; -}; -export namespace models_NodeConnectionState { - export enum connection { - connected = 0, - disconnected = 1, - } -} - diff --git a/webui/lib/api/generated/models/models_NodeInfo.ts b/webui/lib/api/generated/models/models_NodeInfo.ts deleted file mode 100644 index 5eea270139..0000000000 --- a/webui/lib/api/generated/models/models_NodeInfo.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_BuildVersionInfo } from './models_BuildVersionInfo'; -import type { models_ComputeNodeInfo } from './models_ComputeNodeInfo'; -import type { models_NodeType } from './models_NodeType'; -export type models_NodeInfo = { - BacalhauVersion?: models_BuildVersionInfo; - ComputeNodeInfo?: models_ComputeNodeInfo; - Labels?: Record; - /** - * TODO replace all access on this field with the `ID()` method - */ - NodeID?: string; - NodeType?: models_NodeType; -}; - diff --git a/webui/lib/api/generated/models/models_NodeMembershipState.ts b/webui/lib/api/generated/models/models_NodeMembershipState.ts deleted file mode 100644 index cf74e5fa58..0000000000 --- a/webui/lib/api/generated/models/models_NodeMembershipState.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_NodeMembershipState = { - membership?: models_NodeMembershipState.membership; -}; -export namespace models_NodeMembershipState { - export enum membership { - unknown = 0, - pending = 1, - approved = 2, - rejected = 3, - } -} - diff --git a/webui/lib/api/generated/models/models_NodeState.ts b/webui/lib/api/generated/models/models_NodeState.ts deleted file mode 100644 index b0872f0986..0000000000 --- a/webui/lib/api/generated/models/models_NodeState.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_NodeConnectionState } from './models_NodeConnectionState'; -import type { models_NodeInfo } from './models_NodeInfo'; -import type { models_NodeMembershipState } from './models_NodeMembershipState'; -export type models_NodeState = { - Connection?: models_NodeConnectionState; - Info?: models_NodeInfo; - Membership?: models_NodeMembershipState; -}; - diff --git a/webui/lib/api/generated/models/models_NodeType.ts b/webui/lib/api/generated/models/models_NodeType.ts deleted file mode 100644 index be8b09bee5..0000000000 --- a/webui/lib/api/generated/models/models_NodeType.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum models_NodeType { - nodeTypeUndefined = 0, - NodeTypeRequester = 1, - NodeTypeCompute = 2, -} diff --git a/webui/lib/api/generated/models/models_Resources.ts b/webui/lib/api/generated/models/models_Resources.ts deleted file mode 100644 index b2939596c7..0000000000 --- a/webui/lib/api/generated/models/models_Resources.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_GPU } from './models_GPU'; -export type models_Resources = { - /** - * CPU units - */ - CPU?: number; - /** - * Disk in bytes - */ - Disk?: number; - /** - * GPU units - */ - GPU?: number; - /** - * GPU details - */ - GPUs?: Array; - /** - * Memory in bytes - */ - Memory?: number; -}; - diff --git a/webui/lib/api/generated/models/models_ResourcesConfig.ts b/webui/lib/api/generated/models/models_ResourcesConfig.ts deleted file mode 100644 index c043e76b41..0000000000 --- a/webui/lib/api/generated/models/models_ResourcesConfig.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_ResourcesConfig = { - /** - * CPU https://github.com/BTBurke/k8sresource string - */ - CPU?: string; - /** - * Memory github.com/dustin/go-humanize string - */ - Disk?: string; - GPU?: string; - /** - * Memory github.com/dustin/go-humanize string - */ - Memory?: string; -}; - diff --git a/webui/lib/api/generated/models/models_ResultPath.ts b/webui/lib/api/generated/models/models_ResultPath.ts deleted file mode 100644 index b6450d5c6e..0000000000 --- a/webui/lib/api/generated/models/models_ResultPath.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_ResultPath = { - /** - * Name - */ - Name?: string; - /** - * The path to the file/dir - */ - Path?: string; -}; - diff --git a/webui/lib/api/generated/models/models_RunCommandResult.ts b/webui/lib/api/generated/models/models_RunCommandResult.ts deleted file mode 100644 index c0904d80af..0000000000 --- a/webui/lib/api/generated/models/models_RunCommandResult.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_RunCommandResult = { - /** - * Runner error - */ - ErrorMsg?: string; - /** - * exit code of the run. - */ - ExitCode?: number; - /** - * bool describing if stderr was truncated - */ - StderrTruncated?: boolean; - /** - * stdout of the run. Yaml provided for `describe` output - */ - Stdout?: string; - /** - * bool describing if stdout was truncated - */ - StdoutTruncated?: boolean; - /** - * stderr of the run. - */ - stderr?: string; -}; - diff --git a/webui/lib/api/generated/models/models_SpecConfig.ts b/webui/lib/api/generated/models/models_SpecConfig.ts deleted file mode 100644 index ba3b09eeca..0000000000 --- a/webui/lib/api/generated/models/models_SpecConfig.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_SpecConfig = { - /** - * Params is a map of the config params - */ - Params?: any; - /** - * Type of the config - */ - Type?: string; -}; - diff --git a/webui/lib/api/generated/models/models_StateChange_models_ExecutionStateType.ts b/webui/lib/api/generated/models/models_StateChange_models_ExecutionStateType.ts deleted file mode 100644 index 14ec2ba8c7..0000000000 --- a/webui/lib/api/generated/models/models_StateChange_models_ExecutionStateType.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_ExecutionStateType } from './models_ExecutionStateType'; -export type models_StateChange_models_ExecutionStateType = { - New?: models_ExecutionStateType; - Previous?: models_ExecutionStateType; -}; - diff --git a/webui/lib/api/generated/models/models_StateChange_models_JobStateType.ts b/webui/lib/api/generated/models/models_StateChange_models_JobStateType.ts deleted file mode 100644 index ea515eaeac..0000000000 --- a/webui/lib/api/generated/models/models_StateChange_models_JobStateType.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_JobStateType } from './models_JobStateType'; -export type models_StateChange_models_JobStateType = { - New?: models_JobStateType; - Previous?: models_JobStateType; -}; - diff --git a/webui/lib/api/generated/models/models_State_models_ExecutionDesiredStateType.ts b/webui/lib/api/generated/models/models_State_models_ExecutionDesiredStateType.ts deleted file mode 100644 index 91b152de58..0000000000 --- a/webui/lib/api/generated/models/models_State_models_ExecutionDesiredStateType.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_ExecutionDesiredStateType } from './models_ExecutionDesiredStateType'; -export type models_State_models_ExecutionDesiredStateType = { - /** - * Message is a human readable message describing the state. - */ - Message?: string; - /** - * StateType is the current state of the object. - */ - StateType?: models_ExecutionDesiredStateType; -}; - diff --git a/webui/lib/api/generated/models/models_State_models_ExecutionStateType.ts b/webui/lib/api/generated/models/models_State_models_ExecutionStateType.ts deleted file mode 100644 index 5853917355..0000000000 --- a/webui/lib/api/generated/models/models_State_models_ExecutionStateType.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_ExecutionStateType } from './models_ExecutionStateType'; -export type models_State_models_ExecutionStateType = { - /** - * Message is a human readable message describing the state. - */ - Message?: string; - /** - * StateType is the current state of the object. - */ - StateType?: models_ExecutionStateType; -}; - diff --git a/webui/lib/api/generated/models/models_State_models_JobStateType.ts b/webui/lib/api/generated/models/models_State_models_JobStateType.ts deleted file mode 100644 index f42ef1df5f..0000000000 --- a/webui/lib/api/generated/models/models_State_models_JobStateType.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_JobStateType } from './models_JobStateType'; -export type models_State_models_JobStateType = { - /** - * Message is a human readable message describing the state. - */ - Message?: string; - /** - * StateType is the current state of the object. - */ - StateType?: models_JobStateType; -}; - diff --git a/webui/lib/api/generated/models/models_Task.ts b/webui/lib/api/generated/models/models_Task.ts deleted file mode 100644 index 7d5e561568..0000000000 --- a/webui/lib/api/generated/models/models_Task.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_InputSource } from './models_InputSource'; -import type { models_NetworkConfig } from './models_NetworkConfig'; -import type { models_ResourcesConfig } from './models_ResourcesConfig'; -import type { models_ResultPath } from './models_ResultPath'; -import type { models_SpecConfig } from './models_SpecConfig'; -import type { models_TimeoutConfig } from './models_TimeoutConfig'; -export type models_Task = { - Engine?: models_SpecConfig; - /** - * Map of environment variables to be used by the driver - */ - Env?: Record; - /** - * InputSources is a list of remote artifacts to be downloaded before running the task - * and mounted into the task. - */ - InputSources?: Array; - /** - * Meta is used to associate arbitrary metadata with this task. - */ - Meta?: Record; - /** - * Name of the task - */ - Name?: string; - Network?: models_NetworkConfig; - Publisher?: models_SpecConfig; - /** - * ResourcesConfig is the resources needed by this task - */ - Resources?: models_ResourcesConfig; - /** - * ResultPaths is a list of task volumes to be included in the task's published result - */ - ResultPaths?: Array; - Timeouts?: models_TimeoutConfig; -}; - diff --git a/webui/lib/api/generated/models/models_TimeoutConfig.ts b/webui/lib/api/generated/models/models_TimeoutConfig.ts deleted file mode 100644 index 6b3ed65198..0000000000 --- a/webui/lib/api/generated/models/models_TimeoutConfig.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type models_TimeoutConfig = { - /** - * ExecutionTimeout is the maximum amount of time a task is allowed to run in seconds. - * Zero means no timeout, such as for a daemon task. - */ - ExecutionTimeout?: number; - /** - * QueueTimeout is the maximum amount of time a task is allowed to wait in the orchestrator - * queue in seconds before being scheduled. Zero means no timeout. - */ - QueueTimeout?: number; - /** - * TotalTimeout is the maximum amount of time a task is allowed to complete in seconds. - * This includes the time spent in the queue, the time spent executing and the time spent retrying. - * Zero means no timeout. - */ - TotalTimeout?: number; -}; - diff --git a/webui/lib/api/generated/models/selection_Operator.ts b/webui/lib/api/generated/models/selection_Operator.ts deleted file mode 100644 index 41346b6524..0000000000 --- a/webui/lib/api/generated/models/selection_Operator.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum selection_Operator { - DoesNotExist = '!', - Equals = '=', - DoubleEquals = '==', - In = 'in', - NotEquals = '!=', - NotIn = 'notin', - Exists = 'exists', - GreaterThan = 'gt', - LessThan = 'lt', -} diff --git a/webui/lib/api/generated/models/shared_VersionRequest.ts b/webui/lib/api/generated/models/shared_VersionRequest.ts deleted file mode 100644 index 9858715e85..0000000000 --- a/webui/lib/api/generated/models/shared_VersionRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type shared_VersionRequest = { - client_id?: string; -}; - diff --git a/webui/lib/api/generated/models/shared_VersionResponse.ts b/webui/lib/api/generated/models/shared_VersionResponse.ts deleted file mode 100644 index 39a0bd2d5c..0000000000 --- a/webui/lib/api/generated/models/shared_VersionResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_BuildVersionInfo } from './models_BuildVersionInfo'; -export type shared_VersionResponse = { - build_version_info?: models_BuildVersionInfo; -}; - diff --git a/webui/lib/api/generated/models/types_APIConfig.ts b/webui/lib/api/generated/models/types_APIConfig.ts deleted file mode 100644 index 8911de7cca..0000000000 --- a/webui/lib/api/generated/models/types_APIConfig.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { types_ClientTLSConfig } from './types_ClientTLSConfig'; -import type { types_TLSConfiguration } from './types_TLSConfiguration'; -export type types_APIConfig = { - /** - * ClientTLS specifies tls options for the client connecting to the - * API. - */ - clientTLS?: types_ClientTLSConfig; - /** - * Host is the hostname of an environment's public API servers. - */ - host?: string; - /** - * Port is the port that an environment serves the public API on. - */ - port?: number; - /** - * TLS returns information about how TLS is configured for the public server. - * This is only used in APIConfig for NodeConfig.ServerAPI - */ - tls?: types_TLSConfiguration; -}; - diff --git a/webui/lib/api/generated/models/types_BacalhauConfig.ts b/webui/lib/api/generated/models/types_BacalhauConfig.ts deleted file mode 100644 index e39ccdaa89..0000000000 --- a/webui/lib/api/generated/models/types_BacalhauConfig.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig'; -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig'; -import type { types_MetricsConfig } from './types_MetricsConfig'; -import type { types_NodeConfig } from './types_NodeConfig'; -import type { types_UserConfig } from './types_UserConfig'; -export type types_BacalhauConfig = { - auth?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig; - /** - * NB(forrest): this field shouldn't be persisted yet. - */ - dataDir?: string; - metrics?: types_MetricsConfig; - node?: types_NodeConfig; - update?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig; - user?: types_UserConfig; -}; - diff --git a/webui/lib/api/generated/models/types_CapacityConfig.ts b/webui/lib/api/generated/models/types_CapacityConfig.ts deleted file mode 100644 index 04abc75c57..0000000000 --- a/webui/lib/api/generated/models/types_CapacityConfig.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_ResourcesConfig } from './models_ResourcesConfig'; -export type types_CapacityConfig = { - defaultJobResourceLimits?: models_ResourcesConfig; - ignorePhysicalResourceLimits?: boolean; - /** - * Per job amount of resource the system can be using at one time. - */ - jobResourceLimits?: models_ResourcesConfig; - /** - * Total amount of resource the system can be using at one time in aggregate for all jobs. - */ - totalResourceLimits?: models_ResourcesConfig; -}; - diff --git a/webui/lib/api/generated/models/types_ClientTLSConfig.ts b/webui/lib/api/generated/models/types_ClientTLSConfig.ts deleted file mode 100644 index c5f4a67564..0000000000 --- a/webui/lib/api/generated/models/types_ClientTLSConfig.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_ClientTLSConfig = { - /** - * Used for NodeConfig.ClientAPI, specifies the location of a ca certificate - * file (primarily for self-signed server certs). Will use HTTPS for requests. - */ - cacert?: string; - /** - * Used for NodeConfig.ClientAPI, and when true instructs the client to use - * HTTPS, but not to attempt to verify the certificate. - */ - insecure?: boolean; - /** - * Used for NodeConfig.ClientAPI, instructs the client to connect over - * TLS. Auto enabled if Insecure or CACert are specified. - */ - useTLS?: boolean; -}; - diff --git a/webui/lib/api/generated/models/types_ComputeConfig.ts b/webui/lib/api/generated/models/types_ComputeConfig.ts deleted file mode 100644 index 6f6e4c3f5c..0000000000 --- a/webui/lib/api/generated/models/types_ComputeConfig.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_JobSelectionPolicy } from './models_JobSelectionPolicy'; -import type { types_CapacityConfig } from './types_CapacityConfig'; -import type { types_ComputeControlPlaneConfig } from './types_ComputeControlPlaneConfig'; -import type { types_DockerCacheConfig } from './types_DockerCacheConfig'; -import type { types_JobStoreConfig } from './types_JobStoreConfig'; -import type { types_JobTimeoutConfig } from './types_JobTimeoutConfig'; -import type { types_LocalPublisherConfig } from './types_LocalPublisherConfig'; -import type { types_LoggingConfig } from './types_LoggingConfig'; -import type { types_LogStreamConfig } from './types_LogStreamConfig'; -export type types_ComputeConfig = { - capacity?: types_CapacityConfig; - controlPlaneSettings?: types_ComputeControlPlaneConfig; - executionStore?: types_JobStoreConfig; - jobSelection?: models_JobSelectionPolicy; - jobTimeouts?: types_JobTimeoutConfig; - localPublisher?: types_LocalPublisherConfig; - logStreamConfig?: types_LogStreamConfig; - logging?: types_LoggingConfig; - manifestCache?: types_DockerCacheConfig; -}; - diff --git a/webui/lib/api/generated/models/types_ComputeControlPlaneConfig.ts b/webui/lib/api/generated/models/types_ComputeControlPlaneConfig.ts deleted file mode 100644 index 5486e4545b..0000000000 --- a/webui/lib/api/generated/models/types_ComputeControlPlaneConfig.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type types_ComputeControlPlaneConfig = { - /** - * How often the compute node will send a heartbeat to the requester node to let it know - * that the compute node is still alive. This should be less than the requester's configured - * heartbeat timeout to avoid flapping. - */ - heartbeatFrequency?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - /** - * This is the pubsub topic that the compute node will use to send heartbeats to the requester node. - */ - heartbeatTopic?: string; - /** - * The frequency with which the compute node will send node info (inc current labels) - * to the controlling requester node. - */ - infoUpdateFrequency?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - /** - * How often the compute node will send current resource availability to the requester node. - */ - resourceUpdateFrequency?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; -}; - diff --git a/webui/lib/api/generated/models/types_DockerCacheConfig.ts b/webui/lib/api/generated/models/types_DockerCacheConfig.ts deleted file mode 100644 index d2bafccde7..0000000000 --- a/webui/lib/api/generated/models/types_DockerCacheConfig.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type types_DockerCacheConfig = { - duration?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - frequency?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - size?: number; -}; - diff --git a/webui/lib/api/generated/models/types_EvaluationBrokerConfig.ts b/webui/lib/api/generated/models/types_EvaluationBrokerConfig.ts deleted file mode 100644 index 7bc5f18161..0000000000 --- a/webui/lib/api/generated/models/types_EvaluationBrokerConfig.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type types_EvaluationBrokerConfig = { - evalBrokerInitialRetryDelay?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - evalBrokerMaxRetryCount?: number; - evalBrokerSubsequentRetryDelay?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - evalBrokerVisibilityTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; -}; - diff --git a/webui/lib/api/generated/models/types_FeatureConfig.ts b/webui/lib/api/generated/models/types_FeatureConfig.ts deleted file mode 100644 index 771abb5118..0000000000 --- a/webui/lib/api/generated/models/types_FeatureConfig.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_FeatureConfig = { - engines?: Array; - publishers?: Array; - storages?: Array; -}; - diff --git a/webui/lib/api/generated/models/types_FreeSpace.ts b/webui/lib/api/generated/models/types_FreeSpace.ts deleted file mode 100644 index 5b39df8a52..0000000000 --- a/webui/lib/api/generated/models/types_FreeSpace.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { types_MountStatus } from './types_MountStatus'; -export type types_FreeSpace = { - root?: types_MountStatus; - tmp?: types_MountStatus; -}; - diff --git a/webui/lib/api/generated/models/types_HealthInfo.ts b/webui/lib/api/generated/models/types_HealthInfo.ts deleted file mode 100644 index c518aa4fab..0000000000 --- a/webui/lib/api/generated/models/types_HealthInfo.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { types_FreeSpace } from './types_FreeSpace'; -export type types_HealthInfo = { - FreeSpace?: types_FreeSpace; -}; - diff --git a/webui/lib/api/generated/models/types_IpfsConfig.ts b/webui/lib/api/generated/models/types_IpfsConfig.ts deleted file mode 100644 index 6f4d233420..0000000000 --- a/webui/lib/api/generated/models/types_IpfsConfig.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_IpfsConfig = { - /** - * Connect is the multiaddress to connect to for IPFS. - */ - connect?: string; -}; - diff --git a/webui/lib/api/generated/models/types_JobStoreConfig.ts b/webui/lib/api/generated/models/types_JobStoreConfig.ts deleted file mode 100644 index 3145e756ed..0000000000 --- a/webui/lib/api/generated/models/types_JobStoreConfig.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { types_StorageType } from './types_StorageType'; -export type types_JobStoreConfig = { - path?: string; - type?: types_StorageType; -}; - diff --git a/webui/lib/api/generated/models/types_JobTimeoutConfig.ts b/webui/lib/api/generated/models/types_JobTimeoutConfig.ts deleted file mode 100644 index 39cb8caa16..0000000000 --- a/webui/lib/api/generated/models/types_JobTimeoutConfig.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type types_JobTimeoutConfig = { - /** - * DefaultJobExecutionTimeout default value for the execution timeout this compute node will assign to jobs with - * no timeout requirement defined. - */ - defaultJobExecutionTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - /** - * JobExecutionTimeoutClientIDBypassList is the list of clients that are allowed to bypass the job execution timeout - * check. - */ - jobExecutionTimeoutClientIDBypassList?: Array; - /** - * JobNegotiationTimeout default timeout value to hold a bid for a job - */ - jobNegotiationTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - /** - * MaxJobExecutionTimeout default value for the maximum execution timeout this compute node supports. Jobs with - * higher timeout requirements will not be bid on. - */ - maxJobExecutionTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - /** - * MinJobExecutionTimeout default value for the minimum execution timeout this compute node supports. Jobs with - * lower timeout requirements will not be bid on. - */ - minJobExecutionTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; -}; - diff --git a/webui/lib/api/generated/models/types_LocalPublisherConfig.ts b/webui/lib/api/generated/models/types_LocalPublisherConfig.ts deleted file mode 100644 index 73c86de222..0000000000 --- a/webui/lib/api/generated/models/types_LocalPublisherConfig.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_LocalPublisherConfig = { - address?: string; - directory?: string; - port?: number; -}; - diff --git a/webui/lib/api/generated/models/types_LogStreamConfig.ts b/webui/lib/api/generated/models/types_LogStreamConfig.ts deleted file mode 100644 index 8836c3210d..0000000000 --- a/webui/lib/api/generated/models/types_LogStreamConfig.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_LogStreamConfig = { - /** - * How many messages to buffer in the log stream channel, per stream - */ - channelBufferSize?: number; -}; - diff --git a/webui/lib/api/generated/models/types_LoggingConfig.ts b/webui/lib/api/generated/models/types_LoggingConfig.ts deleted file mode 100644 index ceada3b7de..0000000000 --- a/webui/lib/api/generated/models/types_LoggingConfig.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type types_LoggingConfig = { - /** - * logging running executions - */ - logRunningExecutionsInterval?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; -}; - diff --git a/webui/lib/api/generated/models/types_MetricsConfig.ts b/webui/lib/api/generated/models/types_MetricsConfig.ts deleted file mode 100644 index b1b1518f41..0000000000 --- a/webui/lib/api/generated/models/types_MetricsConfig.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_MetricsConfig = { - eventTracerPath?: string; -}; - diff --git a/webui/lib/api/generated/models/types_MountStatus.ts b/webui/lib/api/generated/models/types_MountStatus.ts deleted file mode 100644 index 5ff5e7a8b0..0000000000 --- a/webui/lib/api/generated/models/types_MountStatus.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_MountStatus = { - All?: number; - Free?: number; - Used?: number; -}; - diff --git a/webui/lib/api/generated/models/types_NetworkClusterConfig.ts b/webui/lib/api/generated/models/types_NetworkClusterConfig.ts deleted file mode 100644 index f6373658d9..0000000000 --- a/webui/lib/api/generated/models/types_NetworkClusterConfig.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_NetworkClusterConfig = { - advertisedAddress?: string; - name?: string; - peers?: Array; - port?: number; -}; - diff --git a/webui/lib/api/generated/models/types_NetworkConfig.ts b/webui/lib/api/generated/models/types_NetworkConfig.ts deleted file mode 100644 index 350c55b0b8..0000000000 --- a/webui/lib/api/generated/models/types_NetworkConfig.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { types_NetworkClusterConfig } from './types_NetworkClusterConfig'; -export type types_NetworkConfig = { - advertisedAddress?: string; - authSecret?: string; - cluster?: types_NetworkClusterConfig; - orchestrators?: Array; - port?: number; - storeDir?: string; -}; - diff --git a/webui/lib/api/generated/models/types_NodeConfig.ts b/webui/lib/api/generated/models/types_NodeConfig.ts deleted file mode 100644 index 914596bb57..0000000000 --- a/webui/lib/api/generated/models/types_NodeConfig.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -import type { logger_LogMode } from './logger_LogMode'; -import type { types_APIConfig } from './types_APIConfig'; -import type { types_ComputeConfig } from './types_ComputeConfig'; -import type { types_FeatureConfig } from './types_FeatureConfig'; -import type { types_IpfsConfig } from './types_IpfsConfig'; -import type { types_NetworkConfig } from './types_NetworkConfig'; -import type { types_RequesterConfig } from './types_RequesterConfig'; -import type { types_WebUIConfig } from './types_WebUIConfig'; -export type types_NodeConfig = { - /** - * AllowListedLocalPaths contains local paths that are allowed to be mounted into jobs - */ - allowListedLocalPaths?: Array; - clientAPI?: types_APIConfig; - compute?: types_ComputeConfig; - /** - * TODO(forrest) [refactor]: rename this to ExecutorStoragePath - * Deprecated: replaced by cfg.ComputeDir() - */ - computeStoragePath?: string; - /** - * What features should not be enabled even if installed - */ - disabledFeatures?: types_FeatureConfig; - downloadURLRequestRetries?: number; - downloadURLRequestTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - /** - * Deprecated: replaced by cfg.PluginsDir() - */ - executorPluginPath?: string; - ipfs?: types_IpfsConfig; - /** - * Labels to apply to the node that can be used for node selection and filtering - */ - labels?: Record; - loggingMode?: logger_LogMode; - name?: string; - nameProvider?: string; - network?: types_NetworkConfig; - requester?: types_RequesterConfig; - serverAPI?: types_APIConfig; - strictVersionMatch?: boolean; - /** - * Type is "compute", "requester" or both - */ - type?: Array; - volumeSizeRequestTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - /** - * Configuration for the web UI - */ - webUI?: types_WebUIConfig; -}; - diff --git a/webui/lib/api/generated/models/types_RequesterConfig.ts b/webui/lib/api/generated/models/types_RequesterConfig.ts deleted file mode 100644 index a462214507..0000000000 --- a/webui/lib/api/generated/models/types_RequesterConfig.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults'; -import type { models_FailureInjectionRequesterConfig } from './models_FailureInjectionRequesterConfig'; -import type { models_JobSelectionPolicy } from './models_JobSelectionPolicy'; -import type { types_DockerCacheConfig } from './types_DockerCacheConfig'; -import type { types_EvaluationBrokerConfig } from './types_EvaluationBrokerConfig'; -import type { types_JobStoreConfig } from './types_JobStoreConfig'; -import type { types_RequesterControlPlaneConfig } from './types_RequesterControlPlaneConfig'; -import type { types_SchedulerConfig } from './types_SchedulerConfig'; -import type { types_StorageProviderConfig } from './types_StorageProviderConfig'; -import type { types_WorkerConfig } from './types_WorkerConfig'; -export type types_RequesterConfig = { - controlPlaneSettings?: types_RequesterControlPlaneConfig; - defaultPublisher?: string; - evaluationBroker?: types_EvaluationBrokerConfig; - /** - * URL where to send external verification requests to. - */ - externalVerifierHook?: string; - failureInjectionConfig?: models_FailureInjectionRequesterConfig; - housekeepingBackgroundTaskInterval?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - jobDefaults?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults; - /** - * How the node decides what jobs to run. - */ - jobSelectionPolicy?: models_JobSelectionPolicy; - jobStore?: types_JobStoreConfig; - /** - * ManualNodeApproval is a flag that determines if nodes should be manually approved or not. - * By default, nodes are auto-approved to simplify upgrades, by setting this property to - * true, nodes will need to be manually approved before they are included in node selection. - */ - manualNodeApproval?: boolean; - nodeInfoStoreTTL?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - nodeRankRandomnessRange?: number; - overAskForBidsFactor?: number; - scheduler?: types_SchedulerConfig; - storageProvider?: types_StorageProviderConfig; - tagCache?: types_DockerCacheConfig; - translationEnabled?: boolean; - worker?: types_WorkerConfig; -}; - diff --git a/webui/lib/api/generated/models/types_RequesterControlPlaneConfig.ts b/webui/lib/api/generated/models/types_RequesterControlPlaneConfig.ts deleted file mode 100644 index 552e042f2d..0000000000 --- a/webui/lib/api/generated/models/types_RequesterControlPlaneConfig.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type types_RequesterControlPlaneConfig = { - /** - * This setting is the time period after which a compute node is considered to be unresponsive. - * If the compute node misses two of these frequencies, it will be marked as unknown. The compute - * node should have a frequency setting less than this one to ensure that it does not keep - * switching between unknown and active too frequently. - */ - heartbeatCheckFrequency?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - /** - * This is the pubsub topic that the compute node will use to send heartbeats to the requester node. - */ - heartbeatTopic?: string; - /** - * This is the time period after which a compute node is considered to be disconnected. If the compute - * node does not deliver a heartbeat every `NodeDisconnectedAfter` then it is considered disconnected. - */ - nodeDisconnectedAfter?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; -}; - diff --git a/webui/lib/api/generated/models/types_S3StorageProviderConfig.ts b/webui/lib/api/generated/models/types_S3StorageProviderConfig.ts deleted file mode 100644 index bfc3bd843a..0000000000 --- a/webui/lib/api/generated/models/types_S3StorageProviderConfig.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type types_S3StorageProviderConfig = { - preSignedURLDisabled?: boolean; - preSignedURLExpiration?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; -}; - diff --git a/webui/lib/api/generated/models/types_SchedulerConfig.ts b/webui/lib/api/generated/models/types_SchedulerConfig.ts deleted file mode 100644 index 64b97a3fda..0000000000 --- a/webui/lib/api/generated/models/types_SchedulerConfig.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type types_SchedulerConfig = { - nodeOverSubscriptionFactor?: number; - queueBackoff?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; -}; - diff --git a/webui/lib/api/generated/models/types_StorageProviderConfig.ts b/webui/lib/api/generated/models/types_StorageProviderConfig.ts deleted file mode 100644 index f3cf384908..0000000000 --- a/webui/lib/api/generated/models/types_StorageProviderConfig.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { types_S3StorageProviderConfig } from './types_S3StorageProviderConfig'; -export type types_StorageProviderConfig = { - s3?: types_S3StorageProviderConfig; -}; - diff --git a/webui/lib/api/generated/models/types_StorageType.ts b/webui/lib/api/generated/models/types_StorageType.ts deleted file mode 100644 index 1848edbc97..0000000000 --- a/webui/lib/api/generated/models/types_StorageType.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export enum types_StorageType { - UnknownStorage = 0, - BoltDB = 1, -} diff --git a/webui/lib/api/generated/models/types_TLSConfiguration.ts b/webui/lib/api/generated/models/types_TLSConfiguration.ts deleted file mode 100644 index 04a631f767..0000000000 --- a/webui/lib/api/generated/models/types_TLSConfiguration.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_TLSConfiguration = { - /** - * AutoCert specifies a hostname for a certificate to be obtained via ACME. - * This is only used by the server, and only by the requester node when it - * has a publicly resolvable domain name. - */ - autoCert?: string; - /** - * AutoCertCachePath specifies the directory where the autocert process - * will cache certificates to avoid rate limits. - */ - autoCertCachePath?: string; - /** - * SelfSignedCert will auto-generate a self-signed certificate for the - * requester node if TLS certificates have not been provided. - */ - selfSigned?: boolean; - /** - * ServerCertificate specifies the location of a TLS certificate to be used - * by the requester to serve TLS requests - */ - serverCertificate?: string; - /** - * ServerKey is the TLS server key to match the certificate to allow the - * requester to server TLS. - */ - serverKey?: string; -}; - diff --git a/webui/lib/api/generated/models/types_UserConfig.ts b/webui/lib/api/generated/models/types_UserConfig.ts deleted file mode 100644 index 63628349a8..0000000000 --- a/webui/lib/api/generated/models/types_UserConfig.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_UserConfig = { - installationID?: string; - /** - * KeyPath is deprecated - * Deprecated: replaced by cfg.UserKeyPath() - */ - keyPath?: string; -}; - diff --git a/webui/lib/api/generated/models/types_WebUIConfig.ts b/webui/lib/api/generated/models/types_WebUIConfig.ts deleted file mode 100644 index 5256663d80..0000000000 --- a/webui/lib/api/generated/models/types_WebUIConfig.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type types_WebUIConfig = { - enabled?: boolean; - port?: number; -}; - diff --git a/webui/lib/api/generated/models/types_WorkerConfig.ts b/webui/lib/api/generated/models/types_WorkerConfig.ts deleted file mode 100644 index 08c5176a3f..0000000000 --- a/webui/lib/api/generated/models/types_WorkerConfig.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration } from './github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration'; -export type types_WorkerConfig = { - workerCount?: number; - workerEvalDequeueBaseBackoff?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - workerEvalDequeueMaxBackoff?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; - workerEvalDequeueTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; -}; - diff --git a/webui/lib/api/generated/schemas.gen.ts b/webui/lib/api/generated/schemas.gen.ts deleted file mode 100644 index 9017ad8317..0000000000 --- a/webui/lib/api/generated/schemas.gen.ts +++ /dev/null @@ -1,2004 +0,0 @@ -// This file is auto-generated by @hey-api/openapi-ts - -export const apimodels_GetJobResponseSchema = { - type: 'object', - properties: { - Executions: { - '$ref': '#/definitions/apimodels.ListJobExecutionsResponse' - }, - History: { - '$ref': '#/definitions/apimodels.ListJobHistoryResponse' - }, - Job: { - '$ref': '#/definitions/models.Job' - } - } -} as const; - -export const apimodels_GetNodeResponseSchema = { - type: 'object', - properties: { - node: { - '$ref': '#/definitions/models.NodeState' - } - } -} as const; - -export const apimodels_GetVersionResponseSchema = { - type: 'object', - properties: { - BuildDate: { - type: 'string', - example: '2022-11-16T14:03:31Z' - }, - GOARCH: { - type: 'string', - example: 'amd64' - }, - GOOS: { - type: 'string', - example: 'linux' - }, - GitCommit: { - type: 'string', - example: 'd612b63108f2b5ce1ab2b9e02444eb1dac1d922d' - }, - GitVersion: { - type: 'string', - example: 'v0.3.12' - }, - Major: { - type: 'string', - example: '0' - }, - Minor: { - type: 'string', - example: '3' - } - } -} as const; - -export const apimodels_HTTPCredentialSchema = { - type: 'object', - properties: { - params: { - description: `For authorization schemes that provide multiple values, a map of names to -values providing the credential`, - type: 'object', - additionalProperties: { - type: 'string' - } - }, - scheme: { - description: `An HTTP authorization scheme, such as one registered with IANA -https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml`, - type: 'string' - }, - value: { - description: `For authorization schemes that only provide a single value, such as -Basic, the single string value providing the credential`, - type: 'string' - } - } -} as const; - -export const apimodels_ListJobExecutionsResponseSchema = { - type: 'object', - properties: { - Items: { - type: 'array', - items: { - '$ref': '#/definitions/models.Execution' - } - }, - NextToken: { - type: 'string' - } - } -} as const; - -export const apimodels_ListJobHistoryResponseSchema = { - type: 'object', - properties: { - Items: { - type: 'array', - items: { - '$ref': '#/definitions/models.JobHistory' - } - }, - NextToken: { - type: 'string' - } - } -} as const; - -export const apimodels_ListJobResultsResponseSchema = { - type: 'object', - properties: { - Items: { - type: 'array', - items: { - '$ref': '#/definitions/models.SpecConfig' - } - }, - NextToken: { - type: 'string' - } - } -} as const; - -export const apimodels_ListJobsResponseSchema = { - type: 'object', - properties: { - Items: { - type: 'array', - items: { - '$ref': '#/definitions/models.Job' - } - }, - NextToken: { - type: 'string' - } - } -} as const; - -export const apimodels_ListNodesResponseSchema = { - type: 'object', - properties: { - NextToken: { - type: 'string' - }, - nodes: { - type: 'array', - items: { - '$ref': '#/definitions/models.NodeState' - } - } - } -} as const; - -export const apimodels_PutJobRequestSchema = { - type: 'object', - properties: { - Job: { - '$ref': '#/definitions/models.Job' - }, - credential: { - '$ref': '#/definitions/apimodels.HTTPCredential' - }, - idempotencyToken: { - type: 'string' - }, - namespace: { - type: 'string' - } - } -} as const; - -export const apimodels_PutJobResponseSchema = { - type: 'object', - properties: { - EvaluationID: { - type: 'string' - }, - JobID: { - type: 'string' - }, - Warnings: { - type: 'array', - items: { - type: 'string' - } - } - } -} as const; - -export const apimodels_PutNodeRequestSchema = { - type: 'object', - properties: { - action: { - type: 'string' - }, - credential: { - '$ref': '#/definitions/apimodels.HTTPCredential' - }, - idempotencyToken: { - type: 'string' - }, - message: { - type: 'string' - }, - namespace: { - type: 'string' - }, - nodeID: { - type: 'string' - } - } -} as const; - -export const apimodels_PutNodeResponseSchema = { - type: 'object', - properties: { - error: { - type: 'string' - }, - success: { - type: 'boolean' - } - } -} as const; - -export const apimodels_StopJobResponseSchema = { - type: 'object', - properties: { - EvaluationID: { - type: 'string' - } - } -} as const; - -export const authn_MethodTypeSchema = { - type: 'string', - enum: ['challenge', 'ask'], - 'x-enum-varnames': ['MethodTypeChallenge', 'MethodTypeAsk'] -} as const; - -export const logger_LogModeSchema = { - type: 'string', - enum: ['default', 'station', 'json', 'combined', 'event'], - 'x-enum-varnames': ['LogModeDefault', 'LogModeStation', 'LogModeJSON', 'LogModeCombined', 'LogModeEvent'] -} as const; - -export const models_AllocatedResourcesSchema = { - type: 'object', - properties: { - Tasks: { - type: 'object', - additionalProperties: { - '$ref': '#/definitions/models.Resources' - } - } - } -} as const; - -export const models_BuildVersionInfoSchema = { - type: 'object', - properties: { - BuildDate: { - type: 'string', - example: '2022-11-16T14:03:31Z' - }, - GOARCH: { - type: 'string', - example: 'amd64' - }, - GOOS: { - type: 'string', - example: 'linux' - }, - GitCommit: { - type: 'string', - example: 'd612b63108f2b5ce1ab2b9e02444eb1dac1d922d' - }, - GitVersion: { - type: 'string', - example: 'v0.3.12' - }, - Major: { - type: 'string', - example: '0' - }, - Minor: { - type: 'string', - example: '3' - } - } -} as const; - -export const models_ComputeNodeInfoSchema = { - type: 'object', - properties: { - AvailableCapacity: { - '$ref': '#/definitions/models.Resources' - }, - EnqueuedExecutions: { - type: 'integer' - }, - ExecutionEngines: { - type: 'array', - items: { - type: 'string' - } - }, - MaxCapacity: { - '$ref': '#/definitions/models.Resources' - }, - MaxJobRequirements: { - '$ref': '#/definitions/models.Resources' - }, - Publishers: { - type: 'array', - items: { - type: 'string' - } - }, - QueueCapacity: { - '$ref': '#/definitions/models.Resources' - }, - RunningExecutions: { - type: 'integer' - }, - StorageSources: { - type: 'array', - items: { - type: 'string' - } - } - } -} as const; - -export const models_DebugInfoSchema = { - type: 'object', - properties: { - component: { - type: 'string' - }, - info: {} - } -} as const; - -export const models_EventSchema = { - type: 'object', - properties: { - Details: { - description: `Any additional metadata that the system or user may need to know about -the event in order to handle it properly.`, - type: 'object', - additionalProperties: { - type: 'string' - } - }, - Message: { - description: `A human-readable string giving the user all the information they need to -understand and respond to an Event, if a response is required.`, - type: 'string' - }, - Timestamp: { - description: `The moment the event occurred, which may be different to the moment it -was recorded.`, - type: 'string' - }, - Topic: { - description: 'The topic of the event. See the documentation on EventTopic.', - type: 'string' - } - } -} as const; - -export const models_ExecutionSchema = { - type: 'object', - properties: { - AllocatedResources: { - description: 'AllocatedResources is the total resources allocated for the execution tasks.', - allOf: [ - { - '$ref': '#/definitions/models.AllocatedResources' - } - ] - }, - ComputeState: { - description: 'ComputeState observed state of the execution on the compute node', - allOf: [ - { - '$ref': '#/definitions/models.State-models_ExecutionStateType' - } - ] - }, - CreateTime: { - description: `CreateTime is the time the execution has finished scheduling and been -verified by the plan applier.`, - type: 'integer' - }, - DesiredState: { - description: 'DesiredState of the execution on the compute node', - allOf: [ - { - '$ref': '#/definitions/models.State-models_ExecutionDesiredStateType' - } - ] - }, - EvalID: { - description: 'ID of the evaluation that generated this execution', - type: 'string' - }, - FollowupEvalID: { - description: `FollowupEvalID captures a follow up evaluation created to handle a failed execution -that can be rescheduled in the future`, - type: 'string' - }, - ID: { - description: 'ID of the execution (UUID)', - type: 'string' - }, - Job: { - description: 'TODO: evaluate using a copy of the job instead of a pointer', - allOf: [ - { - '$ref': '#/definitions/models.Job' - } - ] - }, - JobID: { - description: `Job is the parent job of the task being allocated. -This is copied at execution time to avoid issues if the job -definition is updated.`, - type: 'string' - }, - ModifyTime: { - description: 'ModifyTime is the time the execution was last updated.', - type: 'integer' - }, - Name: { - description: 'Name is a logical name of the execution.', - type: 'string' - }, - Namespace: { - description: 'Namespace is the namespace the execution is created in', - type: 'string' - }, - NextExecution: { - description: 'NextExecution is the execution that this execution is being replaced by', - type: 'string' - }, - NodeID: { - description: 'NodeID is the node this is being placed on', - type: 'string' - }, - PreviousExecution: { - description: 'PreviousExecution is the execution that this execution is replacing', - type: 'string' - }, - PublishedResult: { - description: 'the published results for this execution', - allOf: [ - { - '$ref': '#/definitions/models.SpecConfig' - } - ] - }, - Revision: { - description: 'Revision is increment each time the execution is updated.', - type: 'integer' - }, - RunOutput: { - description: `RunOutput is the output of the run command -TODO: evaluate removing this from execution spec in favour of calling \`bacalhau job logs\``, - allOf: [ - { - '$ref': '#/definitions/models.RunCommandResult' - } - ] - } - } -} as const; - -export const models_ExecutionDesiredStateTypeSchema = { - type: 'integer', - enum: [0, 1, 2], - 'x-enum-varnames': ['ExecutionDesiredStatePending', 'ExecutionDesiredStateRunning', 'ExecutionDesiredStateStopped'] -} as const; - -export const models_ExecutionLogSchema = { - type: 'object', - properties: { - line: { - type: 'string' - }, - type: { - '$ref': '#/definitions/models.ExecutionLogType' - } - } -} as const; - -export const models_ExecutionLogTypeSchema = { - type: 'integer', - enum: [0, 1, 2], - 'x-enum-varnames': ['executionLogTypeUnknown', 'ExecutionLogTypeSTDOUT', 'ExecutionLogTypeSTDERR'] -} as const; - -export const models_ExecutionStateTypeSchema = { - type: 'integer', - enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], - 'x-enum-comments': { - ExecutionStateBidAccepted: 'aka running' - }, - 'x-enum-varnames': ['ExecutionStateUndefined', 'ExecutionStateNew', 'ExecutionStateAskForBid', 'ExecutionStateAskForBidAccepted', 'ExecutionStateAskForBidRejected', 'ExecutionStateBidAccepted', 'ExecutionStateBidRejected', 'ExecutionStateCompleted', 'ExecutionStateFailed', 'ExecutionStateCancelled'] -} as const; - -export const models_FailureInjectionRequesterConfigSchema = { - type: 'object', - properties: { - isBadActor: { - type: 'boolean' - } - } -} as const; - -export const models_GPUSchema = { - type: 'object', - properties: { - index: { - description: 'Self-reported index of the device in the system', - type: 'integer' - }, - memory: { - description: 'Total GPU memory in mebibytes (MiB)', - type: 'integer' - }, - name: { - description: 'Model name of the GPU e.g. Tesla T4', - type: 'string' - }, - pciaddress: { - description: `PCI address of the device, in the format AAAA:BB:CC.C -Used to discover the correct device rendering cards`, - type: 'string' - }, - vendor: { - description: 'Maker of the GPU, e.g. NVidia, AMD, Intel', - allOf: [ - { - '$ref': '#/definitions/models.GPUVendor' - } - ] - } - } -} as const; - -export const models_GPUVendorSchema = { - type: 'string', - enum: ['NVIDIA', 'AMD/ATI', 'Intel'], - 'x-enum-varnames': ['GPUVendorNvidia', 'GPUVendorAMDATI', 'GPUVendorIntel'] -} as const; - -export const models_InputSourceSchema = { - type: 'object', - properties: { - Alias: { - description: `Alias is an optional reference to this input source that can be used for -dynamic linking to this input. (e.g. dynamic import in wasm by alias)`, - type: 'string' - }, - Source: { - description: 'Source is the source of the artifact to be downloaded, e.g a URL, S3 bucket, etc.', - allOf: [ - { - '$ref': '#/definitions/models.SpecConfig' - } - ] - }, - Target: { - description: 'Target is the path where the artifact should be mounted on', - type: 'string' - } - } -} as const; - -export const models_JobSchema = { - type: 'object', - properties: { - Constraints: { - description: 'Constraints is a selector which must be true for the compute node to run this job.', - type: 'array', - items: { - '$ref': '#/definitions/models.LabelSelectorRequirement' - } - }, - Count: { - description: 'Count is the number of replicas that should be scheduled.', - type: 'integer' - }, - CreateTime: { - type: 'integer' - }, - ID: { - description: `ID is a unique identifier assigned to this job. -It helps to distinguish jobs with the same name after they have been deleted and re-created. -The ID is generated by the server and should not be set directly by the client.`, - type: 'string' - }, - Labels: { - description: `Labels is used to associate arbitrary labels with this job, which can be used -for filtering. -key=value`, - type: 'object', - additionalProperties: { - type: 'string' - } - }, - Meta: { - description: 'Meta is used to associate arbitrary metadata with this job.', - type: 'object', - additionalProperties: { - type: 'string' - } - }, - ModifyTime: { - type: 'integer' - }, - Name: { - description: `Name is the logical name of the job used to refer to it. -Submitting a job with the same name as an existing job will result in an -update to the existing job.`, - type: 'string' - }, - Namespace: { - description: 'Namespace is the namespace this job is running in.', - type: 'string' - }, - Priority: { - description: 'Priority defines the scheduling priority of this job.', - type: 'integer' - }, - Revision: { - description: `Revision is a per-job monotonically increasing revision number that is incremented -on each update to the job's state or specification`, - type: 'integer' - }, - State: { - description: 'State is the current state of the job.', - allOf: [ - { - '$ref': '#/definitions/models.State-models_JobStateType' - } - ] - }, - Tasks: { - type: 'array', - items: { - '$ref': '#/definitions/models.Task' - } - }, - Type: { - description: 'Type is the type of job this is, e.g. "daemon" or "batch".', - type: 'string' - }, - Version: { - description: `Version is a per-job monotonically increasing version number that is incremented -on each job specification update.`, - type: 'integer' - } - } -} as const; - -export const models_JobHistorySchema = { - type: 'object', - properties: { - Event: { - '$ref': '#/definitions/models.Event' - }, - ExecutionID: { - type: 'string' - }, - ExecutionState: { - description: 'Deprecated: Left for backward compatibility with v1.4.x clients', - allOf: [ - { - '$ref': '#/definitions/models.StateChange-models_ExecutionStateType' - } - ] - }, - JobID: { - type: 'string' - }, - JobState: { - description: `TODO: remove with v1.5 -Deprecated: Left for backward compatibility with v1.4.x clients`, - allOf: [ - { - '$ref': '#/definitions/models.StateChange-models_JobStateType' - } - ] - }, - Time: { - type: 'string' - }, - Type: { - '$ref': '#/definitions/models.JobHistoryType' - } - } -} as const; - -export const models_JobHistoryTypeSchema = { - type: 'integer', - enum: [0, 1, 2], - 'x-enum-varnames': ['JobHistoryTypeUndefined', 'JobHistoryTypeJobLevel', 'JobHistoryTypeExecutionLevel'] -} as const; - -export const models_JobSelectionDataLocalitySchema = { - type: 'integer', - enum: [0, 1], - 'x-enum-comments': { - Anywhere: 'anywhere', - Local: 'local' - }, - 'x-enum-varnames': ['Local', 'Anywhere'] -} as const; - -export const models_JobSelectionPolicySchema = { - type: 'object', - properties: { - accept_networked_jobs: { - description: `should we accept jobs that specify networking -the default is "reject"`, - type: 'boolean' - }, - locality: { - description: `this describes if we should run a job based on -where the data is located - i.e. if the data is "local" -or if the data is "anywhere"`, - allOf: [ - { - '$ref': '#/definitions/models.JobSelectionDataLocality' - } - ] - }, - probe_exec: { - type: 'string' - }, - probe_http: { - description: `external hooks that decide if we should take on the job or not -if either of these are given they will override the data locality settings`, - type: 'string' - }, - reject_stateless_jobs: { - description: `should we reject jobs that don't specify any data -the default is "accept"`, - type: 'boolean' - } - } -} as const; - -export const models_JobStateTypeSchema = { - type: 'integer', - enum: [0, 1, 2, 3, 4, 5, 6], - 'x-enum-varnames': ['JobStateTypeUndefined', 'JobStateTypePending', 'JobStateTypeQueued', 'JobStateTypeRunning', 'JobStateTypeCompleted', 'JobStateTypeFailed', 'JobStateTypeStopped'] -} as const; - -export const models_LabelSelectorRequirementSchema = { - type: 'object', - properties: { - Key: { - description: 'key is the label key that the selector applies to.', - type: 'string' - }, - Operator: { - description: `operator represents a key's relationship to a set of values. -Valid operators are In, NotIn, Exists and KeyNotInImap.`, - allOf: [ - { - '$ref': '#/definitions/selection.Operator' - } - ] - }, - Values: { - description: `values is an array of string values. If the operator is In or NotIn, -the values array must be non-empty. If the operator is Exists or KeyNotInImap, -the values array must be empty. This array is replaced during a strategic`, - type: 'array', - items: { - type: 'string' - } - } - } -} as const; - -export const models_NetworkSchema = { - type: 'integer', - enum: [0, 1, 2], - 'x-enum-varnames': ['NetworkNone', 'NetworkFull', 'NetworkHTTP'] -} as const; - -export const models_NetworkConfigSchema = { - type: 'object', - properties: { - Domains: { - type: 'array', - items: { - type: 'string' - } - }, - Type: { - '$ref': '#/definitions/models.Network' - } - } -} as const; - -export const models_NodeConnectionStateSchema = { - type: 'object', - properties: { - connection: { - type: 'integer', - enum: [0, 1], - 'x-enum-varnames': ['connected', 'disconnected'] - } - } -} as const; - -export const models_NodeInfoSchema = { - type: 'object', - properties: { - BacalhauVersion: { - '$ref': '#/definitions/models.BuildVersionInfo' - }, - ComputeNodeInfo: { - '$ref': '#/definitions/models.ComputeNodeInfo' - }, - Labels: { - type: 'object', - additionalProperties: { - type: 'string' - } - }, - NodeID: { - description: 'TODO replace all access on this field with the `ID()` method', - type: 'string' - }, - NodeType: { - '$ref': '#/definitions/models.NodeType' - } - } -} as const; - -export const models_NodeMembershipStateSchema = { - type: 'object', - properties: { - membership: { - type: 'integer', - enum: [0, 1, 2, 3], - 'x-enum-varnames': ['unknown', 'pending', 'approved', 'rejected'] - } - } -} as const; - -export const models_NodeStateSchema = { - type: 'object', - properties: { - Connection: { - '$ref': '#/definitions/models.NodeConnectionState' - }, - Info: { - '$ref': '#/definitions/models.NodeInfo' - }, - Membership: { - '$ref': '#/definitions/models.NodeMembershipState' - } - } -} as const; - -export const models_NodeTypeSchema = { - type: 'integer', - enum: [0, 1, 2], - 'x-enum-varnames': ['nodeTypeUndefined', 'NodeTypeRequester', 'NodeTypeCompute'] -} as const; - -export const models_ResourcesSchema = { - type: 'object', - properties: { - CPU: { - description: 'CPU units', - type: 'number' - }, - Disk: { - description: 'Disk in bytes', - type: 'integer' - }, - GPU: { - description: 'GPU units', - type: 'integer' - }, - GPUs: { - description: 'GPU details', - type: 'array', - items: { - '$ref': '#/definitions/models.GPU' - } - }, - Memory: { - description: 'Memory in bytes', - type: 'integer' - } - } -} as const; - -export const models_ResourcesConfigSchema = { - type: 'object', - properties: { - CPU: { - description: 'CPU https://github.com/BTBurke/k8sresource string', - type: 'string' - }, - Disk: { - description: 'Memory github.com/dustin/go-humanize string', - type: 'string' - }, - GPU: { - type: 'string' - }, - Memory: { - description: 'Memory github.com/dustin/go-humanize string', - type: 'string' - } - } -} as const; - -export const models_ResultPathSchema = { - type: 'object', - properties: { - Name: { - description: 'Name', - type: 'string' - }, - Path: { - description: 'The path to the file/dir', - type: 'string' - } - } -} as const; - -export const models_RunCommandResultSchema = { - type: 'object', - properties: { - ErrorMsg: { - description: 'Runner error', - type: 'string' - }, - ExitCode: { - description: 'exit code of the run.', - type: 'integer' - }, - StderrTruncated: { - description: 'bool describing if stderr was truncated', - type: 'boolean' - }, - Stdout: { - description: 'stdout of the run. Yaml provided for `describe` output', - type: 'string' - }, - StdoutTruncated: { - description: 'bool describing if stdout was truncated', - type: 'boolean' - }, - stderr: { - description: 'stderr of the run.', - type: 'string' - } - } -} as const; - -export const models_SpecConfigSchema = { - type: 'object', - properties: { - Params: { - description: 'Params is a map of the config params', - type: 'object', - additionalProperties: true - }, - Type: { - description: 'Type of the config', - type: 'string' - } - } -} as const; - -export const models_State_models_ExecutionDesiredStateTypeSchema = { - type: 'object', - properties: { - Message: { - description: 'Message is a human readable message describing the state.', - type: 'string' - }, - StateType: { - description: 'StateType is the current state of the object.', - allOf: [ - { - '$ref': '#/definitions/models.ExecutionDesiredStateType' - } - ] - } - } -} as const; - -export const models_State_models_ExecutionStateTypeSchema = { - type: 'object', - properties: { - Message: { - description: 'Message is a human readable message describing the state.', - type: 'string' - }, - StateType: { - description: 'StateType is the current state of the object.', - allOf: [ - { - '$ref': '#/definitions/models.ExecutionStateType' - } - ] - } - } -} as const; - -export const models_State_models_JobStateTypeSchema = { - type: 'object', - properties: { - Message: { - description: 'Message is a human readable message describing the state.', - type: 'string' - }, - StateType: { - description: 'StateType is the current state of the object.', - allOf: [ - { - '$ref': '#/definitions/models.JobStateType' - } - ] - } - } -} as const; - -export const models_StateChange_models_ExecutionStateTypeSchema = { - type: 'object', - properties: { - New: { - '$ref': '#/definitions/models.ExecutionStateType' - }, - Previous: { - '$ref': '#/definitions/models.ExecutionStateType' - } - } -} as const; - -export const models_StateChange_models_JobStateTypeSchema = { - type: 'object', - properties: { - New: { - '$ref': '#/definitions/models.JobStateType' - }, - Previous: { - '$ref': '#/definitions/models.JobStateType' - } - } -} as const; - -export const models_TaskSchema = { - type: 'object', - properties: { - Engine: { - '$ref': '#/definitions/models.SpecConfig' - }, - Env: { - description: 'Map of environment variables to be used by the driver', - type: 'object', - additionalProperties: { - type: 'string' - } - }, - InputSources: { - description: `InputSources is a list of remote artifacts to be downloaded before running the task -and mounted into the task.`, - type: 'array', - items: { - '$ref': '#/definitions/models.InputSource' - } - }, - Meta: { - description: 'Meta is used to associate arbitrary metadata with this task.', - type: 'object', - additionalProperties: { - type: 'string' - } - }, - Name: { - description: 'Name of the task', - type: 'string' - }, - Network: { - '$ref': '#/definitions/models.NetworkConfig' - }, - Publisher: { - '$ref': '#/definitions/models.SpecConfig' - }, - Resources: { - description: 'ResourcesConfig is the resources needed by this task', - allOf: [ - { - '$ref': '#/definitions/models.ResourcesConfig' - } - ] - }, - ResultPaths: { - description: "ResultPaths is a list of task volumes to be included in the task's published result", - type: 'array', - items: { - '$ref': '#/definitions/models.ResultPath' - } - }, - Timeouts: { - '$ref': '#/definitions/models.TimeoutConfig' - } - } -} as const; - -export const models_TimeoutConfigSchema = { - type: 'object', - properties: { - ExecutionTimeout: { - description: `ExecutionTimeout is the maximum amount of time a task is allowed to run in seconds. -Zero means no timeout, such as for a daemon task.`, - type: 'integer' - }, - QueueTimeout: { - description: `QueueTimeout is the maximum amount of time a task is allowed to wait in the orchestrator -queue in seconds before being scheduled. Zero means no timeout.`, - type: 'integer' - }, - TotalTimeout: { - description: `TotalTimeout is the maximum amount of time a task is allowed to complete in seconds. -This includes the time spent in the queue, the time spent executing and the time spent retrying. -Zero means no timeout.`, - type: 'integer' - } - } -} as const; - -export const selection_OperatorSchema = { - type: 'string', - enum: ['!', '=', '==', 'in', '!=', 'notin', 'exists', 'gt', 'lt'], - 'x-enum-varnames': ['DoesNotExist', 'Equals', 'DoubleEquals', 'In', 'NotEquals', 'NotIn', 'Exists', 'GreaterThan', 'LessThan'] -} as const; - -export const shared_VersionRequestSchema = { - type: 'object', - properties: { - client_id: { - type: 'string', - example: 'ac13188e93c97a9c2e7cf8e86c7313156a73436036f30da1ececc2ce79f9ea51' - } - } -} as const; - -export const shared_VersionResponseSchema = { - type: 'object', - properties: { - build_version_info: { - '$ref': '#/definitions/models.BuildVersionInfo' - } - } -} as const; - -export const types_APIConfigSchema = { - type: 'object', - properties: { - clientTLS: { - description: `ClientTLS specifies tls options for the client connecting to the -API.`, - allOf: [ - { - '$ref': '#/definitions/types.ClientTLSConfig' - } - ] - }, - host: { - description: "Host is the hostname of an environment's public API servers.", - type: 'string' - }, - port: { - description: 'Port is the port that an environment serves the public API on.', - type: 'integer' - }, - tls: { - description: `TLS returns information about how TLS is configured for the public server. -This is only used in APIConfig for NodeConfig.ServerAPI`, - allOf: [ - { - '$ref': '#/definitions/types.TLSConfiguration' - } - ] - } - } -} as const; - -export const types_AuthConfigSchema = { - type: 'object', - properties: { - accessPolicyPath: { - description: `AccessPolicyPath is the path to a file or directory that will be loaded as -the policy to apply to all inbound API requests. If unspecified, a policy -that permits access to all API endpoints to both authenticated and -unauthenticated users (the default as of v1.2.0) will be used.`, - type: 'string' - }, - methods: { - description: `Methods maps "method names" to authenticator implementations. A method -name is a human-readable string chosen by the person configuring the -system that is shown to users to help them pick the authentication method -they want to use. There can be multiple usages of the same Authenticator -*type* but with different configs and parameters, each identified with a -unique method name. - -For example, if an implementation wants to allow users to log in with -Github or Bitbucket, they might both use an authenticator implementation -of type "oidc", and each would appear once on this provider with key / -method name "github" and "bitbucket". - -By default, only a single authentication method that accepts -authentication via client keys will be enabled.`, - type: 'object', - additionalProperties: { - '$ref': '#/definitions/types.AuthenticatorConfig' - } - }, - tokensPath: { - description: `TokensPath is the location where a state file of tokens will be stored. -By default it will be local to the Bacalhau repo, but can be any location -in the host filesystem. Tokens are sensitive and should be stored in a -location that is only readable to the current user. -Deprecated: replaced by cfg.AuthTokensPath()`, - type: 'string' - } - } -} as const; - -export const types_AuthenticatorConfigSchema = { - type: 'object', - properties: { - policyPath: { - type: 'string' - }, - type: { - '$ref': '#/definitions/authn.MethodType' - } - } -} as const; - -export const types_BacalhauConfigSchema = { - type: 'object', - properties: { - auth: { - '$ref': '#/definitions/types.AuthConfig' - }, - dataDir: { - description: "NB(forrest): this field shouldn't be persisted yet.", - type: 'string' - }, - metrics: { - '$ref': '#/definitions/types.MetricsConfig' - }, - node: { - '$ref': '#/definitions/types.NodeConfig' - }, - update: { - '$ref': '#/definitions/types.UpdateConfig' - }, - user: { - '$ref': '#/definitions/types.UserConfig' - } - } -} as const; - -export const types_CapacityConfigSchema = { - type: 'object', - properties: { - defaultJobResourceLimits: { - '$ref': '#/definitions/models.ResourcesConfig' - }, - ignorePhysicalResourceLimits: { - type: 'boolean' - }, - jobResourceLimits: { - description: 'Per job amount of resource the system can be using at one time.', - allOf: [ - { - '$ref': '#/definitions/models.ResourcesConfig' - } - ] - }, - totalResourceLimits: { - description: 'Total amount of resource the system can be using at one time in aggregate for all jobs.', - allOf: [ - { - '$ref': '#/definitions/models.ResourcesConfig' - } - ] - } - } -} as const; - -export const types_ClientTLSConfigSchema = { - type: 'object', - properties: { - cacert: { - description: `Used for NodeConfig.ClientAPI, specifies the location of a ca certificate -file (primarily for self-signed server certs). Will use HTTPS for requests.`, - type: 'string' - }, - insecure: { - description: `Used for NodeConfig.ClientAPI, and when true instructs the client to use -HTTPS, but not to attempt to verify the certificate.`, - type: 'boolean' - }, - useTLS: { - description: `Used for NodeConfig.ClientAPI, instructs the client to connect over -TLS. Auto enabled if Insecure or CACert are specified.`, - type: 'boolean' - } - } -} as const; - -export const types_ComputeConfigSchema = { - type: 'object', - properties: { - capacity: { - '$ref': '#/definitions/types.CapacityConfig' - }, - controlPlaneSettings: { - '$ref': '#/definitions/types.ComputeControlPlaneConfig' - }, - executionStore: { - '$ref': '#/definitions/types.JobStoreConfig' - }, - jobSelection: { - '$ref': '#/definitions/models.JobSelectionPolicy' - }, - jobTimeouts: { - '$ref': '#/definitions/types.JobTimeoutConfig' - }, - localPublisher: { - '$ref': '#/definitions/types.LocalPublisherConfig' - }, - logStreamConfig: { - '$ref': '#/definitions/types.LogStreamConfig' - }, - logging: { - '$ref': '#/definitions/types.LoggingConfig' - }, - manifestCache: { - '$ref': '#/definitions/types.DockerCacheConfig' - } - } -} as const; - -export const types_ComputeControlPlaneConfigSchema = { - type: 'object', - properties: { - heartbeatFrequency: { - description: `How often the compute node will send a heartbeat to the requester node to let it know -that the compute node is still alive. This should be less than the requester's configured -heartbeat timeout to avoid flapping.`, - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - }, - heartbeatTopic: { - description: 'This is the pubsub topic that the compute node will use to send heartbeats to the requester node.', - type: 'string' - }, - infoUpdateFrequency: { - description: `The frequency with which the compute node will send node info (inc current labels) -to the controlling requester node.`, - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - }, - resourceUpdateFrequency: { - description: 'How often the compute node will send current resource availability to the requester node.', - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - } - } -} as const; - -export const types_DockerCacheConfigSchema = { - type: 'object', - properties: { - duration: { - '$ref': '#/definitions/types.Duration' - }, - frequency: { - '$ref': '#/definitions/types.Duration' - }, - size: { - type: 'integer' - } - } -} as const; - -export const types_DurationSchema = { - type: 'integer', - enum: [-9223372036854776000, 9223372036854776000, 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000], - 'x-enum-varnames': ['minDuration', 'maxDuration', 'Nanosecond', 'Microsecond', 'Millisecond', 'Second', 'Minute', 'Hour'] -} as const; - -export const types_EvaluationBrokerConfigSchema = { - type: 'object', - properties: { - evalBrokerInitialRetryDelay: { - '$ref': '#/definitions/types.Duration' - }, - evalBrokerMaxRetryCount: { - type: 'integer' - }, - evalBrokerSubsequentRetryDelay: { - '$ref': '#/definitions/types.Duration' - }, - evalBrokerVisibilityTimeout: { - '$ref': '#/definitions/types.Duration' - } - } -} as const; - -export const types_FeatureConfigSchema = { - type: 'object', - properties: { - engines: { - type: 'array', - items: { - type: 'string' - } - }, - publishers: { - type: 'array', - items: { - type: 'string' - } - }, - storages: { - type: 'array', - items: { - type: 'string' - } - } - } -} as const; - -export const types_FreeSpaceSchema = { - type: 'object', - properties: { - root: { - '$ref': '#/definitions/types.MountStatus' - }, - tmp: { - '$ref': '#/definitions/types.MountStatus' - } - } -} as const; - -export const types_HealthInfoSchema = { - type: 'object', - properties: { - FreeSpace: { - '$ref': '#/definitions/types.FreeSpace' - } - } -} as const; - -export const types_IpfsConfigSchema = { - type: 'object', - properties: { - connect: { - description: 'Connect is the multiaddress to connect to for IPFS.', - type: 'string' - } - } -} as const; - -export const types_JobDefaultsSchema = { - type: 'object', - properties: { - executionTimeout: { - '$ref': '#/definitions/types.Duration' - }, - queueTimeout: { - '$ref': '#/definitions/types.Duration' - }, - totalTimeout: { - '$ref': '#/definitions/types.Duration' - } - } -} as const; - -export const types_JobStoreConfigSchema = { - type: 'object', - properties: { - path: { - type: 'string' - }, - type: { - '$ref': '#/definitions/types.StorageType' - } - } -} as const; - -export const types_JobTimeoutConfigSchema = { - type: 'object', - properties: { - defaultJobExecutionTimeout: { - description: `DefaultJobExecutionTimeout default value for the execution timeout this compute node will assign to jobs with -no timeout requirement defined.`, - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - }, - jobExecutionTimeoutClientIDBypassList: { - description: `JobExecutionTimeoutClientIDBypassList is the list of clients that are allowed to bypass the job execution timeout -check.`, - type: 'array', - items: { - type: 'string' - } - }, - jobNegotiationTimeout: { - description: 'JobNegotiationTimeout default timeout value to hold a bid for a job', - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - }, - maxJobExecutionTimeout: { - description: `MaxJobExecutionTimeout default value for the maximum execution timeout this compute node supports. Jobs with -higher timeout requirements will not be bid on.`, - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - }, - minJobExecutionTimeout: { - description: `MinJobExecutionTimeout default value for the minimum execution timeout this compute node supports. Jobs with -lower timeout requirements will not be bid on.`, - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - } - } -} as const; - -export const types_LocalPublisherConfigSchema = { - type: 'object', - properties: { - address: { - type: 'string' - }, - directory: { - type: 'string' - }, - port: { - type: 'integer' - } - } -} as const; - -export const types_LogStreamConfigSchema = { - type: 'object', - properties: { - channelBufferSize: { - description: 'How many messages to buffer in the log stream channel, per stream', - type: 'integer' - } - } -} as const; - -export const types_LoggingConfigSchema = { - type: 'object', - properties: { - logRunningExecutionsInterval: { - description: 'logging running executions', - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - } - } -} as const; - -export const types_MetricsConfigSchema = { - type: 'object', - properties: { - eventTracerPath: { - type: 'string' - } - } -} as const; - -export const types_MountStatusSchema = { - type: 'object', - properties: { - All: { - type: 'integer' - }, - Free: { - type: 'integer' - }, - Used: { - type: 'integer' - } - } -} as const; - -export const types_NetworkClusterConfigSchema = { - type: 'object', - properties: { - advertisedAddress: { - type: 'string' - }, - name: { - type: 'string' - }, - peers: { - type: 'array', - items: { - type: 'string' - } - }, - port: { - type: 'integer' - } - } -} as const; - -export const types_NetworkConfigSchema = { - type: 'object', - properties: { - advertisedAddress: { - type: 'string' - }, - authSecret: { - type: 'string' - }, - cluster: { - '$ref': '#/definitions/types.NetworkClusterConfig' - }, - orchestrators: { - type: 'array', - items: { - type: 'string' - } - }, - port: { - type: 'integer' - }, - storeDir: { - type: 'string' - } - } -} as const; - -export const types_NodeConfigSchema = { - type: 'object', - properties: { - allowListedLocalPaths: { - description: 'AllowListedLocalPaths contains local paths that are allowed to be mounted into jobs', - type: 'array', - items: { - type: 'string' - } - }, - clientAPI: { - '$ref': '#/definitions/types.APIConfig' - }, - compute: { - '$ref': '#/definitions/types.ComputeConfig' - }, - computeStoragePath: { - description: `TODO(forrest) [refactor]: rename this to ExecutorStoragePath -Deprecated: replaced by cfg.ComputeDir()`, - type: 'string' - }, - disabledFeatures: { - description: 'What features should not be enabled even if installed', - allOf: [ - { - '$ref': '#/definitions/types.FeatureConfig' - } - ] - }, - downloadURLRequestRetries: { - type: 'integer' - }, - downloadURLRequestTimeout: { - '$ref': '#/definitions/types.Duration' - }, - executorPluginPath: { - description: 'Deprecated: replaced by cfg.PluginsDir()', - type: 'string' - }, - ipfs: { - '$ref': '#/definitions/types.IpfsConfig' - }, - labels: { - description: 'Labels to apply to the node that can be used for node selection and filtering', - type: 'object', - additionalProperties: { - type: 'string' - } - }, - loggingMode: { - '$ref': '#/definitions/logger.LogMode' - }, - name: { - type: 'string' - }, - nameProvider: { - type: 'string' - }, - network: { - '$ref': '#/definitions/types.NetworkConfig' - }, - requester: { - '$ref': '#/definitions/types.RequesterConfig' - }, - serverAPI: { - '$ref': '#/definitions/types.APIConfig' - }, - strictVersionMatch: { - type: 'boolean' - }, - type: { - description: 'Type is "compute", "requester" or both', - type: 'array', - items: { - type: 'string' - } - }, - volumeSizeRequestTimeout: { - '$ref': '#/definitions/types.Duration' - }, - webUI: { - description: 'Configuration for the web UI', - allOf: [ - { - '$ref': '#/definitions/types.WebUIConfig' - } - ] - } - } -} as const; - -export const types_RequesterConfigSchema = { - type: 'object', - properties: { - controlPlaneSettings: { - '$ref': '#/definitions/types.RequesterControlPlaneConfig' - }, - defaultPublisher: { - type: 'string' - }, - evaluationBroker: { - '$ref': '#/definitions/types.EvaluationBrokerConfig' - }, - externalVerifierHook: { - description: 'URL where to send external verification requests to.', - type: 'string' - }, - failureInjectionConfig: { - '$ref': '#/definitions/models.FailureInjectionRequesterConfig' - }, - housekeepingBackgroundTaskInterval: { - '$ref': '#/definitions/types.Duration' - }, - jobDefaults: { - '$ref': '#/definitions/types.JobDefaults' - }, - jobSelectionPolicy: { - description: 'How the node decides what jobs to run.', - allOf: [ - { - '$ref': '#/definitions/models.JobSelectionPolicy' - } - ] - }, - jobStore: { - '$ref': '#/definitions/types.JobStoreConfig' - }, - manualNodeApproval: { - description: `ManualNodeApproval is a flag that determines if nodes should be manually approved or not. -By default, nodes are auto-approved to simplify upgrades, by setting this property to -true, nodes will need to be manually approved before they are included in node selection.`, - type: 'boolean' - }, - nodeInfoStoreTTL: { - '$ref': '#/definitions/types.Duration' - }, - nodeRankRandomnessRange: { - type: 'integer' - }, - overAskForBidsFactor: { - type: 'integer' - }, - scheduler: { - '$ref': '#/definitions/types.SchedulerConfig' - }, - storageProvider: { - '$ref': '#/definitions/types.StorageProviderConfig' - }, - tagCache: { - '$ref': '#/definitions/types.DockerCacheConfig' - }, - translationEnabled: { - type: 'boolean' - }, - worker: { - '$ref': '#/definitions/types.WorkerConfig' - } - } -} as const; - -export const types_RequesterControlPlaneConfigSchema = { - type: 'object', - properties: { - heartbeatCheckFrequency: { - description: `This setting is the time period after which a compute node is considered to be unresponsive. -If the compute node misses two of these frequencies, it will be marked as unknown. The compute -node should have a frequency setting less than this one to ensure that it does not keep -switching between unknown and active too frequently.`, - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - }, - heartbeatTopic: { - description: 'This is the pubsub topic that the compute node will use to send heartbeats to the requester node.', - type: 'string' - }, - nodeDisconnectedAfter: { - description: `This is the time period after which a compute node is considered to be disconnected. If the compute -node does not deliver a heartbeat every \`NodeDisconnectedAfter\` then it is considered disconnected.`, - allOf: [ - { - '$ref': '#/definitions/types.Duration' - } - ] - } - } -} as const; - -export const types_S3StorageProviderConfigSchema = { - type: 'object', - properties: { - preSignedURLDisabled: { - type: 'boolean' - }, - preSignedURLExpiration: { - '$ref': '#/definitions/types.Duration' - } - } -} as const; - -export const types_SchedulerConfigSchema = { - type: 'object', - properties: { - nodeOverSubscriptionFactor: { - type: 'number' - }, - queueBackoff: { - '$ref': '#/definitions/types.Duration' - } - } -} as const; - -export const types_StorageProviderConfigSchema = { - type: 'object', - properties: { - s3: { - '$ref': '#/definitions/types.S3StorageProviderConfig' - } - } -} as const; - -export const types_StorageTypeSchema = { - type: 'integer', - enum: [0, 1], - 'x-enum-varnames': ['UnknownStorage', 'BoltDB'] -} as const; - -export const types_TLSConfigurationSchema = { - type: 'object', - properties: { - autoCert: { - description: `AutoCert specifies a hostname for a certificate to be obtained via ACME. -This is only used by the server, and only by the requester node when it -has a publicly resolvable domain name.`, - type: 'string' - }, - autoCertCachePath: { - description: `AutoCertCachePath specifies the directory where the autocert process -will cache certificates to avoid rate limits.`, - type: 'string' - }, - selfSigned: { - description: `SelfSignedCert will auto-generate a self-signed certificate for the -requester node if TLS certificates have not been provided.`, - type: 'boolean' - }, - serverCertificate: { - description: `ServerCertificate specifies the location of a TLS certificate to be used -by the requester to serve TLS requests`, - type: 'string' - }, - serverKey: { - description: `ServerKey is the TLS server key to match the certificate to allow the -requester to server TLS.`, - type: 'string' - } - } -} as const; - -export const types_UpdateConfigSchema = { - type: 'object', - properties: { - checkFrequency: { - '$ref': '#/definitions/types.Duration' - }, - skipChecks: { - type: 'boolean' - } - } -} as const; - -export const types_UserConfigSchema = { - type: 'object', - properties: { - installationID: { - type: 'string' - }, - keyPath: { - description: `KeyPath is deprecated -Deprecated: replaced by cfg.UserKeyPath()`, - type: 'string' - } - } -} as const; - -export const types_WebUIConfigSchema = { - type: 'object', - properties: { - enabled: { - type: 'boolean' - }, - port: { - type: 'integer' - } - } -} as const; - -export const types_WorkerConfigSchema = { - type: 'object', - properties: { - workerCount: { - type: 'integer' - }, - workerEvalDequeueBaseBackoff: { - '$ref': '#/definitions/types.Duration' - }, - workerEvalDequeueMaxBackoff: { - '$ref': '#/definitions/types.Duration' - }, - workerEvalDequeueTimeout: { - '$ref': '#/definitions/types.Duration' - } - } -} as const; \ No newline at end of file diff --git a/webui/lib/api/generated/services.gen.ts b/webui/lib/api/generated/services.gen.ts index c56ec158d3..cd322fcb89 100644 --- a/webui/lib/api/generated/services.gen.ts +++ b/webui/lib/api/generated/services.gen.ts @@ -1,431 +1,253 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { CancelablePromise } from './core/CancelablePromise'; -import { OpenAPI } from './core/OpenAPI'; -import { request as __request } from './core/request'; -import type { HomeResponse, AgentAliveResponse, AgentConfigResponse, AgentDebugResponse, AgentNodeResponse, AgentVersionResponse, ApiServerDebugResponse, HealthzResponse, IdResponse, LivezResponse, NodeInfoResponse, OrchestratorListJobsData, OrchestratorListJobsResponse, OrchestratorPutJobData, OrchestratorPutJobResponse, OrchestratorGetJobData, OrchestratorGetJobResponse, OrchestratorStopJobData, OrchestratorStopJobResponse, OrchestratorJobExecutionsData, OrchestratorJobExecutionsResponse, OrchestratorJobHistoryData, OrchestratorJobHistoryResponse, OrchestratorLogsData, OrchestratorJobResultsData, OrchestratorJobResultsResponse, OrchestratorListNodesData, OrchestratorListNodesResponse, OrchestratorUpdateNodeData, OrchestratorUpdateNodeResponse, OrchestratorGetNodeData, OrchestratorGetNodeResponse, ApiServerVersionData, ApiServerVersionResponse } from './types.gen'; - -/** - * @returns string OK - * @throws ApiError - */ -export const home = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/' -}); }; - -/** - * @returns string OK - * @throws ApiError - */ -export const agentAlive = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/alive' -}); }; - -/** - * Returns the current configuration of the node. - * @returns types_BacalhauConfig OK - * @throws ApiError - */ -export const agentConfig = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/config', - errors: { - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns debug information on what the current node is doing. - * @returns models_DebugInfo OK - * @throws ApiError - */ -export const agentDebug = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/debug', - errors: { - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns the info of the node. - * @returns models_NodeInfo OK - * @throws ApiError - */ -export const agentNode = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/node', - errors: { - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns the build version running on the server. - * See https://github.com/bacalhau-project/bacalhau/releases for a complete list of `gitversion` tags. - * @returns apimodels_GetVersionResponse OK - * @throws ApiError - */ -export const agentVersion = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/version', - errors: { - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns debug information on what the current node is doing. - * @returns string OK - * @throws ApiError - */ -export const apiServerDebug = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/compute/debug', - errors: { - 500: 'Internal Server Error' - } -}); }; - -/** - * @returns types_HealthInfo OK - * @throws ApiError - */ -export const healthz = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/healthz' -}); }; - -/** - * Returns the id of the host node. - * @returns string OK - * @throws ApiError - */ -export const id = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/id', - errors: { - 500: 'Internal Server Error' - } -}); }; - -/** - * @returns string TODO - * @throws ApiError - */ -export const livez = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/livez' -}); }; - -/** - * Returns the info of the node. - * @returns models_NodeInfo OK - * @throws ApiError - */ -export const nodeInfo = (): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/node_info', - errors: { - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns a list of jobs. - * Returns a list of jobs. - * @param data The data for the request. - * @param data.namespace Namespace to get the jobs for - * @param data.limit Limit the number of jobs returned - * @param data.nextToken Token to get the next page of jobs - * @param data.reverse Reverse the order of the jobs - * @param data.orderBy Order the jobs by the given field - * @returns apimodels_ListJobsResponse OK - * @throws ApiError - */ -export const orchestratorListJobs = (data: OrchestratorListJobsData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs', - query: { - namespace: data.namespace, - limit: data.limit, - next_token: data.nextToken, - reverse: data.reverse, - order_by: data.orderBy - }, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Submits a job to the orchestrator. - * Submits a job to the orchestrator. - * @param data The data for the request. - * @param data.putJobRequest Job to submit - * @returns apimodels_PutJobResponse OK - * @throws ApiError - */ -export const orchestratorPutJob = (data: OrchestratorPutJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'PUT', - url: '/api/v1/orchestrator/jobs', - body: data.putJobRequest, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns a job. - * Returns a job. - * @param data The data for the request. - * @param data.id ID to get the job for - * @param data.include Takes history and executions as options. If empty will not include anything else. - * @param data.limit Number of history or executions to fetch. Should be used in conjugation with include - * @returns apimodels_GetJobResponse OK - * @throws ApiError - */ -export const orchestratorGetJob = (data: OrchestratorGetJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}', - path: { - id: data.id - }, - query: { - include: data.include, - limit: data.limit - }, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Stops a job. - * Stops a job. - * @param data The data for the request. - * @param data.id ID to stop the job for - * @param data.reason Reason for stopping the job - * @returns apimodels_StopJobResponse OK - * @throws ApiError - */ -export const orchestratorStopJob = (data: OrchestratorStopJobData): CancelablePromise => { return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/orchestrator/jobs/{id}', - path: { - id: data.id - }, - query: { - reason: data.reason - }, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns the executions of a job. - * Returns the executions of a job. - * @param data The data for the request. - * @param data.id ID to get the job executions for - * @param data.orderBy Order the executions by the given field - * @param data.namespace Namespace to get the jobs for - * @param data.limit Limit the number of executions returned - * @param data.nextToken Token to get the next page of executions - * @param data.reverse Reverse the order of the executions - * @returns apimodels_ListJobExecutionsResponse OK - * @throws ApiError - */ -export const orchestratorJobExecutions = (data: OrchestratorJobExecutionsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}/executions', - path: { - id: data.id - }, - query: { - namespace: data.namespace, - limit: data.limit, - next_token: data.nextToken, - reverse: data.reverse, - order_by: data.orderBy - }, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns the history of a job. - * Returns the history of a job. - * @param data The data for the request. - * @param data.id ID to get the job history for - * @param data.since Only return history since this time - * @param data.eventType Only return history of this event type - * @param data.executionId Only return history of this execution ID - * @param data.nextToken Token to get the next page of the jobs - * @returns apimodels_ListJobHistoryResponse OK - * @throws ApiError - */ -export const orchestratorJobHistory = (data: OrchestratorJobHistoryData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}/history', - path: { - id: data.id - }, - query: { - since: data.since, - event_type: data.eventType, - execution_id: data.executionId, - next_token: data.nextToken - }, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Streams the logs for a current job/execution via WebSocket - * Establishes a WebSocket connection to stream output from the job specified by `id` - * The stream will continue until either the client disconnects or the execution completes - * @param data The data for the request. - * @param data.id ID of the job to stream logs for - * @param data.executionId Fetch logs for a specific execution - * @param data.tail Fetch historical logs - * @param data.follow Follow the logs - * @throws ApiError - */ -export const orchestratorLogs = (data: OrchestratorLogsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}/logs', - path: { - id: data.id - }, - query: { - execution_id: data.executionId, - tail: data.tail, - follow: data.follow - }, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns the results of a job. - * Returns the results of a job. - * @param data The data for the request. - * @param data.id ID to get the job results for - * @returns apimodels_ListJobResultsResponse OK - * @throws ApiError - */ -export const orchestratorJobResults = (data: OrchestratorJobResultsData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}/results', - path: { - id: data.id - }, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns a list of orchestrator nodes. - * Returns a list of orchestrator nodes. - * @param data The data for the request. - * @param data.limit Limit the number of node returned - * @param data.nextToken Token to get the next page of nodes - * @param data.reverse Reverse the order of the nodes - * @param data.orderBy Order the nodes by given field - * @param data.filterApproval Filter Approval - * @param data.filterStatus Filter Status - * @returns apimodels_ListNodesResponse OK - * @throws ApiError - */ -export const orchestratorListNodes = (data: OrchestratorListNodesData = {}): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/nodes', - query: { - limit: data.limit, - next_token: data.nextToken, - reverse: data.reverse, - order_by: data.orderBy, - filter_approval: data.filterApproval, - 'filter-status': data.filterStatus - }, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Update an orchestrator node. - * Update an orchestrator node. - * @param data The data for the request. - * @param data.id ID of the orchestrator node. - * @param data.putNodeRequest Put Node Request - * @returns apimodels_PutNodeResponse OK - * @throws ApiError - */ -export const orchestratorUpdateNode = (data: OrchestratorUpdateNodeData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/orchestrator/nodes', - path: { - id: data.id - }, - body: data.putNodeRequest, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; - -/** - * Get an orchestrator node - * Get an orchestrator node - * @param data The data for the request. - * @param data.id ID of the orchestrator node to fetch for. - * @returns apimodels_GetNodeResponse OK - * @throws ApiError - */ -export const orchestratorGetNode = (data: OrchestratorGetNodeData): CancelablePromise => { return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/nodes/{id}', - path: { - id: data.id - }, - errors: { - 400: 'Bad Request', - 404: 'Not Found', - 500: 'Internal Server Error' - } -}); }; - -/** - * Returns the build version running on the server. - * See https://github.com/bacalhau-project/bacalhau/releases for a complete list of `gitversion` tags. - * @param data The data for the request. - * @param data.versionRequest Request must specify a `client_id`. To retrieve your `client_id`, you can do the following: (1) submit a dummy job to Bacalhau (or use one you created before), (2) run `bacalhau describe ` and fetch the `ClientID` field. - * @returns shared_VersionResponse OK - * @throws ApiError - */ -export const apiServerVersion = (data: ApiServerVersionData): CancelablePromise => { return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/version', - body: data.versionRequest, - errors: { - 400: 'Bad Request', - 500: 'Internal Server Error' - } -}); }; \ No newline at end of file +import { createClient, createConfig, type Options } from '@hey-api/client-fetch'; +import type { HomeError, HomeResponse, HealthzError, HealthzResponse, IdError, IdResponse, LivezError, LivezResponse, NodeInfoError, NodeInfoResponse, AgentAliveError, AgentAliveResponse, AgentConfigError, AgentConfigResponse, AgentDebugError, AgentDebugResponse, AgentNodeError, AgentNodeResponse, AgentVersionError, AgentVersionResponse, ApiServerDebugError, ApiServerDebugResponse, OrchestratorListJobsData, OrchestratorListJobsError, OrchestratorListJobsResponse, OrchestratorPutJobData, OrchestratorPutJobError, OrchestratorPutJobResponse, OrchestratorGetJobData, OrchestratorGetJobError, OrchestratorGetJobResponse, OrchestratorStopJobData, OrchestratorStopJobError, OrchestratorStopJobResponse, OrchestratorJobExecutionsData, OrchestratorJobExecutionsError, OrchestratorJobExecutionsResponse, OrchestratorJobHistoryData, OrchestratorJobHistoryError, OrchestratorJobHistoryResponse, OrchestratorLogsData, OrchestratorJobResultsData, OrchestratorJobResultsError, OrchestratorJobResultsResponse, OrchestratorListNodesData, OrchestratorListNodesError, OrchestratorListNodesResponse, OrchestratorUpdateNodeData, OrchestratorUpdateNodeError, OrchestratorUpdateNodeResponse, OrchestratorGetNodeData, OrchestratorGetNodeError, OrchestratorGetNodeResponse, ApiServerVersionData, ApiServerVersionError, ApiServerVersionResponse } from './types.gen'; + +export const client = createClient(createConfig()); + +export class Utils { + public static home(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/' + }); + } + + public static healthz(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/healthz' + }); + } + + /** + * Returns the id of the host node. + */ + public static id(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/id' + }); + } + + public static livez(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/livez' + }); + } + + /** + * Returns the info of the node. + */ + public static nodeInfo(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/node_info' + }); + } + +} + +export class Ops { + public static agentAlive(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/agent/alive' + }); + } + + /** + * Returns the current configuration of the node. + */ + public static agentConfig(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/agent/config' + }); + } + + /** + * Returns debug information on what the current node is doing. + */ + public static agentDebug(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/agent/debug' + }); + } + + /** + * Returns the info of the node. + */ + public static agentNode(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/agent/node' + }); + } + + /** + * Returns the build version running on the server. + * See https://github.com/bacalhau-project/bacalhau/releases for a complete list of `gitversion` tags. + */ + public static agentVersion(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/agent/version' + }); + } + +} + +export class ComputeNode { + /** + * Returns debug information on what the current node is doing. + */ + public static apiServerDebug(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/compute/debug' + }); + } + +} + +export class Orchestrator { + /** + * Returns a list of jobs. + * Returns a list of jobs. + */ + public static listJobs(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/orchestrator/jobs' + }); + } + + /** + * Submits a job to the orchestrator. + * Submits a job to the orchestrator. + */ + public static putJob(options: Options) { + return (options?.client ?? client).put({ + ...options, + url: '/api/v1/orchestrator/jobs' + }); + } + + /** + * Returns a job. + * Returns a job. + */ + public static getJob(options: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/orchestrator/jobs/{id}' + }); + } + + /** + * Stops a job. + * Stops a job. + */ + public static stopJob(options: Options) { + return (options?.client ?? client).delete({ + ...options, + url: '/api/v1/orchestrator/jobs/{id}' + }); + } + + /** + * Returns the executions of a job. + * Returns the executions of a job. + */ + public static jobExecutions(options: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/orchestrator/jobs/{id}/executions' + }); + } + + /** + * Returns the history of a job. + * Returns the history of a job. + */ + public static jobHistory(options: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/orchestrator/jobs/{id}/history' + }); + } + + /** + * Streams the logs for a current job/execution via WebSocket + * Establishes a WebSocket connection to stream output from the job specified by `id` + * The stream will continue until either the client disconnects or the execution completes + */ + public static logs(options: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/orchestrator/jobs/{id}/logs' + }); + } + + /** + * Returns the results of a job. + * Returns the results of a job. + */ + public static jobResults(options: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/orchestrator/jobs/{id}/results' + }); + } + + /** + * Returns a list of orchestrator nodes. + * Returns a list of orchestrator nodes. + */ + public static listNodes(options?: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/orchestrator/nodes' + }); + } + + /** + * Update an orchestrator node. + * Update an orchestrator node. + */ + public static updateNode(options: Options) { + return (options?.client ?? client).post({ + ...options, + url: '/api/v1/orchestrator/nodes' + }); + } + + /** + * Get an orchestrator node + * Get an orchestrator node + */ + public static getNode(options: Options) { + return (options?.client ?? client).get({ + ...options, + url: '/api/v1/orchestrator/nodes/{id}' + }); + } + +} + +export class Misc { + /** + * Returns the build version running on the server. + * See https://github.com/bacalhau-project/bacalhau/releases for a complete list of `gitversion` tags. + */ + public static apiServerVersion(options: Options) { + return (options?.client ?? client).post({ + ...options, + url: '/api/v1/version' + }); + } + +} \ No newline at end of file diff --git a/webui/lib/api/generated/services/ComputeNodeService.ts b/webui/lib/api/generated/services/ComputeNodeService.ts deleted file mode 100644 index 8d8ea996c7..0000000000 --- a/webui/lib/api/generated/services/ComputeNodeService.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -export class ComputeNodeService { - /** - * Returns debug information on what the current node is doing. - * @returns string OK - * @throws ApiError - */ - public static apiServerDebug(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/compute/debug', - errors: { - 500: `Internal Server Error`, - }, - }); - } -} diff --git a/webui/lib/api/generated/services/MiscService.ts b/webui/lib/api/generated/services/MiscService.ts deleted file mode 100644 index 25924da84a..0000000000 --- a/webui/lib/api/generated/services/MiscService.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { shared_VersionRequest } from '../models/shared_VersionRequest'; -import type { shared_VersionResponse } from '../models/shared_VersionResponse'; -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -export class MiscService { - /** - * Returns the build version running on the server. - * See https://github.com/bacalhau-project/bacalhau/releases for a complete list of `gitversion` tags. - * @param versionRequest Request must specify a `client_id`. To retrieve your `client_id`, you can do the following: (1) submit a dummy job to Bacalhau (or use one you created before), (2) run `bacalhau describe ` and fetch the `ClientID` field. - * @returns shared_VersionResponse OK - * @throws ApiError - */ - public static apiServerVersion( - versionRequest: shared_VersionRequest, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/version', - body: versionRequest, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } -} diff --git a/webui/lib/api/generated/services/OpsService.ts b/webui/lib/api/generated/services/OpsService.ts deleted file mode 100644 index 76ebe1b4f7..0000000000 --- a/webui/lib/api/generated/services/OpsService.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { apimodels_GetVersionResponse } from '../models/apimodels_GetVersionResponse'; -import type { models_DebugInfo } from '../models/models_DebugInfo'; -import type { models_NodeInfo } from '../models/models_NodeInfo'; -import type { types_BacalhauConfig } from '../models/types_BacalhauConfig'; -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -export class OpsService { - /** - * @returns string OK - * @throws ApiError - */ - public static agentAlive(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/alive', - }); - } - /** - * Returns the current configuration of the node. - * @returns types_BacalhauConfig OK - * @throws ApiError - */ - public static agentConfig(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/config', - errors: { - 500: `Internal Server Error`, - }, - }); - } - /** - * Returns debug information on what the current node is doing. - * @returns models_DebugInfo OK - * @throws ApiError - */ - public static agentDebug(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/debug', - errors: { - 500: `Internal Server Error`, - }, - }); - } - /** - * Returns the info of the node. - * @returns models_NodeInfo OK - * @throws ApiError - */ - public static agentNode(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/node', - errors: { - 500: `Internal Server Error`, - }, - }); - } - /** - * Returns the build version running on the server. - * See https://github.com/bacalhau-project/bacalhau/releases for a complete list of `gitversion` tags. - * @returns apimodels_GetVersionResponse OK - * @throws ApiError - */ - public static agentVersion(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/agent/version', - errors: { - 500: `Internal Server Error`, - }, - }); - } -} diff --git a/webui/lib/api/generated/services/OrchestratorService.ts b/webui/lib/api/generated/services/OrchestratorService.ts deleted file mode 100644 index 435175c26e..0000000000 --- a/webui/lib/api/generated/services/OrchestratorService.ts +++ /dev/null @@ -1,348 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { apimodels_GetJobResponse } from '../models/apimodels_GetJobResponse'; -import type { apimodels_GetNodeResponse } from '../models/apimodels_GetNodeResponse'; -import type { apimodels_ListJobExecutionsResponse } from '../models/apimodels_ListJobExecutionsResponse'; -import type { apimodels_ListJobHistoryResponse } from '../models/apimodels_ListJobHistoryResponse'; -import type { apimodels_ListJobResultsResponse } from '../models/apimodels_ListJobResultsResponse'; -import type { apimodels_ListJobsResponse } from '../models/apimodels_ListJobsResponse'; -import type { apimodels_ListNodesResponse } from '../models/apimodels_ListNodesResponse'; -import type { apimodels_PutJobRequest } from '../models/apimodels_PutJobRequest'; -import type { apimodels_PutJobResponse } from '../models/apimodels_PutJobResponse'; -import type { apimodels_PutNodeRequest } from '../models/apimodels_PutNodeRequest'; -import type { apimodels_PutNodeResponse } from '../models/apimodels_PutNodeResponse'; -import type { apimodels_StopJobResponse } from '../models/apimodels_StopJobResponse'; -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -export class OrchestratorService { - /** - * Returns a list of jobs. - * Returns a list of jobs. - * @param namespace Namespace to get the jobs for - * @param limit Limit the number of jobs returned - * @param nextToken Token to get the next page of jobs - * @param reverse Reverse the order of the jobs - * @param orderBy Order the jobs by the given field - * @returns apimodels_ListJobsResponse OK - * @throws ApiError - */ - public static orchestratorListJobs( - namespace?: string, - limit?: number, - nextToken?: string, - reverse?: boolean, - orderBy?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs', - query: { - 'namespace': namespace, - 'limit': limit, - 'next_token': nextToken, - 'reverse': reverse, - 'order_by': orderBy, - }, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Submits a job to the orchestrator. - * Submits a job to the orchestrator. - * @param putJobRequest Job to submit - * @returns apimodels_PutJobResponse OK - * @throws ApiError - */ - public static orchestratorPutJob( - putJobRequest: apimodels_PutJobRequest, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/api/v1/orchestrator/jobs', - body: putJobRequest, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Returns a job. - * Returns a job. - * @param id ID to get the job for - * @param include Takes history and executions as options. If empty will not include anything else. - * @param limit Number of history or executions to fetch. Should be used in conjugation with include - * @returns apimodels_GetJobResponse OK - * @throws ApiError - */ - public static orchestratorGetJob( - id: string, - include?: string, - limit?: number, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}', - path: { - 'id': id, - }, - query: { - 'include': include, - 'limit': limit, - }, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Stops a job. - * Stops a job. - * @param id ID to stop the job for - * @param reason Reason for stopping the job - * @returns apimodels_StopJobResponse OK - * @throws ApiError - */ - public static orchestratorStopJob( - id: string, - reason?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/api/v1/orchestrator/jobs/{id}', - path: { - 'id': id, - }, - query: { - 'reason': reason, - }, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Returns the executions of a job. - * Returns the executions of a job. - * @param id ID to get the job executions for - * @param orderBy Order the executions by the given field - * @param namespace Namespace to get the jobs for - * @param limit Limit the number of executions returned - * @param nextToken Token to get the next page of executions - * @param reverse Reverse the order of the executions - * @returns apimodels_ListJobExecutionsResponse OK - * @throws ApiError - */ - public static orchestratorJobExecutions( - id: string, - orderBy: string, - namespace?: string, - limit?: number, - nextToken?: string, - reverse?: boolean, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}/executions', - path: { - 'id': id, - }, - query: { - 'namespace': namespace, - 'limit': limit, - 'next_token': nextToken, - 'reverse': reverse, - 'order_by': orderBy, - }, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Returns the history of a job. - * Returns the history of a job. - * @param id ID to get the job history for - * @param since Only return history since this time - * @param eventType Only return history of this event type - * @param executionId Only return history of this execution ID - * @param nextToken Token to get the next page of the jobs - * @returns apimodels_ListJobHistoryResponse OK - * @throws ApiError - */ - public static orchestratorJobHistory( - id: string, - since?: string, - eventType?: string, - executionId?: string, - nextToken?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}/history', - path: { - 'id': id, - }, - query: { - 'since': since, - 'event_type': eventType, - 'execution_id': executionId, - 'next_token': nextToken, - }, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Streams the logs for a current job/execution via WebSocket - * Establishes a WebSocket connection to stream output from the job specified by `id` - * The stream will continue until either the client disconnects or the execution completes - * @param id ID of the job to stream logs for - * @param executionId Fetch logs for a specific execution - * @param tail Fetch historical logs - * @param follow Follow the logs - * @returns void - * @throws ApiError - */ - public static orchestratorLogs( - id: string, - executionId?: string, - tail?: boolean, - follow?: boolean, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}/logs', - path: { - 'id': id, - }, - query: { - 'execution_id': executionId, - 'tail': tail, - 'follow': follow, - }, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Returns the results of a job. - * Returns the results of a job. - * @param id ID to get the job results for - * @returns apimodels_ListJobResultsResponse OK - * @throws ApiError - */ - public static orchestratorJobResults( - id: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/jobs/{id}/results', - path: { - 'id': id, - }, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Returns a list of orchestrator nodes. - * Returns a list of orchestrator nodes. - * @param limit Limit the number of node returned - * @param nextToken Token to get the next page of nodes - * @param reverse Reverse the order of the nodes - * @param orderBy Order the nodes by given field - * @param filterApproval Filter Approval - * @param filterStatus Filter Status - * @returns apimodels_ListNodesResponse OK - * @throws ApiError - */ - public static orchestratorListNodes( - limit?: number, - nextToken?: string, - reverse?: boolean, - orderBy?: string, - filterApproval?: string, - filterStatus?: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/nodes', - query: { - 'limit': limit, - 'next_token': nextToken, - 'reverse': reverse, - 'order_by': orderBy, - 'filter_approval': filterApproval, - 'filter-status': filterStatus, - }, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Update an orchestrator node. - * Update an orchestrator node. - * @param id ID of the orchestrator node. - * @param putNodeRequest Put Node Request - * @returns apimodels_PutNodeResponse OK - * @throws ApiError - */ - public static orchestratorUpdateNode( - id: string, - putNodeRequest: apimodels_PutNodeRequest, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v1/orchestrator/nodes', - path: { - 'id': id, - }, - body: putNodeRequest, - errors: { - 400: `Bad Request`, - 500: `Internal Server Error`, - }, - }); - } - /** - * Get an orchestrator node - * Get an orchestrator node - * @param id ID of the orchestrator node to fetch for. - * @returns apimodels_GetNodeResponse OK - * @throws ApiError - */ - public static orchestratorGetNode( - id: string, - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/orchestrator/nodes/{id}', - path: { - 'id': id, - }, - errors: { - 400: `Bad Request`, - 404: `Not Found`, - 500: `Internal Server Error`, - }, - }); - } -} diff --git a/webui/lib/api/generated/services/UtilsService.ts b/webui/lib/api/generated/services/UtilsService.ts deleted file mode 100644 index 25cd2ae07b..0000000000 --- a/webui/lib/api/generated/services/UtilsService.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { models_NodeInfo } from '../models/models_NodeInfo'; -import type { types_HealthInfo } from '../models/types_HealthInfo'; -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -export class UtilsService { - /** - * @returns string OK - * @throws ApiError - */ - public static home(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/', - }); - } - /** - * @returns types_HealthInfo OK - * @throws ApiError - */ - public static healthz(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/healthz', - }); - } - /** - * Returns the id of the host node. - * @returns string OK - * @throws ApiError - */ - public static id(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/id', - errors: { - 500: `Internal Server Error`, - }, - }); - } - /** - * @returns string TODO - * @throws ApiError - */ - public static livez(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/livez', - }); - } - /** - * Returns the info of the node. - * @returns models_NodeInfo OK - * @throws ApiError - */ - public static nodeInfo(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/v1/node_info', - errors: { - 500: `Internal Server Error`, - }, - }); - } -} diff --git a/webui/lib/api/generated/types.gen.ts b/webui/lib/api/generated/types.gen.ts index 6db53f8006..e074949d7d 100644 --- a/webui/lib/api/generated/types.gen.ts +++ b/webui/lib/api/generated/types.gen.ts @@ -7,7 +7,7 @@ export type apimodels_GetJobResponse = { }; export type apimodels_GetNodeResponse = { - node?: models_NodeState; + Node?: models_NodeState; }; export type apimodels_GetVersionResponse = { @@ -40,6 +40,10 @@ export type apimodels_HTTPCredential = { value?: string; }; +export type apimodels_IsAliveResponse = { + Status?: string; +}; + export type apimodels_ListJobExecutionsResponse = { Items?: Array; NextToken?: string; @@ -62,7 +66,7 @@ export type apimodels_ListJobsResponse = { export type apimodels_ListNodesResponse = { NextToken?: string; - nodes?: Array; + Nodes?: Array; }; export type apimodels_PutJobRequest = { @@ -79,26 +83,99 @@ export type apimodels_PutJobResponse = { }; export type apimodels_PutNodeRequest = { - action?: string; + Action?: string; + Message?: string; + NodeID?: string; credential?: apimodels_HTTPCredential; idempotencyToken?: string; - message?: string; namespace?: string; - nodeID?: string; }; export type apimodels_PutNodeResponse = { - error?: string; - success?: boolean; + Error?: string; + Success?: boolean; }; export type apimodels_StopJobResponse = { EvaluationID?: string; }; -export type authn_MethodType = 'challenge' | 'ask'; +export enum authn_MethodType { + MethodTypeChallenge = 'challenge', + MethodTypeAsk = 'ask' +} + +export type github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig = { + /** + * AccessPolicyPath is the path to a file or directory that will be loaded as + * the policy to apply to all inbound API requests. If unspecified, a policy + * that permits access to all API endpoints to both authenticated and + * unauthenticated users (the default as of v1.2.0) will be used. + */ + accessPolicyPath?: string; + /** + * Methods maps "method names" to authenticator implementations. A method + * name is a human-readable string chosen by the person configuring the + * system that is shown to users to help them pick the authentication method + * they want to use. There can be multiple usages of the same Authenticator + * *type* but with different configs and parameters, each identified with a + * unique method name. + * + * For example, if an implementation wants to allow users to log in with + * Github or Bitbucket, they might both use an authenticator implementation + * of type "oidc", and each would appear once on this provider with key / + * method name "github" and "bitbucket". + * + * By default, only a single authentication method that accepts + * authentication via client keys will be enabled. + */ + methods?: { + [key: string]: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig; + }; + /** + * TokensPath is the location where a state file of tokens will be stored. + * By default it will be local to the Bacalhau repo, but can be any location + * in the host filesystem. Tokens are sensitive and should be stored in a + * location that is only readable to the current user. + * Deprecated: replaced by cfg.AuthTokensPath() + */ + tokensPath?: string; +}; + +export type github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthenticatorConfig = { + policyPath?: string; + type?: authn_MethodType; +}; -export type logger_LogMode = 'default' | 'station' | 'json' | 'combined' | 'event'; +export enum github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration { + minDuration = -9223372036854776000, + maxDuration = 9223372036854776000, + Nanosecond = 1, + Microsecond = 1000, + Millisecond = 1000000, + Second = 1000000000, + Minute = 60000000000, + Hour = 3600000000000 +} + +export type github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults = { + executionTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; + queueTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; + totalTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; +}; + +export type github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig = { + checkFrequency?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; + skipChecks?: boolean; +}; + +export enum logger_LogMode { + LogModeDefault = 'default', + LogModeStation = 'station', + LogModeJSON = 'json', + LogModeCombined = 'combined', + LogModeEvent = 'event' +} export type models_AllocatedResources = { Tasks?: { @@ -237,16 +314,35 @@ export type models_Execution = { RunOutput?: (models_RunCommandResult); }; -export type models_ExecutionDesiredStateType = 0 | 1 | 2; +export enum models_ExecutionDesiredStateType { + ExecutionDesiredStatePending = 0, + ExecutionDesiredStateRunning = 1, + ExecutionDesiredStateStopped = 2 +} export type models_ExecutionLog = { line?: string; type?: models_ExecutionLogType; }; -export type models_ExecutionLogType = 0 | 1 | 2; - -export type models_ExecutionStateType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; +export enum models_ExecutionLogType { + executionLogTypeUnknown = 0, + ExecutionLogTypeSTDOUT = 1, + ExecutionLogTypeSTDERR = 2 +} + +export enum models_ExecutionStateType { + ExecutionStateUndefined = 0, + ExecutionStateNew = 1, + ExecutionStateAskForBid = 2, + ExecutionStateAskForBidAccepted = 3, + ExecutionStateAskForBidRejected = 4, + ExecutionStateBidAccepted = 5, + ExecutionStateBidRejected = 6, + ExecutionStateCompleted = 7, + ExecutionStateFailed = 8, + ExecutionStateCancelled = 9 +} export type models_FailureInjectionRequesterConfig = { isBadActor?: boolean; @@ -276,7 +372,11 @@ export type models_GPU = { vendor?: (models_GPUVendor); }; -export type models_GPUVendor = 'NVIDIA' | 'AMD/ATI' | 'Intel'; +export enum models_GPUVendor { + GPUVendorNvidia = 'NVIDIA', + GPUVendorAMDATI = 'AMD/ATI', + GPUVendorIntel = 'Intel' +} export type models_InputSource = { /** @@ -377,9 +477,16 @@ export type models_JobHistory = { Type?: models_JobHistoryType; }; -export type models_JobHistoryType = 0 | 1 | 2; +export enum models_JobHistoryType { + JobHistoryTypeUndefined = 0, + JobHistoryTypeJobLevel = 1, + JobHistoryTypeExecutionLevel = 2 +} -export type models_JobSelectionDataLocality = 0 | 1; +export enum models_JobSelectionDataLocality { + Local = 0, + Anywhere = 1 +} export type models_JobSelectionPolicy = { /** @@ -406,7 +513,15 @@ export type models_JobSelectionPolicy = { reject_stateless_jobs?: boolean; }; -export type models_JobStateType = 0 | 1 | 2 | 3 | 4 | 5 | 6; +export enum models_JobStateType { + JobStateTypeUndefined = 0, + JobStateTypePending = 1, + JobStateTypeQueued = 2, + JobStateTypeRunning = 3, + JobStateTypeCompleted = 4, + JobStateTypeFailed = 5, + JobStateTypeStopped = 6 +} export type models_LabelSelectorRequirement = { /** @@ -426,7 +541,11 @@ export type models_LabelSelectorRequirement = { Values?: Array<(string)>; }; -export type models_Network = 0 | 1 | 2; +export enum models_Network { + NetworkNone = 0, + NetworkFull = 1, + NetworkHTTP = 2 +} export type models_NetworkConfig = { Domains?: Array<(string)>; @@ -460,7 +579,11 @@ export type models_NodeState = { Membership?: models_NodeMembershipState; }; -export type models_NodeType = 0 | 1 | 2; +export enum models_NodeType { + nodeTypeUndefined = 0, + NodeTypeRequester = 1, + NodeTypeCompute = 2 +} export type models_Resources = { /** @@ -648,7 +771,17 @@ export type models_TimeoutConfig = { TotalTimeout?: number; }; -export type selection_Operator = '!' | '=' | '==' | 'in' | '!=' | 'notin' | 'exists' | 'gt' | 'lt'; +export enum selection_Operator { + DoesNotExist = '!', + Equals = '=', + DoubleEquals = '==', + In = 'in', + NotEquals = '!=', + NotIn = 'notin', + Exists = 'exists', + GreaterThan = 'gt', + LessThan = 'lt' +} export type shared_VersionRequest = { client_id?: string; @@ -679,57 +812,15 @@ export type types_APIConfig = { tls?: (types_TLSConfiguration); }; -export type types_AuthConfig = { - /** - * AccessPolicyPath is the path to a file or directory that will be loaded as - * the policy to apply to all inbound API requests. If unspecified, a policy - * that permits access to all API endpoints to both authenticated and - * unauthenticated users (the default as of v1.2.0) will be used. - */ - accessPolicyPath?: string; - /** - * Methods maps "method names" to authenticator implementations. A method - * name is a human-readable string chosen by the person configuring the - * system that is shown to users to help them pick the authentication method - * they want to use. There can be multiple usages of the same Authenticator - * *type* but with different configs and parameters, each identified with a - * unique method name. - * - * For example, if an implementation wants to allow users to log in with - * Github or Bitbucket, they might both use an authenticator implementation - * of type "oidc", and each would appear once on this provider with key / - * method name "github" and "bitbucket". - * - * By default, only a single authentication method that accepts - * authentication via client keys will be enabled. - */ - methods?: { - [key: string]: types_AuthenticatorConfig; - }; - /** - * TokensPath is the location where a state file of tokens will be stored. - * By default it will be local to the Bacalhau repo, but can be any location - * in the host filesystem. Tokens are sensitive and should be stored in a - * location that is only readable to the current user. - * Deprecated: replaced by cfg.AuthTokensPath() - */ - tokensPath?: string; -}; - -export type types_AuthenticatorConfig = { - policyPath?: string; - type?: authn_MethodType; -}; - export type types_BacalhauConfig = { - auth?: types_AuthConfig; + auth?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_AuthConfig; /** * NB(forrest): this field shouldn't be persisted yet. */ dataDir?: string; metrics?: types_MetricsConfig; node?: types_NodeConfig; - update?: types_UpdateConfig; + update?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_UpdateConfig; user?: types_UserConfig; }; @@ -782,7 +873,7 @@ export type types_ComputeControlPlaneConfig = { * that the compute node is still alive. This should be less than the requester's configured * heartbeat timeout to avoid flapping. */ - heartbeatFrequency?: (types_Duration); + heartbeatFrequency?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); /** * This is the pubsub topic that the compute node will use to send heartbeats to the requester node. */ @@ -791,26 +882,24 @@ export type types_ComputeControlPlaneConfig = { * The frequency with which the compute node will send node info (inc current labels) * to the controlling requester node. */ - infoUpdateFrequency?: (types_Duration); + infoUpdateFrequency?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); /** * How often the compute node will send current resource availability to the requester node. */ - resourceUpdateFrequency?: (types_Duration); + resourceUpdateFrequency?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); }; export type types_DockerCacheConfig = { - duration?: types_Duration; - frequency?: types_Duration; + duration?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; + frequency?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; size?: number; }; -export type types_Duration = -9223372036854776000 | 9223372036854776000 | 1 | 1000 | 1000000 | 1000000000 | 60000000000 | 3600000000000; - export type types_EvaluationBrokerConfig = { - evalBrokerInitialRetryDelay?: types_Duration; + evalBrokerInitialRetryDelay?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; evalBrokerMaxRetryCount?: number; - evalBrokerSubsequentRetryDelay?: types_Duration; - evalBrokerVisibilityTimeout?: types_Duration; + evalBrokerSubsequentRetryDelay?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; + evalBrokerVisibilityTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; }; export type types_FeatureConfig = { @@ -835,12 +924,6 @@ export type types_IpfsConfig = { connect?: string; }; -export type types_JobDefaults = { - executionTimeout?: types_Duration; - queueTimeout?: types_Duration; - totalTimeout?: types_Duration; -}; - export type types_JobStoreConfig = { path?: string; type?: types_StorageType; @@ -851,7 +934,7 @@ export type types_JobTimeoutConfig = { * DefaultJobExecutionTimeout default value for the execution timeout this compute node will assign to jobs with * no timeout requirement defined. */ - defaultJobExecutionTimeout?: (types_Duration); + defaultJobExecutionTimeout?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); /** * JobExecutionTimeoutClientIDBypassList is the list of clients that are allowed to bypass the job execution timeout * check. @@ -860,17 +943,17 @@ export type types_JobTimeoutConfig = { /** * JobNegotiationTimeout default timeout value to hold a bid for a job */ - jobNegotiationTimeout?: (types_Duration); + jobNegotiationTimeout?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); /** * MaxJobExecutionTimeout default value for the maximum execution timeout this compute node supports. Jobs with * higher timeout requirements will not be bid on. */ - maxJobExecutionTimeout?: (types_Duration); + maxJobExecutionTimeout?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); /** * MinJobExecutionTimeout default value for the minimum execution timeout this compute node supports. Jobs with * lower timeout requirements will not be bid on. */ - minJobExecutionTimeout?: (types_Duration); + minJobExecutionTimeout?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); }; export type types_LocalPublisherConfig = { @@ -890,7 +973,7 @@ export type types_LoggingConfig = { /** * logging running executions */ - logRunningExecutionsInterval?: (types_Duration); + logRunningExecutionsInterval?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); }; export type types_MetricsConfig = { @@ -936,7 +1019,7 @@ export type types_NodeConfig = { */ disabledFeatures?: (types_FeatureConfig); downloadURLRequestRetries?: number; - downloadURLRequestTimeout?: types_Duration; + downloadURLRequestTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; /** * Deprecated: replaced by cfg.PluginsDir() */ @@ -959,7 +1042,7 @@ export type types_NodeConfig = { * Type is "compute", "requester" or both */ type?: Array<(string)>; - volumeSizeRequestTimeout?: types_Duration; + volumeSizeRequestTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; /** * Configuration for the web UI */ @@ -975,8 +1058,8 @@ export type types_RequesterConfig = { */ externalVerifierHook?: string; failureInjectionConfig?: models_FailureInjectionRequesterConfig; - housekeepingBackgroundTaskInterval?: types_Duration; - jobDefaults?: types_JobDefaults; + housekeepingBackgroundTaskInterval?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; + jobDefaults?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_JobDefaults; /** * How the node decides what jobs to run. */ @@ -988,7 +1071,7 @@ export type types_RequesterConfig = { * true, nodes will need to be manually approved before they are included in node selection. */ manualNodeApproval?: boolean; - nodeInfoStoreTTL?: types_Duration; + nodeInfoStoreTTL?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; nodeRankRandomnessRange?: number; overAskForBidsFactor?: number; scheduler?: types_SchedulerConfig; @@ -1005,7 +1088,7 @@ export type types_RequesterControlPlaneConfig = { * node should have a frequency setting less than this one to ensure that it does not keep * switching between unknown and active too frequently. */ - heartbeatCheckFrequency?: (types_Duration); + heartbeatCheckFrequency?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); /** * This is the pubsub topic that the compute node will use to send heartbeats to the requester node. */ @@ -1014,24 +1097,27 @@ export type types_RequesterControlPlaneConfig = { * This is the time period after which a compute node is considered to be disconnected. If the compute * node does not deliver a heartbeat every `NodeDisconnectedAfter` then it is considered disconnected. */ - nodeDisconnectedAfter?: (types_Duration); + nodeDisconnectedAfter?: (github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration); }; export type types_S3StorageProviderConfig = { preSignedURLDisabled?: boolean; - preSignedURLExpiration?: types_Duration; + preSignedURLExpiration?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; }; export type types_SchedulerConfig = { nodeOverSubscriptionFactor?: number; - queueBackoff?: types_Duration; + queueBackoff?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; }; export type types_StorageProviderConfig = { s3?: types_S3StorageProviderConfig; }; -export type types_StorageType = 0 | 1; +export enum types_StorageType { + UnknownStorage = 0, + BoltDB = 1 +} export type types_TLSConfiguration = { /** @@ -1062,11 +1148,6 @@ export type types_TLSConfiguration = { serverKey?: string; }; -export type types_UpdateConfig = { - checkFrequency?: types_Duration; - skipChecks?: boolean; -}; - export type types_UserConfig = { installationID?: string; /** @@ -1083,235 +1164,309 @@ export type types_WebUIConfig = { export type types_WorkerConfig = { workerCount?: number; - workerEvalDequeueBaseBackoff?: types_Duration; - workerEvalDequeueMaxBackoff?: types_Duration; - workerEvalDequeueTimeout?: types_Duration; + workerEvalDequeueBaseBackoff?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; + workerEvalDequeueMaxBackoff?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; + workerEvalDequeueTimeout?: github_com_bacalhau_project_bacalhau_pkg_config_legacy_types_Duration; }; export type HomeResponse = (string); -export type AgentAliveResponse = (string); +export type HomeError = unknown; + +export type HealthzResponse = (types_HealthInfo); + +export type HealthzError = unknown; + +export type IdResponse = (string); + +export type IdError = (string); + +export type LivezResponse = (string); + +export type LivezError = unknown; + +export type NodeInfoResponse = (models_NodeInfo); + +export type NodeInfoError = (string); + +export type AgentAliveResponse = (apimodels_IsAliveResponse); + +export type AgentAliveError = unknown; export type AgentConfigResponse = (types_BacalhauConfig); +export type AgentConfigError = (string); + export type AgentDebugResponse = (models_DebugInfo); -export type AgentNodeResponse = (models_NodeInfo); +export type AgentDebugError = (string); -export type AgentVersionResponse = (apimodels_GetVersionResponse); +export type AgentNodeResponse = (models_NodeInfo); -export type ApiServerDebugResponse = (string); +export type AgentNodeError = (string); -export type HealthzResponse = (types_HealthInfo); +export type AgentVersionResponse = (apimodels_GetVersionResponse); -export type IdResponse = (string); +export type AgentVersionError = (string); -export type LivezResponse = (string); +export type ApiServerDebugResponse = (string); -export type NodeInfoResponse = (models_NodeInfo); +export type ApiServerDebugError = (string); export type OrchestratorListJobsData = { - /** - * Limit the number of jobs returned - */ - limit?: number; - /** - * Namespace to get the jobs for - */ - namespace?: string; - /** - * Token to get the next page of jobs - */ - nextToken?: string; - /** - * Order the jobs by the given field - */ - orderBy?: string; - /** - * Reverse the order of the jobs - */ - reverse?: boolean; + query?: { + /** + * Limit the number of jobs returned + */ + limit?: number; + /** + * Namespace to get the jobs for + */ + namespace?: string; + /** + * Token to get the next page of jobs + */ + next_token?: string; + /** + * Order the jobs by the given field + */ + order_by?: string; + /** + * Reverse the order of the jobs + */ + reverse?: boolean; + }; }; export type OrchestratorListJobsResponse = (apimodels_ListJobsResponse); +export type OrchestratorListJobsError = (string); + export type OrchestratorPutJobData = { /** * Job to submit */ - putJobRequest: apimodels_PutJobRequest; + body: apimodels_PutJobRequest; }; export type OrchestratorPutJobResponse = (apimodels_PutJobResponse); +export type OrchestratorPutJobError = (string); + export type OrchestratorGetJobData = { - /** - * ID to get the job for - */ - id: string; - /** - * Takes history and executions as options. If empty will not include anything else. - */ - include?: string; - /** - * Number of history or executions to fetch. Should be used in conjugation with include - */ - limit?: number; + path: { + /** + * ID to get the job for + */ + id: string; + }; + query?: { + /** + * Takes history and executions as options. If empty will not include anything else. + */ + include?: string; + /** + * Number of history or executions to fetch. Should be used in conjugation with include + */ + limit?: number; + }; }; export type OrchestratorGetJobResponse = (apimodels_GetJobResponse); +export type OrchestratorGetJobError = (string); + export type OrchestratorStopJobData = { - /** - * ID to stop the job for - */ - id: string; - /** - * Reason for stopping the job - */ - reason?: string; + path: { + /** + * ID to stop the job for + */ + id: string; + }; + query?: { + /** + * Reason for stopping the job + */ + reason?: string; + }; }; export type OrchestratorStopJobResponse = (apimodels_StopJobResponse); +export type OrchestratorStopJobError = (string); + export type OrchestratorJobExecutionsData = { - /** - * ID to get the job executions for - */ - id: string; - /** - * Limit the number of executions returned - */ - limit?: number; - /** - * Namespace to get the jobs for - */ - namespace?: string; - /** - * Token to get the next page of executions - */ - nextToken?: string; - /** - * Order the executions by the given field - */ - orderBy: string; - /** - * Reverse the order of the executions - */ - reverse?: boolean; + path: { + /** + * ID to get the job executions for + */ + id: string; + }; + query: { + /** + * Limit the number of executions returned + */ + limit?: number; + /** + * Namespace to get the jobs for + */ + namespace?: string; + /** + * Token to get the next page of executions + */ + next_token?: string; + /** + * Order the executions by the given field + */ + order_by: string; + /** + * Reverse the order of the executions + */ + reverse?: boolean; + }; }; export type OrchestratorJobExecutionsResponse = (apimodels_ListJobExecutionsResponse); +export type OrchestratorJobExecutionsError = (string); + export type OrchestratorJobHistoryData = { - /** - * Only return history of this event type - */ - eventType?: string; - /** - * Only return history of this execution ID - */ - executionId?: string; - /** - * ID to get the job history for - */ - id: string; - /** - * Token to get the next page of the jobs - */ - nextToken?: string; - /** - * Only return history since this time - */ - since?: string; + path: { + /** + * ID to get the job history for + */ + id: string; + }; + query?: { + /** + * Only return history of this event type + */ + event_type?: string; + /** + * Only return history of this execution ID + */ + execution_id?: string; + /** + * Token to get the next page of the jobs + */ + next_token?: string; + /** + * Only return history since this time + */ + since?: string; + }; }; export type OrchestratorJobHistoryResponse = (apimodels_ListJobHistoryResponse); +export type OrchestratorJobHistoryError = (string); + export type OrchestratorLogsData = { - /** - * Fetch logs for a specific execution - */ - executionId?: string; - /** - * Follow the logs - */ - follow?: boolean; - /** - * ID of the job to stream logs for - */ - id: string; - /** - * Fetch historical logs - */ - tail?: boolean; + path: { + /** + * ID of the job to stream logs for + */ + id: string; + }; + query?: { + /** + * Fetch logs for a specific execution + */ + execution_id?: string; + /** + * Follow the logs + */ + follow?: boolean; + /** + * Fetch historical logs + */ + tail?: boolean; + }; }; export type OrchestratorJobResultsData = { - /** - * ID to get the job results for - */ - id: string; + path: { + /** + * ID to get the job results for + */ + id: string; + }; }; export type OrchestratorJobResultsResponse = (apimodels_ListJobResultsResponse); +export type OrchestratorJobResultsError = (string); + export type OrchestratorListNodesData = { - /** - * Filter Approval - */ - filterApproval?: string; - /** - * Filter Status - */ - filterStatus?: string; - /** - * Limit the number of node returned - */ - limit?: number; - /** - * Token to get the next page of nodes - */ - nextToken?: string; - /** - * Order the nodes by given field - */ - orderBy?: string; - /** - * Reverse the order of the nodes - */ - reverse?: boolean; + query?: { + /** + * Filter Approval + */ + filter_approval?: string; + /** + * Filter Status + */ + 'filter-status'?: string; + /** + * Limit the number of node returned + */ + limit?: number; + /** + * Token to get the next page of nodes + */ + next_token?: string; + /** + * Order the nodes by given field + */ + order_by?: string; + /** + * Reverse the order of the nodes + */ + reverse?: boolean; + }; }; export type OrchestratorListNodesResponse = (apimodels_ListNodesResponse); +export type OrchestratorListNodesError = (string); + export type OrchestratorUpdateNodeData = { - /** - * ID of the orchestrator node. - */ - id: string; /** * Put Node Request */ - putNodeRequest: apimodels_PutNodeRequest; + body: apimodels_PutNodeRequest; + path: { + /** + * ID of the orchestrator node. + */ + id: string; + }; }; export type OrchestratorUpdateNodeResponse = (apimodels_PutNodeResponse); +export type OrchestratorUpdateNodeError = (string); + export type OrchestratorGetNodeData = { - /** - * ID of the orchestrator node to fetch for. - */ - id: string; + path: { + /** + * ID of the orchestrator node to fetch for. + */ + id: string; + }; }; export type OrchestratorGetNodeResponse = (apimodels_GetNodeResponse); +export type OrchestratorGetNodeError = (string); + export type ApiServerVersionData = { /** * Request must specify a `client_id`. To retrieve your `client_id`, you can do the following: (1) submit a dummy job to Bacalhau (or use one you created before), (2) run `bacalhau describe ` and fetch the `ClientID` field. */ - versionRequest: shared_VersionRequest; + body: shared_VersionRequest; }; -export type ApiServerVersionResponse = (shared_VersionResponse); \ No newline at end of file +export type ApiServerVersionResponse = (shared_VersionResponse); + +export type ApiServerVersionError = (string); \ No newline at end of file diff --git a/webui/lib/api/index.ts b/webui/lib/api/index.ts index 4a1a6dbe25..03942bf328 100644 --- a/webui/lib/api/index.ts +++ b/webui/lib/api/index.ts @@ -1,26 +1,36 @@ -import { OpenAPI } from './generated' +import { client } from './generated' import { useState, useEffect } from 'react' interface Config { APIEndpoint: string } -export async function initializeApi() { +const DEFAULT_API_URL = 'http://localhost:1234' + +async function fetchConfig(): Promise { try { const response = await fetch('/_config') if (!response.ok) { - throw new Error('Failed to fetch config') + throw new Error(`Failed to fetch config: ${response.statusText}`) } - const config: Config = await response.json() - OpenAPI.BASE = config.APIEndpoint || 'http://localhost:1234' - console.log('API initialized with URL:', OpenAPI.BASE) + return await response.json() } catch (error) { - console.error('Error initializing API:', error) - OpenAPI.BASE = 'http://localhost:1234' // Fallback to default + console.warn('Config fetch failed, assuming standalone mode:', error) + return null } } -export { OpenAPI } +let apiUrl: string | null = null + +export async function initializeApi(): Promise { + const config = await fetchConfig() + apiUrl = config?.APIEndpoint || DEFAULT_API_URL + + client.setConfig({ baseUrl: apiUrl }) + + console.log('API initialized with URL:', apiUrl) + return apiUrl +} export function useApiInitialization() { const [isInitialized, setIsInitialized] = useState(false) @@ -31,3 +41,7 @@ export function useApiInitialization() { return isInitialized } + +export function useApiUrl() { + return apiUrl +} diff --git a/webui/lib/api/schema/swagger.json b/webui/lib/api/schema/swagger.json index 75e92c6fca..968c355b00 100644 --- a/webui/lib/api/schema/swagger.json +++ b/webui/lib/api/schema/swagger.json @@ -51,7 +51,7 @@ "200": { "description": "OK", "schema": { - "type": "string" + "$ref": "#/definitions/apimodels.IsAliveResponse" } } } @@ -1045,6 +1045,14 @@ } } }, + "apimodels.IsAliveResponse": { + "type": "object", + "properties": { + "Status": { + "type": "string" + } + } + }, "apimodels.ListJobExecutionsResponse": { "type": "object", "properties": { diff --git a/webui/lib/api/utils.ts b/webui/lib/api/utils.ts index f8de2e825c..3873255604 100644 --- a/webui/lib/api/utils.ts +++ b/webui/lib/api/utils.ts @@ -1,12 +1,11 @@ import { - models_JobStateType, models_Job, + models_JobStateType, models_ExecutionStateType, models_ExecutionDesiredStateType, models_NodeState, - models_NodeConnectionState, - models_NodeMembershipState, } from './generated' +import { formatDuration, normalizeTimestamp } from '@/lib/time' export function getJobState( status: string | number | undefined @@ -181,69 +180,3 @@ export function getJobRunTime(job: models_Job): string { const durationMs = endTime - createTime return formatDuration(durationMs) } - -function normalizeTimestamp(timestamp: number): number { - // Timestamp is too small, must be in seconds, convert to milliseconds - if (timestamp < 1e12) { - return timestamp * 1e3 - } - // Timestamp is in nanoseconds, convert to milliseconds - if (timestamp > 1e15) { - return Math.floor(timestamp / 1e6) - } - // Timestamp is already in milliseconds - return timestamp -} - -export function formatTime( - timeString: string | undefined, - includeSeconds: boolean = false -): string { - if (!timeString) return 'N/A' - const date = new Date(timeString) - return formatTimestamp(date.getTime(), includeSeconds) -} - -export function formatTimestamp( - timestamp: number | undefined, - includeSeconds: boolean = false -): string { - if (!timestamp) return 'N/A' - - const date = new Date(normalizeTimestamp(timestamp)) - - const year = date.getFullYear() - const month = (date.getMonth() + 1).toString().padStart(2, '0') - const day = date.getDate().toString().padStart(2, '0') - const hours = date.getHours().toString().padStart(2, '0') - const minutes = date.getMinutes().toString().padStart(2, '0') - - let formattedDate = `${year}-${month}-${day} ${hours}:${minutes}` - - if (includeSeconds) { - const seconds = date.getSeconds().toString().padStart(2, '0') - formattedDate += `:${seconds}` - } - - return formattedDate -} - -function formatDuration(durationMs: number): string { - const ms = durationMs % 1000 - const seconds = Math.floor(durationMs / 1000) % 60 - const minutes = Math.floor(durationMs / (1000 * 60)) % 60 - const hours = Math.floor(durationMs / (1000 * 60 * 60)) % 24 - const days = Math.floor(durationMs / (1000 * 60 * 60 * 24)) - - if (days > 0) { - return `${days}d ${hours}h` - } else if (hours > 0) { - return `${hours}h ${minutes}m` - } else if (minutes > 0) { - return `${minutes}m ${seconds}s` - } else if (seconds > 0) { - return `${seconds}s ${ms}ms` - } else { - return `${ms}ms` - } -} diff --git a/webui/lib/time.ts b/webui/lib/time.ts new file mode 100644 index 0000000000..e40a73ea09 --- /dev/null +++ b/webui/lib/time.ts @@ -0,0 +1,65 @@ +export function normalizeTimestamp(timestamp: number): number { + // Timestamp is too small, must be in seconds, convert to milliseconds + if (timestamp < 1e12) { + return timestamp * 1e3 + } + // Timestamp is in nanoseconds, convert to milliseconds + if (timestamp > 1e15) { + return Math.floor(timestamp / 1e6) + } + // Timestamp is already in milliseconds + return timestamp +} + +export function formatTime( + timeString: string | undefined, + includeSeconds: boolean = false +): string { + if (!timeString) return 'N/A' + const date = new Date(timeString) + return formatTimestamp(date.getTime(), includeSeconds) +} + +export function formatTimestamp( + timestamp: number | undefined, + includeSeconds: boolean = false +): string { + if (!timestamp) return 'N/A' + + const date = new Date(normalizeTimestamp(timestamp)) + + const year = date.getFullYear() + const month = (date.getMonth() + 1).toString().padStart(2, '0') + const day = date.getDate().toString().padStart(2, '0') + const hours = date.getHours().toString().padStart(2, '0') + const minutes = date.getMinutes().toString().padStart(2, '0') + + let formattedDate = `${year}-${month}-${day} ${hours}:${minutes}` + + if (includeSeconds) { + const seconds = date.getSeconds().toString().padStart(2, '0') + formattedDate += `:${seconds}` + } + + return formattedDate +} + +export function formatDuration(durationMs: number): string { + const ms = durationMs % 1000 + const seconds = Math.floor(durationMs / 1000) % 60 + const minutes = Math.floor(durationMs / (1000 * 60)) % 60 + const hours = Math.floor(durationMs / (1000 * 60 * 60)) % 24 + const days = Math.floor(durationMs / (1000 * 60 * 60 * 24)) + + if (days > 0) { + return `${days}d ${hours}h` + } else if (hours > 0) { + return `${hours}h ${minutes}m` + } else if (minutes > 0) { + return `${minutes}m ${seconds}s` + } else if (seconds > 0) { + return `${seconds}s ${ms}ms` + } else { + return `${ms}ms` + } +} diff --git a/webui/openapi-ts.config.ts b/webui/openapi-ts.config.ts new file mode 100644 index 0000000000..aadd5ad884 --- /dev/null +++ b/webui/openapi-ts.config.ts @@ -0,0 +1,32 @@ +import { defineConfig } from '@hey-api/openapi-ts' + +export default defineConfig({ + client: '@hey-api/client-fetch', + input: 'lib/api/schema/swagger.json', + output: { + path: 'lib/api/generated', + format: 'prettier', + lint: 'eslint', + }, + types: { + enums: 'typescript', + }, + services: { + asClass: true, + name: '{{name}}', // This removes the 'Service' suffix + methodNameBuilder: (operation) => { + let methodName = operation.name + if ( + operation.service && + methodName.toLowerCase().startsWith(operation.service.toLowerCase()) + ) { + methodName = methodName.slice(operation.service.length) + } + // Ensure the first letter is lowercase + return methodName.charAt(0).toLowerCase() + methodName.slice(1) + }, + }, + schemas: { + export: false, + }, +}) diff --git a/webui/package.json b/webui/package.json index 27cf9607b8..6f4ad63331 100644 --- a/webui/package.json +++ b/webui/package.json @@ -9,9 +9,10 @@ "lint": "next lint", "format": "prettier --write .", "format:check": "prettier --check .", - "generate-api": "openapi --input ./lib/api/schema/swagger.json --output ./lib/api/generated --client axios" + "generate-api": "openapi-ts" }, "dependencies": { + "@hey-api/client-fetch": "^0.2.4", "@radix-ui/react-alert-dialog": "^1.1.1", "@radix-ui/react-dialog": "^1.1.1", "@radix-ui/react-dropdown-menu": "^2.1.1", @@ -35,6 +36,7 @@ "tailwindcss-animate": "^1.0.7" }, "devDependencies": { + "@hey-api/openapi-ts": "^0.53.0", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", diff --git a/webui/yarn.lock b/webui/yarn.lock index 69e794bd23..f645055fda 100644 --- a/webui/yarn.lock +++ b/webui/yarn.lock @@ -12,7 +12,7 @@ __metadata: languageName: node linkType: hard -"@apidevtools/json-schema-ref-parser@npm:^11.5.4": +"@apidevtools/json-schema-ref-parser@npm:11.7.0, @apidevtools/json-schema-ref-parser@npm:^11.5.4": version: 11.7.0 resolution: "@apidevtools/json-schema-ref-parser@npm:11.7.0" dependencies: @@ -112,6 +112,29 @@ __metadata: languageName: node linkType: hard +"@hey-api/client-fetch@npm:^0.2.4": + version: 0.2.4 + resolution: "@hey-api/client-fetch@npm:0.2.4" + checksum: 10c0/041f53de12d34ee7a2dec45e390392a98cac32773724c700a1c6d6c2b3d3c26a455f37e8dc6a6245ef4430ad48560db7e0447eee6b23ca32352c2ee1533c7055 + languageName: node + linkType: hard + +"@hey-api/openapi-ts@npm:^0.53.0": + version: 0.53.0 + resolution: "@hey-api/openapi-ts@npm:0.53.0" + dependencies: + "@apidevtools/json-schema-ref-parser": "npm:11.7.0" + c12: "npm:1.11.1" + commander: "npm:12.1.0" + handlebars: "npm:4.7.8" + peerDependencies: + typescript: ^5.x + bin: + openapi-ts: bin/index.cjs + checksum: 10c0/557c5eee94f15a2d5c950e9185395d2044b8a56b126a6de39f8b734742b56f66804c8e275501ba0b77fdf3738ebe77c3629ed97d2d0b54526da96f838d6df525 + languageName: node + linkType: hard + "@humanwhocodes/config-array@npm:^0.11.14": version: 0.11.14 resolution: "@humanwhocodes/config-array@npm:0.11.14" @@ -1237,7 +1260,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.9.0": +"acorn@npm:^8.11.3, acorn@npm:^8.9.0": version: 8.12.1 resolution: "acorn@npm:8.12.1" bin: @@ -1567,6 +1590,31 @@ __metadata: languageName: node linkType: hard +"c12@npm:1.11.1": + version: 1.11.1 + resolution: "c12@npm:1.11.1" + dependencies: + chokidar: "npm:^3.6.0" + confbox: "npm:^0.1.7" + defu: "npm:^6.1.4" + dotenv: "npm:^16.4.5" + giget: "npm:^1.2.3" + jiti: "npm:^1.21.6" + mlly: "npm:^1.7.1" + ohash: "npm:^1.1.3" + pathe: "npm:^1.1.2" + perfect-debounce: "npm:^1.0.0" + pkg-types: "npm:^1.1.1" + rc9: "npm:^2.1.2" + peerDependencies: + magicast: ^0.3.4 + peerDependenciesMeta: + magicast: + optional: true + checksum: 10c0/4711a399b8ce54258982ffa4df15c88a1f12bbb23a806ebdb1d1b9e17134a1a3bf65be4ab0095b648bfc8f21646e3d343f6a8f12b130d459c3c7ef13437f5e92 + languageName: node + linkType: hard + "cacache@npm:^18.0.0": version: 18.0.4 resolution: "cacache@npm:18.0.4" @@ -1659,7 +1707,7 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:^3.5.3": +"chokidar@npm:^3.5.3, chokidar@npm:^3.6.0": version: 3.6.0 resolution: "chokidar@npm:3.6.0" dependencies: @@ -1685,6 +1733,15 @@ __metadata: languageName: node linkType: hard +"citty@npm:^0.1.6": + version: 0.1.6 + resolution: "citty@npm:0.1.6" + dependencies: + consola: "npm:^3.2.3" + checksum: 10c0/d26ad82a9a4a8858c7e149d90b878a3eceecd4cfd3e2ed3cd5f9a06212e451fb4f8cbe0fa39a3acb1b3e8f18e22db8ee5def5829384bad50e823d4b301609b48 + languageName: node + linkType: hard + "class-variance-authority@npm:^0.7.0": version: 0.7.0 resolution: "class-variance-authority@npm:0.7.0" @@ -1754,7 +1811,7 @@ __metadata: languageName: node linkType: hard -"commander@npm:^12.0.0": +"commander@npm:12.1.0, commander@npm:^12.0.0": version: 12.1.0 resolution: "commander@npm:12.1.0" checksum: 10c0/6e1996680c083b3b897bfc1cfe1c58dfbcd9842fd43e1aaf8a795fbc237f65efcc860a3ef457b318e73f29a4f4a28f6403c3d653d021d960e4632dd45bde54a9 @@ -1775,7 +1832,21 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2": +"confbox@npm:^0.1.7": + version: 0.1.7 + resolution: "confbox@npm:0.1.7" + checksum: 10c0/18b40c2f652196a833f3f1a5db2326a8a579cd14eacabfe637e4fc8cb9b68d7cf296139a38c5e7c688ce5041bf46f9adce05932d43fde44cf7e012840b5da111 + languageName: node + linkType: hard + +"consola@npm:^3.2.3": + version: 3.2.3 + resolution: "consola@npm:3.2.3" + checksum: 10c0/c606220524ec88a05bb1baf557e9e0e04a0c08a9c35d7a08652d99de195c4ddcb6572040a7df57a18ff38bbc13ce9880ad032d56630cef27bef72768ef0ac078 + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" dependencies: @@ -1918,6 +1989,13 @@ __metadata: languageName: node linkType: hard +"defu@npm:^6.1.4": + version: 6.1.4 + resolution: "defu@npm:6.1.4" + checksum: 10c0/2d6cc366262dc0cb8096e429368e44052fdf43ed48e53ad84cc7c9407f890301aa5fcb80d0995abaaf842b3949f154d060be4160f7a46cb2bc2f7726c81526f5 + languageName: node + linkType: hard + "delayed-stream@npm:~1.0.0": version: 1.0.0 resolution: "delayed-stream@npm:1.0.0" @@ -1925,6 +2003,13 @@ __metadata: languageName: node linkType: hard +"destr@npm:^2.0.3": + version: 2.0.3 + resolution: "destr@npm:2.0.3" + checksum: 10c0/10e7eff5149e2839a4dd29a1e9617c3c675a3b53608d78d74fc6f4abc31daa977e6de08e0eea78965527a0d5a35467ae2f9624e0a4646d54aa1162caa094473e + languageName: node + linkType: hard + "detect-node-es@npm:^1.1.0": version: 1.1.0 resolution: "detect-node-es@npm:1.1.0" @@ -1973,6 +2058,13 @@ __metadata: languageName: node linkType: hard +"dotenv@npm:^16.4.5": + version: 16.4.5 + resolution: "dotenv@npm:16.4.5" + checksum: 10c0/48d92870076832af0418b13acd6e5a5a3e83bb00df690d9812e94b24aff62b88ade955ac99a05501305b8dc8f1b0ee7638b18493deb6fe93d680e5220936292f + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -2484,6 +2576,23 @@ __metadata: languageName: node linkType: hard +"execa@npm:^8.0.1": + version: 8.0.1 + resolution: "execa@npm:8.0.1" + dependencies: + cross-spawn: "npm:^7.0.3" + get-stream: "npm:^8.0.1" + human-signals: "npm:^5.0.0" + is-stream: "npm:^3.0.0" + merge-stream: "npm:^2.0.0" + npm-run-path: "npm:^5.1.0" + onetime: "npm:^6.0.0" + signal-exit: "npm:^4.1.0" + strip-final-newline: "npm:^3.0.0" + checksum: 10c0/2c52d8775f5bf103ce8eec9c7ab3059909ba350a5164744e9947ed14a53f51687c040a250bda833f906d1283aa8803975b84e6c8f7a7c42f99dc8ef80250d1af + languageName: node + linkType: hard + "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -2744,6 +2853,13 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^8.0.1": + version: 8.0.1 + resolution: "get-stream@npm:8.0.1" + checksum: 10c0/5c2181e98202b9dae0bb4a849979291043e5892eb40312b47f0c22b9414fc9b28a3b6063d2375705eb24abc41ecf97894d9a51f64ff021511b504477b27b4290 + languageName: node + linkType: hard + "get-symbol-description@npm:^1.0.2": version: 1.0.2 resolution: "get-symbol-description@npm:1.0.2" @@ -2764,6 +2880,24 @@ __metadata: languageName: node linkType: hard +"giget@npm:^1.2.3": + version: 1.2.3 + resolution: "giget@npm:1.2.3" + dependencies: + citty: "npm:^0.1.6" + consola: "npm:^3.2.3" + defu: "npm:^6.1.4" + node-fetch-native: "npm:^1.6.3" + nypm: "npm:^0.3.8" + ohash: "npm:^1.1.3" + pathe: "npm:^1.1.2" + tar: "npm:^6.2.0" + bin: + giget: dist/cli.mjs + checksum: 10c0/0e82836783c704346fdda83e23d144e97f28a959320b1d8ee73c69a5af562362bcb727cf6ad99f90e45ed8a6abec140833534bb1fedcaa1c06fa026daaf3119c + languageName: node + linkType: hard + "glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -2883,7 +3017,7 @@ __metadata: languageName: node linkType: hard -"handlebars@npm:^4.7.8": +"handlebars@npm:4.7.8, handlebars@npm:^4.7.8": version: 4.7.8 resolution: "handlebars@npm:4.7.8" dependencies: @@ -3010,6 +3144,13 @@ __metadata: languageName: node linkType: hard +"human-signals@npm:^5.0.0": + version: 5.0.0 + resolution: "human-signals@npm:5.0.0" + checksum: 10c0/5a9359073fe17a8b58e5a085e9a39a950366d9f00217c4ff5878bd312e09d80f460536ea6a3f260b5943a01fe55c158d1cea3fc7bee3d0520aeef04f6d915c82 + languageName: node + linkType: hard + "iconv-lite@npm:^0.6.2": version: 0.6.3 resolution: "iconv-lite@npm:0.6.3" @@ -3339,6 +3480,13 @@ __metadata: languageName: node linkType: hard +"is-stream@npm:^3.0.0": + version: 3.0.0 + resolution: "is-stream@npm:3.0.0" + checksum: 10c0/eb2f7127af02ee9aa2a0237b730e47ac2de0d4e76a4a905a50a11557f2339df5765eaea4ceb8029f1efa978586abe776908720bfcb1900c20c6ec5145f6f29d8 + languageName: node + linkType: hard + "is-string@npm:^1.0.5, is-string@npm:^1.0.7": version: 1.0.7 resolution: "is-string@npm:1.0.7" @@ -3452,7 +3600,7 @@ __metadata: languageName: node linkType: hard -"jiti@npm:^1.21.0": +"jiti@npm:^1.21.0, jiti@npm:^1.21.6": version: 1.21.6 resolution: "jiti@npm:1.21.6" bin: @@ -3672,6 +3820,13 @@ __metadata: languageName: node linkType: hard +"merge-stream@npm:^2.0.0": + version: 2.0.0 + resolution: "merge-stream@npm:2.0.0" + checksum: 10c0/867fdbb30a6d58b011449b8885601ec1690c3e41c759ecd5a9d609094f7aed0096c37823ff4a7190ef0b8f22cc86beb7049196ff68c016e3b3c671d0dac91ce5 + languageName: node + linkType: hard + "merge2@npm:^1.3.0, merge2@npm:^1.4.1": version: 1.4.1 resolution: "merge2@npm:1.4.1" @@ -3705,6 +3860,13 @@ __metadata: languageName: node linkType: hard +"mimic-fn@npm:^4.0.0": + version: 4.0.0 + resolution: "mimic-fn@npm:4.0.0" + checksum: 10c0/de9cc32be9996fd941e512248338e43407f63f6d497abe8441fa33447d922e927de54d4cc3c1a3c6d652857acd770389d5a3823f311a744132760ce2be15ccbf + languageName: node + linkType: hard + "minimatch@npm:9.0.3": version: 9.0.3 resolution: "minimatch@npm:9.0.3" @@ -3832,6 +3994,18 @@ __metadata: languageName: node linkType: hard +"mlly@npm:^1.7.1": + version: 1.7.1 + resolution: "mlly@npm:1.7.1" + dependencies: + acorn: "npm:^8.11.3" + pathe: "npm:^1.1.2" + pkg-types: "npm:^1.1.1" + ufo: "npm:^1.5.3" + checksum: 10c0/d836a7b0adff4d118af41fb93ad4d9e57f80e694a681185280ba220a4607603c19e86c80f9a6c57512b04280567f2599e3386081705c5b5fd74c9ddfd571d0fa + languageName: node + linkType: hard + "ms@npm:2.1.2": version: 2.1.2 resolution: "ms@npm:2.1.2" @@ -3955,6 +4129,13 @@ __metadata: languageName: node linkType: hard +"node-fetch-native@npm:^1.6.3": + version: 1.6.4 + resolution: "node-fetch-native@npm:1.6.4" + checksum: 10c0/78334dc6def5d1d95cfe87b33ac76c4833592c5eb84779ad2b0c23c689f9dd5d1cfc827035ada72d6b8b218f717798968c5a99aeff0a1a8bf06657e80592f9c3 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 10.2.0 resolution: "node-gyp@npm:10.2.0" @@ -3993,6 +4174,31 @@ __metadata: languageName: node linkType: hard +"npm-run-path@npm:^5.1.0": + version: 5.3.0 + resolution: "npm-run-path@npm:5.3.0" + dependencies: + path-key: "npm:^4.0.0" + checksum: 10c0/124df74820c40c2eb9a8612a254ea1d557ddfab1581c3e751f825e3e366d9f00b0d76a3c94ecd8398e7f3eee193018622677e95816e8491f0797b21e30b2deba + languageName: node + linkType: hard + +"nypm@npm:^0.3.8": + version: 0.3.11 + resolution: "nypm@npm:0.3.11" + dependencies: + citty: "npm:^0.1.6" + consola: "npm:^3.2.3" + execa: "npm:^8.0.1" + pathe: "npm:^1.1.2" + pkg-types: "npm:^1.2.0" + ufo: "npm:^1.5.4" + bin: + nypm: dist/cli.mjs + checksum: 10c0/016a74110f9629ddb9ee06d378aca56004ba0cbf824defb1f558342e411051443f95ae20171f538691798d4ac1da72d7582192c1a9c858843a2a90d6f5c3f86b + languageName: node + linkType: hard + "object-assign@npm:^4.0.1, object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" @@ -4088,6 +4294,13 @@ __metadata: languageName: node linkType: hard +"ohash@npm:^1.1.3": + version: 1.1.3 + resolution: "ohash@npm:1.1.3" + checksum: 10c0/928f5bdbd8cd73f90cf544c0533dbda8e0a42d9b8c7454ab89e64e4d11bc85f85242830b4e107426ce13dc4dd3013286f8f5e0c84abd8942a014b907d9692540 + languageName: node + linkType: hard + "once@npm:^1.3.0": version: 1.4.0 resolution: "once@npm:1.4.0" @@ -4097,6 +4310,15 @@ __metadata: languageName: node linkType: hard +"onetime@npm:^6.0.0": + version: 6.0.0 + resolution: "onetime@npm:6.0.0" + dependencies: + mimic-fn: "npm:^4.0.0" + checksum: 10c0/4eef7c6abfef697dd4479345a4100c382d73c149d2d56170a54a07418c50816937ad09500e1ed1e79d235989d073a9bade8557122aee24f0576ecde0f392bb6c + languageName: node + linkType: hard + "openapi-typescript-codegen@npm:^0.29.0": version: 0.29.0 resolution: "openapi-typescript-codegen@npm:0.29.0" @@ -4204,6 +4426,13 @@ __metadata: languageName: node linkType: hard +"path-key@npm:^4.0.0": + version: 4.0.0 + resolution: "path-key@npm:4.0.0" + checksum: 10c0/794efeef32863a65ac312f3c0b0a99f921f3e827ff63afa5cb09a377e202c262b671f7b3832a4e64731003fa94af0263713962d317b9887bd1e0c48a342efba3 + languageName: node + linkType: hard + "path-parse@npm:^1.0.7": version: 1.0.7 resolution: "path-parse@npm:1.0.7" @@ -4228,6 +4457,20 @@ __metadata: languageName: node linkType: hard +"pathe@npm:^1.1.2": + version: 1.1.2 + resolution: "pathe@npm:1.1.2" + checksum: 10c0/64ee0a4e587fb0f208d9777a6c56e4f9050039268faaaaecd50e959ef01bf847b7872785c36483fa5cdcdbdfdb31fef2ff222684d4fc21c330ab60395c681897 + languageName: node + linkType: hard + +"perfect-debounce@npm:^1.0.0": + version: 1.0.0 + resolution: "perfect-debounce@npm:1.0.0" + checksum: 10c0/e2baac416cae046ef1b270812cf9ccfb0f91c04ea36ac7f5b00bc84cb7f41bdbba087c0ab21b4e02a7ef3a1f1f6db399f137cecec46868bd7d8d88c2a9ee431f + languageName: node + linkType: hard + "picocolors@npm:^1.0.0, picocolors@npm:^1.0.1": version: 1.1.0 resolution: "picocolors@npm:1.1.0" @@ -4256,6 +4499,17 @@ __metadata: languageName: node linkType: hard +"pkg-types@npm:^1.1.1, pkg-types@npm:^1.2.0": + version: 1.2.0 + resolution: "pkg-types@npm:1.2.0" + dependencies: + confbox: "npm:^0.1.7" + mlly: "npm:^1.7.1" + pathe: "npm:^1.1.2" + checksum: 10c0/111cf6ad4235438821ea195a0d70570b1bd36a71d094d258349027c9c304dea8b4f9669c9f7ce813f9a48a02942fb0d7fe9809127dbe7bb4b18a8de71583a081 + languageName: node + linkType: hard + "possible-typed-array-names@npm:^1.0.0": version: 1.0.0 resolution: "possible-typed-array-names@npm:1.0.0" @@ -4452,6 +4706,16 @@ __metadata: languageName: node linkType: hard +"rc9@npm:^2.1.2": + version: 2.1.2 + resolution: "rc9@npm:2.1.2" + dependencies: + defu: "npm:^6.1.4" + destr: "npm:^2.0.3" + checksum: 10c0/a2ead3b94bf033e35e4ea40d70062a09feddb8f589c3f5a8fe4e9342976974296aee9f6e9e72bd5e78e6ae4b7bc16dc244f63699fd7322c16314e3238db982c9 + languageName: node + linkType: hard + "react-dom@npm:^18": version: 18.3.1 resolution: "react-dom@npm:18.3.1" @@ -4821,7 +5085,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^4.0.1": +"signal-exit@npm:^4.0.1, signal-exit@npm:^4.1.0": version: 4.1.0 resolution: "signal-exit@npm:4.1.0" checksum: 10c0/41602dce540e46d599edba9d9860193398d135f7ff72cab629db5171516cfae628d21e7bfccde1bbfdf11c48726bc2a6d1a8fb8701125852fbfda7cf19c6aa83 @@ -5037,6 +5301,13 @@ __metadata: languageName: node linkType: hard +"strip-final-newline@npm:^3.0.0": + version: 3.0.0 + resolution: "strip-final-newline@npm:3.0.0" + checksum: 10c0/a771a17901427bac6293fd416db7577e2bc1c34a19d38351e9d5478c3c415f523f391003b42ed475f27e33a78233035df183525395f731d3bfb8cdcbd4da08ce + languageName: node + linkType: hard + "strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" @@ -5160,7 +5431,7 @@ __metadata: languageName: node linkType: hard -"tar@npm:^6.1.11, tar@npm:^6.2.1": +"tar@npm:^6.1.11, tar@npm:^6.2.0, tar@npm:^6.2.1": version: 6.2.1 resolution: "tar@npm:6.2.1" dependencies: @@ -5331,6 +5602,13 @@ __metadata: languageName: node linkType: hard +"ufo@npm:^1.5.3, ufo@npm:^1.5.4": + version: 1.5.4 + resolution: "ufo@npm:1.5.4" + checksum: 10c0/b5dc4dc435c49c9ef8890f1b280a19ee4d0954d1d6f9ab66ce62ce64dd04c7be476781531f952a07c678d51638d02ad4b98e16237be29149295b0f7c09cda765 + languageName: node + linkType: hard + "uglify-js@npm:^3.1.4": version: 3.19.3 resolution: "uglify-js@npm:3.19.3" @@ -5435,6 +5713,8 @@ __metadata: version: 0.0.0-use.local resolution: "webui@workspace:." dependencies: + "@hey-api/client-fetch": "npm:^0.2.4" + "@hey-api/openapi-ts": "npm:^0.53.0" "@radix-ui/react-alert-dialog": "npm:^1.1.1" "@radix-ui/react-dialog": "npm:^1.1.1" "@radix-ui/react-dropdown-menu": "npm:^2.1.1"