Skip to content

feat: support HA Hasura #1120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function hasuraIntegrationCreateCommand() {
settlemint.integrationTool.create({
name,
applicationUniqueName,
integrationType: "HASURA",
integrationType: "HA_HASURA",
provider,
region,
size,
Expand Down
6 changes: 4 additions & 2 deletions sdk/cli/src/prompts/cluster-service/hasura.prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { type BaseServicePromptArgs, servicePrompt } from "@/prompts/cluster-ser
import select from "@inquirer/select";
import type { IntegrationTool } from "@settlemint/sdk-js";

export type Hasura = Extract<IntegrationTool, { __typename: "Hasura" }>;
export type Hasura =
| Extract<IntegrationTool, { __typename: "Hasura" }>
| Extract<IntegrationTool, { __typename: "HAHasura" }>;

export function isHasura(integration: IntegrationTool): integration is Hasura {
return integration.__typename === "Hasura";
return integration.__typename === "Hasura" || integration.__typename === "HAHasura";
}

export interface HasuraPromptArgs extends BaseServicePromptArgs {
Expand Down
2 changes: 1 addition & 1 deletion sdk/cli/src/utils/get-cluster-service-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function getPortalEnv(service: Middleware | undefined): Partial<DotEnv> {
}

export function getHasuraEnv(service: IntegrationTool | undefined): Partial<DotEnv> {
if (!service || service.__typename !== "Hasura") {
if (!service || (service.__typename !== "Hasura" && service.__typename !== "HAHasura")) {
return {};
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
},
"scripts": {
"codegen": "gql-tada generate-schema ${CONSOLE_GRAPHQL:-https://console.settlemint.com/api/graphql} && gql-tada generate-output && gql-tada turbo",
"codegen": "gql-tada generate-schema ${CONSOLE_GRAPHQL:-https://console-release.settlemint.com/api/graphql} && gql-tada generate-output && gql-tada turbo",
"build": "tsdown",
"dev": "tsdown --watch",
"publint": "publint run --strict",
Expand Down
296 changes: 294 additions & 2 deletions sdk/js/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -9975,6 +9975,296 @@ type HAGraphMiddleware implements AbstractClusterService & AbstractEntity & Midd
version: String
}

type HAGraphPostgresMiddleware implements AbstractClusterService & AbstractEntity & Middleware {
"""Advanced deployment configuration"""
advancedDeploymentConfig: AdvancedDeploymentConfig

"""Associated application"""
application: Application!
applicationDashBoardDependantsTree: DependantsTree!
blockchainNode: BlockchainNode

"""Date and time when the entity was created"""
createdAt: DateTime!

"""Credentials of cluster service"""
credentials: [ClusterServiceCredentials!]!

"""Default subgraph for the HA Graph PostgreSQL middleware"""
defaultSubgraph: String

"""Date and time when the entity was deleted, if applicable"""
deletedAt: DateTime

"""Dependant services"""
dependants: [Dependant!]!
dependantsTree: DependantsTree!

"""Dependencies of the service"""
dependencies: [Dependency!]!

"""Destroy job identifier"""
destroyJob: String

"""Indicates if the service auth is disabled"""
disableAuth: Boolean

"""Disk space in GB"""
diskSpace: Int

"""Endpoints of cluster service"""
endpoints: [ClusterServiceEndpoints!]!

"""Entity version"""
entityVersion: Float

"""Date when the service failed"""
failedAt: DateTime!

"""Database name for the HA Graph PostgreSQL middleware"""
graphMiddlewareDbName: String

"""Health status of the service"""
healthStatus: ClusterServiceHealthStatus!

"""Unique identifier of the entity"""
id: ID!

"""The interface type of the middleware"""
interface: MiddlewareType!

"""Indicates if the pod is handling traffic"""
isPodHandlingTraffic: Boolean!

"""Indicates if the pod is running"""
isPodRunning: Boolean!
jobLogs: [String!]!
jobProgress: Float!

"""Date when the service was last completed"""
lastCompletedAt: DateTime!
latestVersion: String!

"""CPU limit in millicores"""
limitCpu: Int

"""Memory limit in MB"""
limitMemory: Int
loadBalancer: LoadBalancer

"""Indicates if the service is locked"""
locked: Boolean!
metrics: Metric!

"""Name of the service"""
name: String!
namespace: String!

"""Password for the service"""
password: String!

"""Date when the service was paused"""
pausedAt: DateTime

"""Product name of the service"""
productName: String!

"""Provider of the service"""
provider: String!

"""Region of the service"""
region: String!
requestLogs: [RequestLog!]!

"""CPU requests in millicores"""
requestsCpu: Int

"""Memory requests in MB"""
requestsMemory: Int

"""Resource status of the service"""
resourceStatus: ClusterServiceResourceStatus!

"""Date when the service was scaled"""
scaledAt: DateTime
serviceLogs: [String!]!
serviceUrl: String!

"""Size of the service"""
size: ClusterServiceSize!

"""Slug of the service"""
slug: String!

"""The associated smart contract set"""
smartContractSet: SmartContractSetType

"""Spec version for the HA Graph PostgreSQL middleware"""
specVersion: String!

"""Deployment status of the service"""
status: ClusterServiceDeploymentStatus!
storage: StorageType
subgraphs(noCache: Boolean! = false): [Subgraph!]!

"""Type of the service"""
type: ClusterServiceType!

"""Unique name of the service"""
uniqueName: String!

"""Up job identifier"""
upJob: String

"""Date and time when the entity was last updated"""
updatedAt: DateTime!
upgradable: Boolean!
user: User!

"""UUID of the service"""
uuid: String!

"""Version of the service"""
version: String
}

type HAHasura implements AbstractClusterService & AbstractEntity & Integration {
"""Advanced deployment configuration"""
advancedDeploymentConfig: AdvancedDeploymentConfig

"""Associated application"""
application: Application!
applicationDashBoardDependantsTree: DependantsTree!

"""Date and time when the entity was created"""
createdAt: DateTime!

"""Credentials of cluster service"""
credentials: [ClusterServiceCredentials!]!

"""Date and time when the entity was deleted, if applicable"""
deletedAt: DateTime

"""Dependant services"""
dependants: [Dependant!]!
dependantsTree: DependantsTree!

"""Dependencies of the service"""
dependencies: [Dependency!]!

"""Destroy job identifier"""
destroyJob: String

"""Indicates if the service auth is disabled"""
disableAuth: Boolean

"""Disk space in GB"""
diskSpace: Int

"""Endpoints of cluster service"""
endpoints: [ClusterServiceEndpoints!]!

"""Entity version"""
entityVersion: Float

"""Date when the service failed"""
failedAt: DateTime!

"""Health status of the service"""
healthStatus: ClusterServiceHealthStatus!

"""Unique identifier of the entity"""
id: ID!

"""The type of integration"""
integrationType: IntegrationType!

"""Indicates if the pod is handling traffic"""
isPodHandlingTraffic: Boolean!

"""Indicates if the pod is running"""
isPodRunning: Boolean!
jobLogs: [String!]!
jobProgress: Float!

"""Date when the service was last completed"""
lastCompletedAt: DateTime!
latestVersion: String!

"""CPU limit in millicores"""
limitCpu: Int

"""Memory limit in MB"""
limitMemory: Int

"""Indicates if the service is locked"""
locked: Boolean!
metrics: Metric!

"""Name of the service"""
name: String!
namespace: String!

"""Password for the service"""
password: String!

"""Date when the service was paused"""
pausedAt: DateTime

"""Product name of the service"""
productName: String!

"""Provider of the service"""
provider: String!

"""Region of the service"""
region: String!
requestLogs: [RequestLog!]!

"""CPU requests in millicores"""
requestsCpu: Int

"""Memory requests in MB"""
requestsMemory: Int

"""Resource status of the service"""
resourceStatus: ClusterServiceResourceStatus!

"""Date when the service was scaled"""
scaledAt: DateTime
serviceLogs: [String!]!
serviceUrl: String!

"""Size of the service"""
size: ClusterServiceSize!

"""Slug of the service"""
slug: String!

"""Deployment status of the service"""
status: ClusterServiceDeploymentStatus!

"""Type of the service"""
type: ClusterServiceType!

"""Unique name of the service"""
uniqueName: String!

"""Up job identifier"""
upJob: String

"""Date and time when the entity was last updated"""
updatedAt: DateTime!
upgradable: Boolean!
user: User!

"""UUID of the service"""
uuid: String!

"""Version of the service"""
version: String
}

type Hasura implements AbstractClusterService & AbstractEntity & Integration {
"""Advanced deployment configuration"""
advancedDeploymentConfig: AdvancedDeploymentConfig
Expand Down Expand Up @@ -12195,10 +12485,11 @@ type IntegrationStudio implements AbstractClusterService & AbstractEntity & Inte
enum IntegrationType {
CHAINLINK
HASURA
HA_HASURA
INTEGRATION_STUDIO
}

union IntegrationTypeUnion = Chainlink | Hasura | IntegrationStudio
union IntegrationTypeUnion = Chainlink | HAHasura | Hasura | IntegrationStudio

"""Invoice details"""
type InvoiceInfo {
Expand Down Expand Up @@ -12604,10 +12895,11 @@ enum MiddlewareType {
FIREFLY_FABCONNECT
GRAPH
HA_GRAPH
HA_GRAPH_POSTGRES
SMART_CONTRACT_PORTAL
}

union MiddlewareUnionType = AttestationIndexerMiddleware | BesuMiddleware | FireflyFabconnectMiddleware | GraphMiddleware | HAGraphMiddleware | SmartContractPortalMiddleware
union MiddlewareUnionType = AttestationIndexerMiddleware | BesuMiddleware | FireflyFabconnectMiddleware | GraphMiddleware | HAGraphMiddleware | HAGraphPostgresMiddleware | SmartContractPortalMiddleware

type MinioStorage implements AbstractClusterService & AbstractEntity & Storage {
"""Advanced deployment configuration"""
Expand Down
Loading