@settlemint/sdk-js 2.6.2 → 2.6.3-mainabd442a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -19
- package/dist/settlemint.cjs +16 -7
- package/dist/settlemint.cjs.map +1 -1
- package/dist/settlemint.d.cts +22829 -140624
- package/dist/settlemint.d.ts +22829 -140624
- package/dist/settlemint.js +2 -0
- package/dist/settlemint.js.map +1 -1
- package/package.json +3 -3
package/dist/settlemint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settlemint.js","names":["graphql: initGraphQLTada<{\n introspection: introspection;\n disableMasking: true;\n scalars: {\n DateTime: Date;\n JSON: Record<string, unknown>;\n Bytes: string;\n Int8: string;\n BigInt: string;\n BigDecimal: string;\n Timestamp: string;\n };\n}>","verificationChallenges: VerificationChallenge[]","data: { errors: { message: string }[] }"],"sources":["../src/helpers/graphql.ts","../src/graphql/workspace.ts","../src/graphql/application.ts","../src/graphql/application-access-tokens.ts","../src/defaults/cluster-service-defaults.ts","../src/defaults/blockchain-network-defaults.ts","../src/graphql/blockchain-network.ts","../src/graphql/blockchain-node.ts","../src/graphql/custom-deployment.ts","../src/graphql/foundry.ts","../src/graphql/load-balancer.ts","../src/graphql/insights.ts","../src/graphql/integration-tool.ts","../src/graphql/storage.ts","../src/graphql/middleware.ts","../src/graphql/platform.ts","../src/graphql/private-key.ts","../src/helpers/client-options.schema.ts","../src/pincode-verification.ts","../src/settlemint.ts"],"sourcesContent":["/**\n * This module initializes and exports GraphQL-related utilities using gql.tada.\n * It sets up the GraphQL client with specific configurations and exports necessary types and functions.\n */\n\nimport { initGraphQLTada } from \"gql.tada\";\nimport type { introspection } from \"./graphql-env.d.ts\";\n\n/**\n * Initializes the GraphQL client with specific configurations.\n *\n * @returns A configured GraphQL client instance.\n */\nexport const graphql: initGraphQLTada<{\n introspection: introspection;\n disableMasking: true;\n scalars: {\n DateTime: Date;\n JSON: Record<string, unknown>;\n Bytes: string;\n Int8: string;\n BigInt: string;\n BigDecimal: string;\n Timestamp: string;\n };\n}> = initGraphQLTada<{\n introspection: introspection;\n disableMasking: true;\n scalars: {\n DateTime: Date;\n JSON: Record<string, unknown>;\n Bytes: string;\n Int8: string;\n BigInt: string;\n BigDecimal: string;\n Timestamp: string;\n };\n}>();\n\nexport { readFragment } from \"gql.tada\";\nexport type { FragmentOf, ResultOf, VariablesOf } from \"gql.tada\";\n","import { type Id, IdSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * GraphQL fragment containing core workspace fields.\n */\nconst WorkspaceFragment = graphql(\n `\n fragment Workspace on Workspace {\n id\n uniqueName\n name\n applications {\n id\n uniqueName\n name\n }\n }\n `,\n);\n\n/**\n * Type representing a workspace entity.\n */\nexport type Workspace = ResultOf<typeof WorkspaceFragment>;\n\n/**\n * Query to fetch all workspaces and their applications.\n */\nconst getWorkspacesAndApplications = graphql(\n `\n query getWorkspacesAndApplications {\n workspaces {\n ...Workspace\n childWorkspaces {\n ...Workspace\n }\n }\n }\n `,\n [WorkspaceFragment],\n);\n\n/**\n * Query to fetch a specific workspace by unique name.\n */\nconst getWorkspace = graphql(\n `\n query getWorkspace($uniqueName: String!) {\n workspaceByUniqueName(uniqueName: $uniqueName) {\n ...Workspace\n }\n }\n `,\n [WorkspaceFragment],\n);\n\n/**\n * Mutation to create a new workspace.\n */\nconst createWorkspace = graphql(\n `\n mutation CreateWorkspace(\n $addressLine1: String\n $addressLine2: String\n $city: String\n $companyName: String\n $country: String\n $name: String!\n $parentId: String\n $paymentMethodId: String\n $postalCode: String\n $taxIdType: String\n $taxIdValue: String\n ) {\n createWorkspace(\n addressLine1: $addressLine1\n addressLine2: $addressLine2\n city: $city\n companyName: $companyName\n country: $country\n name: $name\n parentId: $parentId\n paymentMethodId: $paymentMethodId\n postalCode: $postalCode\n taxIdType: $taxIdType\n taxIdValue: $taxIdValue\n ) {\n ...Workspace\n }\n }\n `,\n [WorkspaceFragment],\n);\n\nexport type CreateWorkspaceArgs = VariablesOf<typeof createWorkspace>;\n\n/**\n * Mutation to delete a workspace.\n */\nconst deleteWorkspace = graphql(\n `\n mutation deleteWorkspace($uniqueName: String!) {\n deleteWorkspaceByUniqueName(uniqueName: $uniqueName) {\n ...Workspace\n }\n }\n `,\n [WorkspaceFragment],\n);\n\n/**\n * Mutation to add credits to a workspace.\n */\nconst addCredits = graphql(\n `\n mutation addCredits($workspaceId: String!, $amount: Float!) {\n addCredits(workspaceId: $workspaceId, amount: $amount)\n }\n `,\n);\n\n/**\n * Creates a function to list all workspaces and their applications.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that returns all workspaces sorted by name\n * @throws If the request fails\n */\nexport const workspaceList = (gqlClient: GraphQLClient): (() => Promise<Workspace[]>) => {\n return async () => {\n const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);\n const allWorkspaces = workspaces.reduce<Workspace[]>((acc, workspace) => {\n acc.push(workspace);\n if (workspace.childWorkspaces) {\n acc.push(...workspace.childWorkspaces);\n }\n return acc;\n }, []);\n return allWorkspaces.sort((a, b) => a.name.localeCompare(b.name));\n };\n};\n\n/**\n * Creates a function to read a specific workspace by unique name.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single workspace by unique name\n * @throws If the workspace cannot be found or the request fails\n */\nexport const workspaceRead = (gqlClient: GraphQLClient): ((workspaceUniqueName: string) => Promise<Workspace>) => {\n return async (workspaceUniqueName: string) => {\n const { workspaceByUniqueName } = await gqlClient.request(getWorkspace, { uniqueName: workspaceUniqueName });\n return workspaceByUniqueName;\n };\n};\n\n/**\n * Creates a function to create a new workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new workspace with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const workspaceCreate = (gqlClient: GraphQLClient) => {\n return async (createWorkspaceArgs: CreateWorkspaceArgs) => {\n const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);\n return workspace;\n };\n};\n\n/**\n * Creates a function to delete a workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that deletes a workspace by unique name\n * @throws If the workspace cannot be found or the deletion fails\n */\nexport const workspaceDelete = (gqlClient: GraphQLClient) => {\n return async (workspaceUniqueName: string) => {\n const { deleteWorkspaceByUniqueName: workspace } = await gqlClient.request(deleteWorkspace, {\n uniqueName: workspaceUniqueName,\n });\n return workspace;\n };\n};\n\n/**\n * Creates a function to add credits to a workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that adds credits to a workspace\n * @throws If the workspace ID is invalid or amount is not positive\n */\nexport const workspaceAddCredits = (gqlClient: GraphQLClient) => {\n return async (workspaceId: Id, amount: number) => {\n const id = validate(IdSchema, workspaceId);\n if (amount <= 0) {\n throw new Error(\"Credit amount must be a positive number\");\n }\n const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });\n return result;\n };\n};\n","import { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { workspaceRead } from \"./workspace.js\";\n\n/**\n * GraphQL fragment containing core application fields.\n */\nconst ApplicationFragment = graphql(`\n fragment Application on Application {\n id\n uniqueName\n name\n workspace {\n id\n uniqueName\n name\n }\n }\n`);\n\n/**\n * Type representing an application entity.\n */\nexport type Application = ResultOf<typeof ApplicationFragment>;\n\n/**\n * Query to fetch applications for a workspace.\n */\nconst listApplications = graphql(\n `\n query ListApplications($workspaceUniqueName: String!) {\n workspaceByUniqueName(uniqueName: $workspaceUniqueName) {\n applications {\n ...Application\n }\n }\n }\n `,\n [ApplicationFragment],\n);\n\n/**\n * Query to fetch a specific application.\n */\nconst readApplication = graphql(\n `\n query ReadApplication($applicationUniqueName: String!) {\n applicationByUniqueName(uniqueName: $applicationUniqueName) {\n ...Application\n }\n }\n `,\n [ApplicationFragment],\n);\n\n/**\n * Mutation to create a new application.\n */\nconst createApplication = graphql(\n `\n mutation CreateApplication($name: String!, $workspaceId: ID!) {\n createApplication(name: $name, workspaceId: $workspaceId) {\n ...Application\n }\n }\n `,\n [ApplicationFragment],\n);\n\n/**\n * Mutation to delete an application.\n */\nconst deleteApplication = graphql(\n `\n mutation DeleteApplication($uniqueName: String!) {\n deleteApplicationByUniqueName(uniqueName: $uniqueName) {\n ...Application\n }\n }\n `,\n [ApplicationFragment],\n);\n\n/**\n * Arguments required to create an application.\n */\nexport type CreateApplicationArgs = Omit<VariablesOf<typeof createApplication>, \"workspaceId\"> & {\n workspaceUniqueName: string;\n};\n\n/**\n * Creates a function to list applications in a workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches applications for a workspace\n * @throws If the workspace cannot be found or the request fails\n */\nexport const applicationList = (gqlClient: GraphQLClient) => {\n return async (workspaceUniqueName: string): Promise<Application[]> => {\n const {\n workspaceByUniqueName: { applications },\n } = await gqlClient.request(listApplications, { workspaceUniqueName });\n return applications;\n };\n};\n\n/**\n * Creates a function to fetch a specific application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single application by unique name\n * @throws If the application cannot be found or the request fails\n */\nexport const applicationRead = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string): Promise<Application> => {\n const { applicationByUniqueName: application } = await gqlClient.request(readApplication, {\n applicationUniqueName,\n });\n return application;\n };\n};\n\n/**\n * Creates a function to create a new application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new application with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const applicationCreate = (gqlClient: GraphQLClient) => {\n return async (args: CreateApplicationArgs): Promise<Application> => {\n const { workspaceUniqueName, ...otherArgs } = args;\n const workspace = await workspaceRead(gqlClient)(workspaceUniqueName);\n const { createApplication: application } = await gqlClient.request(createApplication, {\n ...otherArgs,\n workspaceId: workspace.id,\n });\n return application;\n };\n};\n\n/**\n * Creates a function to delete an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that deletes an application by unique name\n * @throws If the application cannot be found or the deletion fails\n */\nexport const applicationDelete = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string): Promise<Application> => {\n const { deleteApplicationByUniqueName: application } = await gqlClient.request(deleteApplication, {\n uniqueName: applicationUniqueName,\n });\n return application;\n };\n};\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\nconst createApplicationAccessToken = graphql(\n `\n mutation CreateApplicationAccessToken(\n $applicationId: ID!,\n $blockchainNetworkScope: BlockchainNetworkScopeInputType!,\n $blockchainNodeScope: BlockchainNodeScopeInputType!,\n $customDeploymentScope: CustomDeploymentScopeInputType!,\n $insightsScope: InsightsScopeInputType!,\n $integrationScope: IntegrationScopeInputType!,\n $loadBalancerScope: LoadBalancerScopeInputType!,\n $middlewareScope: MiddlewareScopeInputType!,\n $name: String!,\n $privateKeyScope: PrivateKeyScopeInputType!,\n $smartContractSetScope: SmartContractSetScopeInputType!,\n $storageScope: StorageScopeInputType!,\n $validityPeriod: AccessTokenValidityPeriod!\n ) {\n createApplicationAccessToken(\n applicationId: $applicationId,\n blockchainNetworkScope: $blockchainNetworkScope,\n blockchainNodeScope: $blockchainNodeScope,\n customDeploymentScope: $customDeploymentScope,\n insightsScope: $insightsScope,\n integrationScope: $integrationScope,\n loadBalancerScope: $loadBalancerScope,\n middlewareScope: $middlewareScope,\n name: $name,\n privateKeyScope: $privateKeyScope,\n smartContractSetScope: $smartContractSetScope,\n storageScope: $storageScope,\n validityPeriod: $validityPeriod\n ) {\n token\n }\n }\n `,\n [],\n);\n\nexport type CreateApplicationAccessTokenArgs = Omit<\n VariablesOf<typeof createApplicationAccessToken>,\n \"applicationId\"\n> & { applicationUniqueName: string };\n\n/**\n * Creates a new application.\n *\n * @param gqlClient - The GraphQL client instance used to execute the mutation.\n * @returns A function that accepts the arguments for creating an application and returns a promise resolving to the created application.\n */\nexport const applicationAccessTokenCreate = (gqlClient: GraphQLClient) => {\n return async (args: CreateApplicationAccessTokenArgs): Promise<string> => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(\n createApplicationAccessToken,\n {\n ...otherArgs,\n applicationId: application.id,\n },\n );\n if (!applicationAccessToken.token) {\n throw new Error(\"Failed to create application access token\");\n }\n return applicationAccessToken.token;\n };\n};\n","/**\n * Sets the default values for a cluster service.\n *\n * @param args - The arguments for creating a cluster service.\n * @returns The modified arguments with default values set.\n */\nexport function setClusterServiceDefaults<\n Args extends {\n size?: \"SMALL\" | \"MEDIUM\" | \"LARGE\" | \"CUSTOM\" | null | undefined;\n type?: \"SHARED\" | \"DEDICATED\" | null | undefined;\n },\n>(args: Args): Args {\n return {\n ...args,\n size: args.size ?? \"SMALL\",\n type: args.type ?? \"SHARED\",\n };\n}\n","import type { CreateBlockchainNetworkArgs } from \"../graphql/blockchain-network.js\";\nimport { setClusterServiceDefaults } from \"./cluster-service-defaults.js\";\n\n/**\n * Sets the default values for a blockchain network.\n *\n * @param args - The arguments for creating a blockchain network.\n * @returns The modified arguments with default values set.\n */\nexport function setNetworkDefaults(\n args: Omit<CreateBlockchainNetworkArgs, \"applicationUniqueName\">,\n): Omit<CreateBlockchainNetworkArgs, \"applicationUniqueName\"> {\n const clusterServiceArgs = setClusterServiceDefaults(args);\n if (args.consensusAlgorithm === \"BESU_QBFT\") {\n return {\n ...clusterServiceArgs,\n chainId: args.chainId ?? 46040,\n contractSizeLimit: args.contractSizeLimit ?? 2147483647,\n evmStackSize: args.evmStackSize ?? 2048,\n gasLimit: args.gasLimit ?? \"9007199254740991\",\n gasPrice: args.gasPrice ?? 0,\n secondsPerBlock: args.secondsPerBlock ?? 2,\n };\n }\n return clusterServiceArgs;\n}\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { setNetworkDefaults } from \"../defaults/blockchain-network-defaults.js\";\n\n/**\n * Fragment containing core blockchain network fields.\n */\nconst BlockchainNetworkFragment = graphql(`\n fragment BlockchainNetwork on BlockchainNetwork {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n ... on BesuQBFTBlockchainNetwork {\n chainId\n }\n ... on BesuIbftv2BlockchainNetwork {\n chainId\n }\n ... on PolygonEdgePoABlockchainNetwork {\n chainId\n }\n ... on QuorumQBFTBlockchainNetwork {\n chainId\n }\n ... on GethCliqueBlockchainNetwork {\n chainId\n }\n ... on PublicEvmBlockchainNetwork {\n chainId\n }\n blockchainNodes {\n ... on BlockchainNode {\n id\n name\n uniqueName\n endpoints {\n id\n label\n displayValue\n }\n }\n }\n }\n`);\n\n/**\n * Type representing a blockchain network entity.\n */\nexport type BlockchainNetwork = ResultOf<typeof BlockchainNetworkFragment>;\n\n/**\n * Query to fetch blockchain networks for an application.\n */\nconst getBlockchainNetworks = graphql(\n `\n query getBlockchainNetworks($applicationUniqueName: String!) {\n blockchainNetworksByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...BlockchainNetwork\n }\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Query to fetch a specific blockchain network.\n */\nconst getBlockchainNetwork = graphql(\n `\n query getBlockchainNetwork($uniqueName: String!) {\n blockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to create a new blockchain network.\n */\nconst createBlockchainNetwork = graphql(\n `\n mutation createBlockchainNetwork(\n $applicationId: ID!\n $chainId: Int\n $consensusAlgorithm: ConsensusAlgorithm!\n $contractSizeLimit: Int\n $evmStackSize: Int\n $gasLimit: String\n $gasPrice: Int\n $name: String!\n $nodeName: String!\n $secondsPerBlock: Int\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $batchTimeout: Float\n $maxMessageCount: Int\n $absoluteMaxBytes: Int\n $preferredMaxBytes: Int\n $endorsementPolicy: FabricEndorsementPolicy\n $maxCodeSize: Int\n $txnSizeLimit: Int\n $besuIbft2Genesis: BesuIbft2GenesisInput\n $besuQbftGenesis: BesuQbftGenesisInput\n $quorumGenesis: QuorumGenesisInput\n $externalNodes: [BlockchainNetworkExternalNodeInput!]\n $privateKeyId: ID\n ) {\n createBlockchainNetwork(\n applicationId: $applicationId\n chainId: $chainId\n consensusAlgorithm: $consensusAlgorithm\n contractSizeLimit: $contractSizeLimit\n evmStackSize: $evmStackSize\n gasLimit: $gasLimit\n gasPrice: $gasPrice\n name: $name\n nodeName: $nodeName\n secondsPerBlock: $secondsPerBlock\n provider: $provider\n region: $region\n size: $size\n type: $type\n batchTimeout: $batchTimeout\n maxMessageCount: $maxMessageCount\n absoluteMaxBytes: $absoluteMaxBytes\n preferredMaxBytes: $preferredMaxBytes\n endorsementPolicy: $endorsementPolicy\n maxCodeSize: $maxCodeSize\n txnSizeLimit: $txnSizeLimit\n besuIbft2Genesis: $besuIbft2Genesis\n besuQbftGenesis: $besuQbftGenesis\n quorumGenesis: $quorumGenesis\n externalNodes: $externalNodes\n keyMaterial: $privateKeyId\n ) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Arguments required to create a blockchain network.\n */\nexport type CreateBlockchainNetworkArgs = Omit<VariablesOf<typeof createBlockchainNetwork>, \"applicationId\"> & {\n applicationUniqueName: string;\n};\n\n/**\n * Mutation to delete a blockchain network.\n */\nconst deleteBlockchainNetwork = graphql(\n `\n mutation deleteBlockchainNetwork($uniqueName: String!) {\n deleteBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to restart a blockchain network.\n */\nconst restartBlockchainNetwork = graphql(\n `\n mutation RestartBlockchainNetwork($uniqueName: String!) {\n restartBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to pause a blockchain network.\n */\nconst pauseBlockchainNetwork = graphql(\n `\n mutation PauseBlockchainNetwork($uniqueName: String!) {\n pauseBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to resume a blockchain network.\n */\nconst resumeBlockchainNetwork = graphql(\n `\n mutation ResumeBlockchainNetwork($uniqueName: String!) {\n resumeBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Creates a function to list blockchain networks for a given application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches networks for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const blockchainNetworkList = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string) => {\n const {\n blockchainNetworksByUniqueName: { items },\n } = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single network by unique name\n * @throws If the network cannot be found or the request fails\n */\nexport const blockchainNetworkRead = (gqlClient: GraphQLClient) => {\n return async (blockchainNetworkUniqueName: string) => {\n const { blockchainNetworkByUniqueName } = await gqlClient.request(getBlockchainNetwork, {\n uniqueName: blockchainNetworkUniqueName,\n });\n return blockchainNetworkByUniqueName;\n };\n};\n\n/**\n * Creates a function to create a new blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new network with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const blockchainNetworkCreate = (\n gqlClient: GraphQLClient,\n): ((args: CreateBlockchainNetworkArgs) => Promise<BlockchainNetwork>) => {\n return async (args: CreateBlockchainNetworkArgs) => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const blockchainNetworkArgs = setNetworkDefaults(otherArgs);\n const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, {\n ...blockchainNetworkArgs,\n applicationId: application.id,\n });\n return blockchainNetwork;\n };\n};\n\n/**\n * Creates a function to delete a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that deletes a network by unique name\n * @throws If the network cannot be found or the deletion fails\n */\nexport const blockchainNetworkDelete = (gqlClient: GraphQLClient) => {\n return async (blockchainNetworkUniqueName: string) => {\n const { deleteBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(\n deleteBlockchainNetwork,\n {\n uniqueName: blockchainNetworkUniqueName,\n },\n );\n return blockchainNetwork;\n };\n};\n\n/**\n * Creates a function to restart a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a network by unique name\n * @throws If the network cannot be found or the restart fails\n */\nexport const blockchainNetworkRestart =\n (gqlClient: GraphQLClient) =>\n async (blockchainNetworkUniqueName: string): Promise<BlockchainNetwork> => {\n const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(\n restartBlockchainNetwork,\n { uniqueName: blockchainNetworkUniqueName },\n );\n return blockchainNetwork;\n };\n\n/**\n * Creates a function to pause a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses a network by unique name\n * @throws If the network cannot be found or the pause fails\n */\nexport const blockchainNetworkPause =\n (gqlClient: GraphQLClient) =>\n async (blockchainNetworkUniqueName: string): Promise<BlockchainNetwork> => {\n const { pauseBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(pauseBlockchainNetwork, {\n uniqueName: blockchainNetworkUniqueName,\n });\n return blockchainNetwork;\n };\n\n/**\n * Creates a function to resume a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes a network by unique name\n * @throws If the network cannot be found or the resume fails\n */\nexport const blockchainNetworkResume =\n (gqlClient: GraphQLClient) =>\n async (blockchainNetworkUniqueName: string): Promise<BlockchainNetwork> => {\n const { resumeBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(\n resumeBlockchainNetwork,\n { uniqueName: blockchainNetworkUniqueName },\n );\n return blockchainNetwork;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { blockchainNetworkRead } from \"./blockchain-network.js\";\n\n/**\n * Fragment containing core blockchain node fields.\n */\nconst BlockchainNodeFragment = graphql(`\n fragment BlockchainNode on BlockchainNode {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n isEvm\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n blockchainNetwork {\n ... on AbstractClusterService {\n id\n name\n uniqueName\n ... on BesuQBFTBlockchainNetwork {\n chainId\n }\n ... on BesuIbftv2BlockchainNetwork {\n chainId\n }\n ... on PolygonEdgePoABlockchainNetwork {\n chainId\n }\n ... on QuorumQBFTBlockchainNetwork {\n chainId\n }\n ... on GethCliqueBlockchainNetwork {\n chainId\n }\n ... on PublicEvmBlockchainNetwork {\n chainId\n }\n }\n }\n privateKeys {\n ... on PrivateKey {\n id\n name\n privateKeyType\n address\n }\n }\n }\n`);\n\n/**\n * Type representing a blockchain node entity.\n */\nexport type BlockchainNode = ResultOf<typeof BlockchainNodeFragment>;\n\n/**\n * Query to fetch blockchain nodes for an application.\n */\nconst getBlockchainNodes = graphql(\n `\n query getBlockchainNodes($applicationUniqueName: String!) {\n blockchainNodesByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...BlockchainNode\n }\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Query to fetch a specific blockchain node.\n */\nconst getBlockchainNode = graphql(\n `\n query getBlockchainNode($uniqueName: String!) {\n blockchainNodeByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Mutation to create a blockchain node.\n */\nconst createBlockchainNode = graphql(\n `\n mutation createBlockchainNode(\n $applicationId: ID!\n $blockchainNetworkId: ID!\n $name: String!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $nodeType: NodeType\n $keyMaterial: ID\n ) {\n createBlockchainNode(\n applicationId: $applicationId\n blockchainNetworkId: $blockchainNetworkId\n name: $name\n provider: $provider\n region: $region\n size: $size\n type: $type\n nodeType: $nodeType\n keyMaterial: $keyMaterial\n ) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Arguments required to create a blockchain node.\n */\nexport type CreateBlockchainNodeArgs = Omit<\n VariablesOf<typeof createBlockchainNode>,\n \"applicationId\" | \"blockchainNetworkId\"\n> & {\n applicationUniqueName: string;\n blockchainNetworkUniqueName: string;\n};\n\n/**\n * Mutation to restart a blockchain node.\n */\nconst restartBlockchainNode = graphql(\n `\n mutation RestartBlockchainNode($uniqueName: String!) {\n restartBlockchainNodeByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Mutation to pause a blockchain node.\n */\nconst pauseBlockchainNode = graphql(\n `\n mutation PauseBlockchainNode($uniqueName: String!) {\n pauseBlockchainNodeByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Mutation to resume a blockchain node.\n */\nconst resumeBlockchainNode = graphql(\n `\n mutation ResumeBlockchainNode($uniqueName: String!) {\n resumeBlockchainNodeByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Creates a function to list blockchain nodes for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches blockchain nodes for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const blockchainNodeList = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string): Promise<BlockchainNode[]> => {\n const {\n blockchainNodesByUniqueName: { items },\n } = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single blockchain node by unique name\n * @throws If the blockchain node cannot be found or the request fails\n */\nexport const blockchainNodeRead = (gqlClient: GraphQLClient) => {\n return async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n const { blockchainNodeByUniqueName } = await gqlClient.request(getBlockchainNode, {\n uniqueName: blockchainNodeUniqueName,\n });\n return blockchainNodeByUniqueName;\n };\n};\n\n/**\n * Creates a function to create a new blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new blockchain node with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const blockchainNodeCreate = (gqlClient: GraphQLClient) => {\n return async (args: CreateBlockchainNodeArgs): Promise<BlockchainNode> => {\n const { applicationUniqueName, blockchainNetworkUniqueName, ...otherArgs } = args;\n const [application, blockchainNetwork] = await Promise.all([\n applicationRead(gqlClient)(applicationUniqueName),\n blockchainNetworkRead(gqlClient)(blockchainNetworkUniqueName),\n ]);\n const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNetworkId: blockchainNetwork.id,\n });\n return blockchainNode;\n };\n};\n\n/**\n * Creates a function to restart a blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a blockchain node by unique name\n * @throws If the blockchain node cannot be found or the restart fails\n */\nexport const blockchainNodeRestart =\n (gqlClient: GraphQLClient) =>\n async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, {\n uniqueName: blockchainNodeUniqueName,\n });\n return blockchainNode;\n };\n\n/**\n * Creates a function to pause a blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses a blockchain node by unique name\n * @throws If the blockchain node cannot be found or the pause fails\n */\nexport const blockchainNodePause =\n (gqlClient: GraphQLClient) =>\n async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n const { pauseBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(pauseBlockchainNode, {\n uniqueName: blockchainNodeUniqueName,\n });\n return blockchainNode;\n };\n\n/**\n * Creates a function to resume a blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes a blockchain node by unique name\n * @throws If the blockchain node cannot be found or the resume fails\n */\nexport const blockchainNodeResume =\n (gqlClient: GraphQLClient) =>\n async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n const { resumeBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(resumeBlockchainNode, {\n uniqueName: blockchainNodeUniqueName,\n });\n return blockchainNode;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * Fragment containing core custom deployment fields.\n */\nconst CustomDeploymentFragment = graphql(`\n fragment CustomDeployment on CustomDeployment {\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing a custom deployment entity.\n */\nexport type CustomDeployment = ResultOf<typeof CustomDeploymentFragment>;\n\n/**\n * Query to fetch custom deployments for an application.\n */\nconst getCustomDeployments = graphql(\n `\n query getCustomDeployments($applicationUniqueName: String!) {\n customDeploymentsByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...CustomDeployment\n }\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Query to fetch a specific custom deployment.\n */\nconst getCustomDeployment = graphql(\n `\n query getCustomDeployment($uniqueName: String!) {\n customDeploymentByUniqueName(uniqueName: $uniqueName) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to edit a custom deployment.\n */\nconst editCustomDeployment = graphql(\n `\n mutation EditCustomDeployment($uniqueName: String!, $imageTag: String) {\n editCustomDeploymentByUniqueName(uniqueName: $uniqueName, imageTag: $imageTag) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to create a custom deployment.\n */\nconst createCustomDeployment = graphql(\n `\n mutation CreateCustomDeployment(\n $applicationId: ID!\n $name: String!\n $imageTag: String!\n $imageName: String!\n $imageRepository: String!\n $environmentVariables: JSON\n $port: Int!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n ) {\n createCustomDeployment(\n applicationId: $applicationId\n name: $name\n imageTag: $imageTag\n imageName: $imageName\n imageRepository: $imageRepository\n port: $port\n environmentVariables: $environmentVariables\n provider: $provider\n region: $region\n size: $size\n type: $type\n ) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Arguments required to create a custom deployment.\n */\nexport type CreateCustomDeploymentArgs = Omit<VariablesOf<typeof createCustomDeployment>, \"applicationId\"> & {\n applicationUniqueName: string;\n};\n\n/**\n * Mutation to restart a custom deployment.\n */\nconst restartCustomDeployment = graphql(\n `\n mutation RestartCustomDeployment($uniqueName: String!) {\n restartCustomDeploymentByUniqueName(uniqueName: $uniqueName) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to pause a custom deployment.\n */\nconst pauseCustomDeployment = graphql(\n `\n mutation PauseCustomDeployment($uniqueName: String!) {\n pauseCustomDeploymentByUniqueName(uniqueName: $uniqueName) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to resume a custom deployment.\n */\nconst resumeCustomDeployment = graphql(\n `\n mutation ResumeCustomDeployment($uniqueName: String!) {\n resumeCustomDeploymentByUniqueName(uniqueName: $uniqueName) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Creates a function to list custom deployments for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches custom deployments for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const customdeploymentList = (\n gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<CustomDeployment[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n customDeploymentsByUniqueName: { items },\n } = await gqlClient.request(getCustomDeployments, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single custom deployment by unique name\n * @throws If the custom deployment cannot be found or the request fails\n */\nexport const customdeploymentRead = (\n gqlClient: GraphQLClient,\n): ((customDeploymentUniqueName: string) => Promise<CustomDeployment>) => {\n return async (customDeploymentUniqueName: string) => {\n const { customDeploymentByUniqueName: customDeployment } = await gqlClient.request(getCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n });\n return customDeployment;\n };\n};\n\n/**\n * Creates a function to update a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that updates a custom deployment with a new image tag\n * @throws If the custom deployment cannot be found or the update fails\n */\nexport const customdeploymentUpdate = (\n gqlClient: GraphQLClient,\n): ((customDeploymentUniqueName: string, imageTag: string) => Promise<CustomDeployment>) => {\n return async (customDeploymentUniqueName: string, imageTag: string) => {\n const { editCustomDeploymentByUniqueName: cd } = await gqlClient.request(editCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n imageTag,\n });\n return cd;\n };\n};\n\n/**\n * Creates a function to create a new custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new custom deployment with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const customdeploymentCreate = (\n gqlClient: GraphQLClient,\n): ((args: CreateCustomDeploymentArgs) => Promise<CustomDeployment>) => {\n return async (args: CreateCustomDeploymentArgs) => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, {\n ...otherArgs,\n applicationId: application.id,\n });\n return customDeployment;\n };\n};\n\n/**\n * Creates a function to restart a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a custom deployment by unique name\n * @throws If the custom deployment cannot be found or the restart fails\n */\nexport const customDeploymentRestart =\n (gqlClient: GraphQLClient) =>\n async (customDeploymentUniqueName: string): Promise<CustomDeployment> => {\n const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n });\n return customDeployment;\n };\n\n/**\n * Creates a function to pause a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses a custom deployment by unique name\n * @throws If the custom deployment cannot be found or the pause fails\n */\nexport const customDeploymentPause =\n (gqlClient: GraphQLClient) =>\n async (customDeploymentUniqueName: string): Promise<CustomDeployment> => {\n const { pauseCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(pauseCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n });\n return customDeployment;\n };\n\n/**\n * Creates a function to resume a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes a custom deployment by unique name\n * @throws If the custom deployment cannot be found or the resume fails\n */\nexport const customDeploymentResume =\n (gqlClient: GraphQLClient) =>\n async (customDeploymentUniqueName: string): Promise<CustomDeployment> => {\n const { resumeCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(resumeCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n });\n return customDeployment;\n };\n","import { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * Query to fetch Foundry environment configuration for a blockchain node.\n */\nconst getFoundryEnvConfig = graphql(\n `\n query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {\n foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)\n }\n `,\n);\n\n/**\n * Variables for the Foundry environment config query.\n */\nexport type GetFoundryEnvConfigVariables = VariablesOf<typeof getFoundryEnvConfig>;\n\n/**\n * Result type for the Foundry environment config query.\n */\nexport type GetFoundryEnvConfigResult = ResultOf<typeof getFoundryEnvConfig>;\n\n/**\n * Creates a function to fetch Foundry environment configuration.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches Foundry environment configuration for a blockchain node\n * @throws If the blockchain node cannot be found or the request fails\n */\nexport const getEnv = (gqlClient: GraphQLClient) => {\n return async (blockchainNodeUniqueName: string): Promise<Record<string, string>> => {\n const { foundryEnvConfigByUniqueName } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeUniqueName });\n return foundryEnvConfigByUniqueName as Record<string, string>;\n };\n};\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { blockchainNetworkRead } from \"@/graphql/blockchain-network.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { blockchainNodeRead } from \"./blockchain-node.js\";\n\n/**\n * GraphQL fragment containing core load balancer fields.\n */\nconst LoadBalancerFragment = graphql(`\n fragment LoadBalancer on LoadBalancer {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n endpoints {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing a load balancer entity.\n */\nexport type LoadBalancer = ResultOf<typeof LoadBalancerFragment>;\n\n/**\n * Query to fetch a specific load balancer.\n */\nconst getLoadBalancer = graphql(\n `\n query GetLoadBalancer($uniqueName: String!) {\n loadBalancerByUniqueName(uniqueName: $uniqueName) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Query to fetch all load balancers for an application.\n */\nconst getLoadBalancers = graphql(\n `\n query getLoadBalancers($applicationUniqueName: String!) {\n loadBalancersByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...LoadBalancer\n }\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Mutation to create a load balancer.\n */\nconst createLoadBalancer = graphql(\n `\n mutation createLoadBalancer(\n $applicationId: ID!\n $blockchainNetworkId: ID!\n $name: String!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $connectedNodes: [ID!]!\n ) {\n createLoadBalancer(\n applicationId: $applicationId\n blockchainNetworkId: $blockchainNetworkId\n name: $name\n provider: $provider\n region: $region\n size: $size\n type: $type\n connectedNodes: $connectedNodes\n ) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Arguments required to create a load balancer.\n */\nexport type CreateLoadBalancerArgs = Omit<\n VariablesOf<typeof createLoadBalancer>,\n \"applicationId\" | \"blockchainNetworkId\" | \"connectedNodes\"\n> & {\n applicationUniqueName: string;\n blockchainNetworkUniqueName: string;\n connectedNodesUniqueNames: string[];\n};\n\n/**\n * Mutation to restart a load balancer.\n */\nconst restartLoadBalancer = graphql(\n `\n mutation RestartLoadBalancer($uniqueName: String!) {\n restartLoadBalancerByUniqueName(uniqueName: $uniqueName) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Mutation to pause a load balancer.\n */\nconst pauseLoadBalancer = graphql(\n `\n mutation PauseLoadBalancer($uniqueName: String!) {\n pauseLoadBalancerByUniqueName(uniqueName: $uniqueName) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Mutation to resume a load balancer.\n */\nconst resumeLoadBalancer = graphql(\n `\n mutation ResumeLoadBalancer($uniqueName: String!) {\n resumeLoadBalancerByUniqueName(uniqueName: $uniqueName) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Creates a function to fetch a specific load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single load balancer by unique name\n * @throws If the load balancer cannot be found or the request fails\n */\nexport const loadBalancerRead = (\n gqlClient: GraphQLClient,\n): ((loadBalancerUniqueName: string) => Promise<LoadBalancer>) => {\n return async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {\n uniqueName: loadBalancerUniqueName,\n });\n return loadBalancer as LoadBalancer;\n };\n};\n\n/**\n * Creates a function to list load balancers for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches load balancers for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const loadBalancerList = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string): Promise<LoadBalancer[]> => {\n const {\n loadBalancersByUniqueName: { items },\n } = await gqlClient.request(getLoadBalancers, { applicationUniqueName });\n return items as LoadBalancer[];\n };\n};\n\n/**\n * Creates a function to create a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a load balancer\n * @throws If the load balancer cannot be created or the request fails\n */\nexport const loadBalancerCreate = (gqlClient: GraphQLClient) => {\n return async (args: CreateLoadBalancerArgs): Promise<LoadBalancer> => {\n const { applicationUniqueName, blockchainNetworkUniqueName, connectedNodesUniqueNames, ...otherArgs } = args;\n const [application, blockchainNetwork, connectedNodes] = await Promise.all([\n applicationRead(gqlClient)(applicationUniqueName),\n blockchainNetworkRead(gqlClient)(blockchainNetworkUniqueName),\n Promise.all(connectedNodesUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName))),\n ]);\n const { createLoadBalancer: loadBalancer } = await gqlClient.request(createLoadBalancer, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNetworkId: blockchainNetwork.id,\n connectedNodes: connectedNodes.map((node) => node.id),\n });\n return loadBalancer as LoadBalancer;\n };\n};\n\n/**\n * Creates a function to restart a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a load balancer\n * @throws If the load balancer cannot be restarted or the request fails\n */\nexport const loadBalancerRestart =\n (gqlClient: GraphQLClient) =>\n async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n const { restartLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(restartLoadBalancer, {\n uniqueName: loadBalancerUniqueName,\n });\n return loadBalancer as LoadBalancer;\n };\n\n/**\n * Creates a function to pause a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses a load balancer\n * @throws If the load balancer cannot be paused or the request fails\n */\nexport const loadBalancerPause =\n (gqlClient: GraphQLClient) =>\n async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n const { pauseLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(pauseLoadBalancer, {\n uniqueName: loadBalancerUniqueName,\n });\n return loadBalancer as LoadBalancer;\n };\n\n/**\n * Creates a function to resume a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes a load balancer\n * @throws If the load balancer cannot be resumed or the request fails\n */\nexport const loadBalancerResume =\n (gqlClient: GraphQLClient) =>\n async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n const { resumeLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(resumeLoadBalancer, {\n uniqueName: loadBalancerUniqueName,\n });\n return loadBalancer as LoadBalancer;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { blockchainNodeRead } from \"@/graphql/blockchain-node.js\";\nimport { loadBalancerRead } from \"@/graphql/load-balancer.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * GraphQL fragment containing core insights fields.\n */\nconst InsightsFragment = graphql(`\n fragment Insights on Insights {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n insightsCategory\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing an insights entity.\n */\nexport type Insights = ResultOf<typeof InsightsFragment>;\n\n/**\n * Query to fetch insights for an application.\n */\nconst getInsights = graphql(\n `\n query GetInsights($applicationUniqueName: String!) {\n insightsListByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...Insights\n }\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Query to fetch a specific insight.\n */\nconst getInsight = graphql(\n `\n query GetInsight($uniqueName: String!) {\n insightsByUniqueName(uniqueName: $uniqueName) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Mutation to create insights.\n */\nconst createInsights = graphql(\n `\n mutation CreateInsights(\n $applicationId: ID!\n $name: String!\n $insightsCategory: InsightsCategory!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $blockchainNode: ID\n $loadBalancer: ID\n ) {\n createInsights(\n applicationId: $applicationId\n name: $name\n insightsCategory: $insightsCategory\n provider: $provider\n region: $region\n size: $size\n type: $type\n blockchainNode: $blockchainNode\n loadBalancer: $loadBalancer\n ) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Arguments required to create insights.\n */\nexport type CreateInsightsArgs = Omit<\n VariablesOf<typeof createInsights>,\n \"applicationId\" | \"blockchainNode\" | \"loadBalancer\"\n> & {\n applicationUniqueName: string;\n blockchainNodeUniqueName?: string;\n loadBalancerUniqueName?: string;\n};\n\n/**\n * Mutation to restart insights.\n */\nconst restartInsights = graphql(\n `\n mutation RestartInsights($uniqueName: String!) {\n restartInsightsByUniqueName(uniqueName: $uniqueName) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Mutation to pause insights.\n */\nconst pauseInsights = graphql(\n `\n mutation PauseInsights($uniqueName: String!) {\n pauseInsightsByUniqueName(uniqueName: $uniqueName) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Mutation to resume insights.\n */\nconst resumeInsights = graphql(\n `\n mutation ResumeInsights($uniqueName: String!) {\n resumeInsightsByUniqueName(uniqueName: $uniqueName) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Creates a function to list insights for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches insights for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const insightsList = (gqlClient: GraphQLClient): ((applicationUniqueName: string) => Promise<Insights[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n insightsListByUniqueName: { items },\n } = await gqlClient.request(getInsights, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific insight.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single insight by unique name\n * @throws If the insight cannot be found or the request fails\n */\nexport const insightsRead = (gqlClient: GraphQLClient): ((insightsUniqueName: string) => Promise<Insights>) => {\n return async (insightsUniqueName: string) => {\n const { insightsByUniqueName: insights } = await gqlClient.request(getInsight, { uniqueName: insightsUniqueName });\n return insights;\n };\n};\n\n/**\n * Creates a function to create new insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new insights with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const insightsCreate = (gqlClient: GraphQLClient): ((args: CreateInsightsArgs) => Promise<Insights>) => {\n return async (args: CreateInsightsArgs) => {\n const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, ...otherArgs } = args;\n const [application, blockchainNode, loadBalancer] = await Promise.all([\n applicationRead(gqlClient)(applicationUniqueName),\n blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(undefined),\n loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(undefined),\n ]);\n const { createInsights: insights } = await gqlClient.request(createInsights, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNode: blockchainNode?.id,\n loadBalancer: loadBalancer?.id,\n });\n return insights;\n };\n};\n\n/**\n * Creates a function to restart insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts insights by unique name\n * @throws If the insights cannot be found or the restart fails\n */\nexport const insightsRestart =\n (gqlClient: GraphQLClient) =>\n async (insightsUniqueName: string): Promise<Insights> => {\n const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, {\n uniqueName: insightsUniqueName,\n });\n return insights;\n };\n\n/**\n * Creates a function to pause insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses insights by unique name\n * @throws If the insights cannot be found or the pause fails\n */\nexport const insightsPause =\n (gqlClient: GraphQLClient) =>\n async (insightsUniqueName: string): Promise<Insights> => {\n const { pauseInsightsByUniqueName: insights } = await gqlClient.request(pauseInsights, {\n uniqueName: insightsUniqueName,\n });\n return insights;\n };\n\n/**\n * Creates a function to resume insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes insights by unique name\n * @throws If the insights cannot be found or the resume fails\n */\nexport const insightsResume =\n (gqlClient: GraphQLClient) =>\n async (insightsUniqueName: string): Promise<Insights> => {\n const { resumeInsightsByUniqueName: insights } = await gqlClient.request(resumeInsights, {\n uniqueName: insightsUniqueName,\n });\n return insights;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * GraphQL fragment containing core integration fields.\n */\nconst IntegrationFragment = graphql(`\n fragment Integration on Integration {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n integrationType\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing an integration tool entity.\n */\nexport type IntegrationTool = ResultOf<typeof IntegrationFragment>;\n\n/**\n * Query to fetch integrations for an application.\n */\nconst getIntegrations = graphql(\n `\n query GetIntegrations($applicationUniqueName: String!) {\n integrationsByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...Integration\n }\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Query to fetch a specific integration.\n */\nconst getIntegration = graphql(\n `\n query GetIntegration($uniqueName: String!) {\n integrationByUniqueName(uniqueName: $uniqueName) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Mutation to create a new integration.\n */\nconst createIntegration = graphql(\n `\n mutation CreateIntegration(\n $applicationId: ID!\n $name: String!\n $integrationType: IntegrationType!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n ) {\n createIntegration(\n applicationId: $applicationId\n name: $name\n integrationType: $integrationType\n provider: $provider\n region: $region\n size: $size\n type: $type\n ) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Arguments required to create an integration tool.\n */\nexport type CreateIntegrationToolArgs = Omit<VariablesOf<typeof createIntegration>, \"applicationId\"> & {\n applicationUniqueName: string;\n};\n\n/**\n * Mutation to restart an integration.\n */\nconst restartIntegrationTool = graphql(\n `\n mutation RestartIntegrationTool($uniqueName: String!) {\n restartIntegrationByUniqueName(uniqueName: $uniqueName) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Mutation to pause an integration.\n */\nconst pauseIntegrationTool = graphql(\n `\n mutation PauseIntegrationTool($uniqueName: String!) {\n pauseIntegrationByUniqueName(uniqueName: $uniqueName) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Mutation to resume an integration.\n */\nconst resumeIntegrationTool = graphql(\n `\n mutation ResumeIntegrationTool($uniqueName: String!) {\n resumeIntegrationByUniqueName(uniqueName: $uniqueName) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Creates a function to list integration tools for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches integration tools for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const integrationToolList = (\n gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<IntegrationTool[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n integrationsByUniqueName: { items },\n } = await gqlClient.request(getIntegrations, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single integration tool by unique name\n * @throws If the integration tool cannot be found or the request fails\n */\nexport const integrationToolRead = (\n gqlClient: GraphQLClient,\n): ((integrationUniqueName: string) => Promise<IntegrationTool>) => {\n return async (integrationUniqueName: string) => {\n const { integrationByUniqueName } = await gqlClient.request(getIntegration, { uniqueName: integrationUniqueName });\n return integrationByUniqueName;\n };\n};\n\n/**\n * Creates a function to create a new integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new integration tool with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const integrationToolCreate = (\n gqlClient: GraphQLClient,\n): ((args: CreateIntegrationToolArgs) => Promise<IntegrationTool>) => {\n return async (args: CreateIntegrationToolArgs) => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const { createIntegration: integration } = await gqlClient.request(createIntegration, {\n ...otherArgs,\n applicationId: application.id,\n });\n return integration;\n };\n};\n\n/**\n * Creates a function to restart an integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts integration tool by unique name\n * @throws If the integration tool cannot be found or the restart fails\n */\nexport const integrationToolRestart =\n (gqlClient: GraphQLClient) =>\n async (integrationUniqueName: string): Promise<IntegrationTool> => {\n const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, {\n uniqueName: integrationUniqueName,\n });\n return integration;\n };\n\n/**\n * Creates a function to pause an integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses integration tool by unique name\n * @throws If the integration tool cannot be found or the pause fails\n */\nexport const integrationToolPause =\n (gqlClient: GraphQLClient) =>\n async (integrationUniqueName: string): Promise<IntegrationTool> => {\n const { pauseIntegrationByUniqueName: integration } = await gqlClient.request(pauseIntegrationTool, {\n uniqueName: integrationUniqueName,\n });\n return integration;\n };\n\n/**\n * Creates a function to resume an integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes integration tool by unique name\n * @throws If the integration tool cannot be found or the resume fails\n */\nexport const integrationToolResume =\n (gqlClient: GraphQLClient) =>\n async (integrationUniqueName: string): Promise<IntegrationTool> => {\n const { resumeIntegrationByUniqueName: integration } = await gqlClient.request(resumeIntegrationTool, {\n uniqueName: integrationUniqueName,\n });\n return integration;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * GraphQL fragment containing core storage fields.\n */\nconst StorageFragment = graphql(`\n fragment Storage on Storage {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n storageProtocol\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing a storage entity.\n */\nexport type Storage = ResultOf<typeof StorageFragment>;\n\n/**\n * Query to fetch storages for an application.\n */\nconst getStorages = graphql(\n `\n query GetStorages($applicationUniqueName: String!) {\n storagesByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...Storage\n }\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Query to fetch a specific storage.\n */\nconst getStorage = graphql(\n `\n query GetStorage($uniqueName: String!) {\n storageByUniqueName(uniqueName: $uniqueName) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Mutation to create a new storage.\n */\nconst createStorage = graphql(\n `\n mutation CreateStorage(\n $applicationId: ID!\n $name: String!\n $storageProtocol: StorageProtocol!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n ) {\n createStorage(\n applicationId: $applicationId\n name: $name\n storageProtocol: $storageProtocol\n provider: $provider\n region: $region\n size: $size\n type: $type\n ) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Arguments required to create a storage.\n */\nexport type CreateStorageArgs = Omit<VariablesOf<typeof createStorage>, \"applicationId\"> & {\n applicationUniqueName: string;\n};\n\n/**\n * Mutation to restart a storage.\n */\nconst restartStorage = graphql(\n `\n mutation RestartStorage($uniqueName: String!) {\n restartStorageByUniqueName(uniqueName: $uniqueName) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Mutation to pause a storage.\n */\nconst pauseStorage = graphql(\n `\n mutation PauseStorage($uniqueName: String!) {\n pauseStorageByUniqueName(uniqueName: $uniqueName) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Mutation to resume a storage.\n */\nconst resumeStorage = graphql(\n `\n mutation ResumeStorage($uniqueName: String!) {\n resumeStorageByUniqueName(uniqueName: $uniqueName) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Creates a function to list storages for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches storages for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const storageList = (gqlClient: GraphQLClient): ((applicationUniqueName: string) => Promise<Storage[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n storagesByUniqueName: { items },\n } = await gqlClient.request(getStorages, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single storage by unique name\n * @throws If the storage cannot be found or the request fails\n */\nexport const storageRead = (gqlClient: GraphQLClient): ((storageUniqueName: string) => Promise<Storage>) => {\n return async (storageUniqueName: string) => {\n const { storageByUniqueName: storage } = await gqlClient.request(getStorage, { uniqueName: storageUniqueName });\n return storage;\n };\n};\n\n/**\n * Creates a function to create a new storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new storage with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const storageCreate = (gqlClient: GraphQLClient): ((args: CreateStorageArgs) => Promise<Storage>) => {\n return async (args: CreateStorageArgs) => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const { createStorage: storage } = await gqlClient.request(createStorage, {\n ...otherArgs,\n applicationId: application.id,\n });\n return storage;\n };\n};\n\n/**\n * Creates a function to restart a storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts storage by unique name\n * @throws If the storage cannot be found or the restart fails\n */\nexport const storageRestart =\n (gqlClient: GraphQLClient) =>\n async (storageUniqueName: string): Promise<Storage> => {\n const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, {\n uniqueName: storageUniqueName,\n });\n return storage;\n };\n\n/**\n * Creates a function to pause a storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses storage by unique name\n * @throws If the storage cannot be found or the pause fails\n */\nexport const storagePause =\n (gqlClient: GraphQLClient) =>\n async (storageUniqueName: string): Promise<Storage> => {\n const { pauseStorageByUniqueName: storage } = await gqlClient.request(pauseStorage, {\n uniqueName: storageUniqueName,\n });\n return storage;\n };\n\n/**\n * Creates a function to resume a storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes storage by unique name\n * @throws If the storage cannot be found or the resume fails\n */\nexport const storageResume =\n (gqlClient: GraphQLClient) =>\n async (storageUniqueName: string): Promise<Storage> => {\n const { resumeStorageByUniqueName: storage } = await gqlClient.request(resumeStorage, {\n uniqueName: storageUniqueName,\n });\n return storage;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { blockchainNodeRead } from \"./blockchain-node.js\";\nimport { loadBalancerRead } from \"./load-balancer.js\";\nimport { storageRead } from \"./storage.js\";\n\n/**\n * GraphQL fragment containing core middleware fields.\n */\nconst MiddlewareFragment = graphql(`\n fragment Middleware on Middleware {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n interface\n entityVersion\n serviceUrl\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n ... on HAGraphMiddleware {\n specVersion\n }\n ... on HAGraphPostgresMiddleware {\n specVersion\n }\n }\n`);\n\nconst SubgraphFragment = graphql(`\n fragment Subgraph on Subgraph {\n name\n graphqlQueryEndpoint {\n displayValue\n id\n }\n }\n`);\n\n/**\n * Type representing a middleware entity.\n */\nexport type Middleware = ResultOf<typeof MiddlewareFragment>;\n\n/**\n * Query to fetch middlewares for an application.\n */\nconst getMiddlewares = graphql(\n `\n query GetMiddlewares($applicationUniqueName: String!) {\n middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...Middleware\n }\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Query to fetch a specific middleware.\n */\nconst getMiddleware = graphql(\n `\n query GetMiddleware($uniqueName: String!) {\n middlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Query to fetch a specific middleware with subgraphs.\n */\nconst getGraphMiddlewareSubgraphs = graphql(\n `\n query GetMiddleware($uniqueName: String!, $noCache: Boolean) {\n middlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n ... on HAGraphMiddleware {\n subgraphs(noCache: $noCache) {\n ...Subgraph\n }\n }\n ... on HAGraphPostgresMiddleware {\n subgraphs(noCache: $noCache) {\n ...Subgraph\n }\n }\n }\n }\n `,\n [MiddlewareFragment, SubgraphFragment],\n);\n\n/**\n * Type representing a middleware entity with subgraphs.\n */\nexport type MiddlewareWithSubgraphs = ResultOf<typeof getGraphMiddlewareSubgraphs>[\"middlewareByUniqueName\"];\n\n/**\n * Mutation to create a new middleware.\n */\nconst createMiddleware = graphql(\n `\n mutation CreateMiddleware(\n $applicationId: ID!\n $name: String!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $interface: MiddlewareType!\n $storageId: ID\n $blockchainNodeId: ID\n $loadBalancerId: ID\n $abis: [SmartContractPortalMiddlewareAbiInputDto!]\n $includePredeployedAbis: [String!]\n ) {\n createMiddleware(\n applicationId: $applicationId\n name: $name\n provider: $provider\n region: $region\n size: $size\n type: $type\n interface: $interface\n storageId: $storageId\n blockchainNodeId: $blockchainNodeId\n loadBalancerId: $loadBalancerId\n abis: $abis\n includePredeployedAbis: $includePredeployedAbis\n ) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Arguments required to create a middleware.\n */\nexport type CreateMiddlewareArgs = Omit<\n VariablesOf<typeof createMiddleware>,\n \"applicationId\" | \"blockchainNodeId\" | \"loadBalancerId\" | \"storageId\"\n> & {\n applicationUniqueName: string;\n blockchainNodeUniqueName?: string;\n loadBalancerUniqueName?: string;\n storageUniqueName?: string;\n};\n\n/**\n * Mutation to restart a middleware.\n */\nconst restartMiddleware = graphql(\n `\n mutation RestartMiddleware($uniqueName: String!) {\n restartMiddlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Mutation to pause a middleware.\n */\nconst pauseMiddleware = graphql(\n `\n mutation PauseMiddleware($uniqueName: String!) {\n pauseMiddlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Mutation to resume a middleware.\n */\nconst resumeMiddleware = graphql(\n `\n mutation ResumeMiddleware($uniqueName: String!) {\n resumeMiddlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Creates a function to list middlewares for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches middlewares for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const middlewareList = (\n gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<Middleware[]>) => {\n return async (applicationUniqueName: string): Promise<Middleware[]> => {\n const {\n middlewaresByUniqueName: { items },\n } = await gqlClient.request(getMiddlewares, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single middleware by unique name\n * @throws If the middleware cannot be found or the request fails\n */\nexport const middlewareRead = (gqlClient: GraphQLClient): ((middlewareUniqueName: string) => Promise<Middleware>) => {\n return async (middlewareUniqueName: string): Promise<Middleware> => {\n const { middlewareByUniqueName: middleware } = await gqlClient.request(getMiddleware, {\n uniqueName: middlewareUniqueName,\n });\n return middleware;\n };\n};\n\n/**\n * Creates a function to fetch a specific middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single middleware by unique name\n * @throws If the middleware cannot be found or the request fails\n */\nexport const graphMiddlewareSubgraphs = (\n gqlClient: GraphQLClient,\n): ((middlewareUniqueName: string, noCache?: boolean) => Promise<MiddlewareWithSubgraphs>) => {\n return async (middlewareUniqueName: string, noCache = false): Promise<MiddlewareWithSubgraphs> => {\n const { middlewareByUniqueName: middleware } = await gqlClient.request(getGraphMiddlewareSubgraphs, {\n uniqueName: middlewareUniqueName,\n noCache,\n });\n return middleware;\n };\n};\n\n/**\n * Creates a function to create a new middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new middleware with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const middlewareCreate = (gqlClient: GraphQLClient): ((args: CreateMiddlewareArgs) => Promise<Middleware>) => {\n return async (args: CreateMiddlewareArgs): Promise<Middleware> => {\n const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } =\n args;\n const [application, blockchainNode, loadBalancer, storage] = await Promise.all([\n applicationRead(gqlClient)(applicationUniqueName),\n blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(undefined),\n loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(undefined),\n storageUniqueName ? storageRead(gqlClient)(storageUniqueName) : Promise.resolve(undefined),\n ]);\n const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNodeId: blockchainNode?.id,\n loadBalancerId: loadBalancer?.id,\n storageId: storage?.id,\n });\n return middleware;\n };\n};\n\n/**\n * Creates a function to restart a middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts middleware by unique name\n * @throws If the middleware cannot be found or the restart fails\n */\nexport const middlewareRestart =\n (gqlClient: GraphQLClient) =>\n async (middlewareUniqueName: string): Promise<Middleware> => {\n const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, {\n uniqueName: middlewareUniqueName,\n });\n return middleware;\n };\n\n/**\n * Creates a function to pause a middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses middleware by unique name\n * @throws If the middleware cannot be found or the pause fails\n */\nexport const middlewarePause =\n (gqlClient: GraphQLClient) =>\n async (middlewareUniqueName: string): Promise<Middleware> => {\n const { pauseMiddlewareByUniqueName: middleware } = await gqlClient.request(pauseMiddleware, {\n uniqueName: middlewareUniqueName,\n });\n return middleware;\n };\n\n/**\n * Creates a function to resume a middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes middleware by unique name\n * @throws If the middleware cannot be found or the resume fails\n */\nexport const middlewareResume =\n (gqlClient: GraphQLClient) =>\n async (middlewareUniqueName: string): Promise<Middleware> => {\n const { resumeMiddlewareByUniqueName: middleware } = await gqlClient.request(resumeMiddleware, {\n uniqueName: middlewareUniqueName,\n });\n return middleware;\n };\n","import { type ResultOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * GraphQL query to fetch platform configuration.\n */\nconst getPlatformConfigQuery = graphql(\n `\n query platformConfig {\n config {\n smartContractSets {\n id\n sets {\n id\n name\n featureflagged\n image {\n repository\n tag\n registry\n }\n }\n }\n deploymentEngineTargets {\n id\n name\n disabled\n clusters {\n id\n name\n disabled\n }\n }\n preDeployedAbis {\n id\n featureflagged\n abis\n label\n }\n sdkVersion\n kits {\n id\n name\n description\n npmPackageName\n }\n }\n }\n `,\n [],\n);\n\n/**\n * Type representing the platform configuration.\n */\nexport type PlatformConfig = ResultOf<typeof getPlatformConfigQuery>[\"config\"];\n\n/**\n * Creates a function to fetch the platform configuration.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches the platform configuration\n * @throws If the request fails\n */\nexport const getPlatformConfig = (gqlClient: GraphQLClient) => {\n return async (): Promise<PlatformConfig> => {\n const { config } = await gqlClient.request(getPlatformConfigQuery);\n return config;\n };\n};\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { blockchainNodeRead } from \"./blockchain-node.js\";\nimport { getPlatformConfig } from \"./platform.js\";\n\n/**\n * GraphQL fragment containing core private key fields.\n */\nconst PrivateKeyFragment = graphql(`\n fragment PrivateKey on PrivateKey {\n __typename\n id\n uniqueName\n name\n privateKeyType\n status\n healthStatus\n provider\n region\n address\n trustedForwarderName\n trustedForwarderAddress\n relayerKey {\n ... on PrivateKey {\n id\n name\n uniqueName\n }\n }\n blockchainNodes {\n ... on BlockchainNode {\n id\n name\n uniqueName\n }\n }\n }\n`);\n\n/**\n * Type representing a private key entity.\n */\nexport type PrivateKey = ResultOf<typeof PrivateKeyFragment>;\n\n/**\n * Query to fetch private keys for an application.\n */\nconst getPrivateKeys = graphql(\n `\n query GetPrivateKeys($applicationUniqueName: String!) {\n privateKeysByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...PrivateKey\n }\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Query to fetch a specific private key.\n */\nconst getPrivateKey = graphql(\n `\n query GetPrivateKey($uniqueName: String!) {\n privateKeyByUniqueName(uniqueName: $uniqueName) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Mutation to create a new private key.\n */\nconst createPrivateKey = graphql(\n `\n mutation CreatePrivateKey(\n $applicationId: ID!\n $name: String!\n $privateKeyType: PrivateKeyType!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $blockchainNodes: [ID!]\n $trustedForwarderName: String\n $trustedForwarderAddress: String\n $relayerKey: ID\n ) {\n createPrivateKey(\n applicationId: $applicationId\n name: $name\n privateKeyType: $privateKeyType\n provider: $provider\n region: $region\n size: $size\n type: $type\n blockchainNodes: $blockchainNodes\n trustedForwarderName: $trustedForwarderName\n trustedForwarderAddress: $trustedForwarderAddress\n relayerKey: $relayerKey\n ) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Arguments required to create a private key.\n */\nexport type CreatePrivateKeyArgs = Omit<\n VariablesOf<typeof createPrivateKey>,\n \"applicationId\" | \"blockchainNodes\" | \"region\" | \"provider\" | \"size\" | \"type\" | \"relayerKey\"\n> & {\n applicationUniqueName: string;\n blockchainNodeUniqueNames?: string[];\n relayerKeyUniqueName?: string;\n};\n\n/**\n * Mutation to restart a private key.\n */\nconst restartPrivateKey = graphql(\n `\n mutation RestartPrivateKey($uniqueName: String!) {\n restartPrivateKeyByUniqueName(uniqueName: $uniqueName) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Mutation to pause a private key.\n */\nconst pausePrivateKey = graphql(\n `\n mutation PausePrivateKey($uniqueName: String!) {\n pausePrivateKeyByUniqueName(uniqueName: $uniqueName) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Mutation to resume a private key.\n */\nconst resumePrivateKey = graphql(\n `\n mutation ResumePrivateKey($uniqueName: String!) {\n resumePrivateKeyByUniqueName(uniqueName: $uniqueName) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Creates a function to list private keys for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches private keys for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const privateKeyList = (\n gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<PrivateKey[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n privateKeysByUniqueName: { items },\n } = await gqlClient.request(getPrivateKeys, { applicationUniqueName });\n return items as PrivateKey[];\n };\n};\n\n/**\n * Creates a function to fetch a specific private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single private key by unique name\n * @throws If the private key cannot be found or the request fails\n */\nexport const privatekeyRead = (gqlClient: GraphQLClient): ((privateKeyUniqueName: string) => Promise<PrivateKey>) => {\n return async (privateKeyUniqueName: string) => {\n const { privateKeyByUniqueName: privateKey } = await gqlClient.request(getPrivateKey, {\n uniqueName: privateKeyUniqueName,\n });\n return privateKey as PrivateKey;\n };\n};\n\n/**\n * Creates a function to create a new private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new private key with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const privateKeyCreate = (gqlClient: GraphQLClient): ((args: CreatePrivateKeyArgs) => Promise<PrivateKey>) => {\n return async (args: CreatePrivateKeyArgs) => {\n const { applicationUniqueName, blockchainNodeUniqueNames, relayerKeyUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const blockchainNodes = blockchainNodeUniqueNames\n ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName)))\n : [];\n const relayerKey = relayerKeyUniqueName ? await privatekeyRead(gqlClient)(relayerKeyUniqueName) : undefined;\n const platformConfig = await getPlatformConfig(gqlClient)();\n const defaultProvider = platformConfig.deploymentEngineTargets.find(\n (target) => !target.disabled && target.clusters.some((cluster) => !cluster.disabled),\n );\n const defaultRegion = defaultProvider?.clusters.find((cluster) => !cluster.disabled);\n const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNodes: blockchainNodes.map((node) => node?.id),\n relayerKey: relayerKey?.id,\n provider: defaultProvider?.id ?? \"gke\",\n region: defaultRegion?.id?.split(\"-\")[1] ?? \"europe\",\n size: \"SMALL\",\n type: \"SHARED\",\n });\n return privateKey;\n };\n};\n\n/**\n * Creates a function to restart a private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts private key by unique name\n * @throws If the private key cannot be found or the restart fails\n */\nexport const privateKeyRestart =\n (gqlClient: GraphQLClient) =>\n async (privateKeyUniqueName: string): Promise<PrivateKey> => {\n const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, {\n uniqueName: privateKeyUniqueName,\n });\n return privateKey as PrivateKey;\n };\n\n/**\n * Creates a function to pause a private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses private key by unique name\n * @throws If the private key cannot be found or the pause fails\n */\nexport const privateKeyPause =\n (gqlClient: GraphQLClient) =>\n async (privateKeyUniqueName: string): Promise<PrivateKey> => {\n const { pausePrivateKeyByUniqueName: privateKey } = await gqlClient.request(pausePrivateKey, {\n uniqueName: privateKeyUniqueName,\n });\n return privateKey as PrivateKey;\n };\n\n/**\n * Creates a function to resume a private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes private key by unique name\n * @throws If the private key cannot be found or the resume fails\n */\nexport const privateKeyResume =\n (gqlClient: GraphQLClient) =>\n async (privateKeyUniqueName: string): Promise<PrivateKey> => {\n const { resumePrivateKeyByUniqueName: privateKey } = await gqlClient.request(resumePrivateKey, {\n uniqueName: privateKeyUniqueName,\n });\n return privateKey as PrivateKey;\n };\n","import { AccessTokenSchema, UrlSchema } from \"@settlemint/sdk-utils/validation\";\nimport { z } from \"zod\";\n\n/**\n * Schema for validating SettleMint client options.\n */\nexport const ClientOptionsSchema = z.object({\n /** The access token used to authenticate with the SettleMint platform */\n accessToken: AccessTokenSchema,\n /** The URL of the SettleMint instance to connect to */\n instance: UrlSchema,\n});\n\n/**\n * Type definition for SettleMint client options, inferred from ClientOptionsSchema.\n */\nexport type ClientOptions = z.infer<typeof ClientOptionsSchema>;\n","import { createHash } from \"node:crypto\";\n\nfunction hashPincode(pincode: string, salt: string): string {\n return createHash(\"sha256\").update(`${salt}${pincode}`).digest(\"hex\");\n}\n\nfunction generateResponse(pincode: string, salt: string, challenge: string): string {\n const hashedPincode = hashPincode(pincode, salt);\n return createHash(\"sha256\").update(`${hashedPincode}_${challenge}`).digest(\"hex\");\n}\n\nexport interface PincodeVerificationChallengesArgs {\n userWalletAddress: string;\n accessToken: string;\n instance: string;\n nodeId: string;\n}\n\nexport interface PincodeVerificationChallengeResponseArgs {\n verificationChallenge: VerificationChallenge;\n pincode: string;\n}\n\nexport interface VerificationChallenge {\n name: string;\n challenge: {\n secret: string;\n salt: string;\n };\n}\n\n/**\n * Get the pincode verification challenges for a user wallet address.\n * @param userWalletAddress - The user's wallet address.\n * @param accessToken - The user's access token.\n * @param instance - The instance URL.\n * @param nodeId - The node ID.\n * @returns The pincode verification challenges.\n */\nexport async function getPincodeVerificationChallenges({\n userWalletAddress,\n accessToken,\n instance,\n nodeId,\n}: PincodeVerificationChallengesArgs) {\n const response = await fetch(\n `${instance}/cm/nodes/${encodeURIComponent(nodeId)}/user-wallets/${encodeURIComponent(userWalletAddress)}/verifications/challenges?type=PINCODE`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-auth-token\": accessToken,\n },\n },\n );\n\n if (!response.ok) {\n if (response.status === 404) {\n throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);\n }\n throw new Error(\"Failed to get verification challenge\");\n }\n\n const verificationChallenges: VerificationChallenge[] = await response.json();\n return verificationChallenges;\n}\n\n/**\n * Get the pincode verification challenge response for a user wallet address.\n * @param verificationChallenge - The verification challenge.\n * @param pincode - The user's pincode.\n * @returns The pincode verification challenge response.\n */\nexport function getPincodeVerificationChallengeResponse({\n verificationChallenge,\n pincode,\n}: PincodeVerificationChallengeResponseArgs) {\n if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt) {\n throw new Error(\"Could not authenticate pin code, invalid challenge format\");\n }\n\n const { secret, salt } = verificationChallenge.challenge;\n return generateResponse(pincode, salt, secret);\n}\n","import { fetchWithRetry } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { type Id, LOCAL_INSTANCE, STANDALONE_INSTANCE, validate } from \"@settlemint/sdk-utils/validation\";\nimport { GraphQLClient } from \"graphql-request\";\nimport { z } from \"zod\";\nimport {\n type Application,\n applicationCreate,\n applicationDelete,\n applicationList,\n applicationRead,\n type CreateApplicationArgs,\n} from \"./graphql/application.js\";\nimport {\n applicationAccessTokenCreate,\n type CreateApplicationAccessTokenArgs,\n} from \"./graphql/application-access-tokens.js\";\nimport {\n type BlockchainNetwork,\n blockchainNetworkCreate,\n blockchainNetworkDelete,\n blockchainNetworkList,\n blockchainNetworkPause,\n blockchainNetworkRead,\n blockchainNetworkRestart,\n blockchainNetworkResume,\n type CreateBlockchainNetworkArgs,\n} from \"./graphql/blockchain-network.js\";\nimport {\n type BlockchainNode,\n blockchainNodeCreate,\n blockchainNodeList,\n blockchainNodePause,\n blockchainNodeRead,\n blockchainNodeRestart,\n blockchainNodeResume,\n type CreateBlockchainNodeArgs,\n} from \"./graphql/blockchain-node.js\";\nimport {\n type CreateCustomDeploymentArgs,\n type CustomDeployment,\n customDeploymentPause,\n customDeploymentRestart,\n customDeploymentResume,\n customdeploymentCreate,\n customdeploymentList,\n customdeploymentRead,\n customdeploymentUpdate,\n} from \"./graphql/custom-deployment.js\";\nimport { getEnv } from \"./graphql/foundry.js\";\nimport {\n type CreateInsightsArgs,\n type Insights,\n insightsCreate,\n insightsList,\n insightsPause,\n insightsRead,\n insightsRestart,\n insightsResume,\n} from \"./graphql/insights.js\";\nimport {\n type CreateIntegrationToolArgs,\n type IntegrationTool,\n integrationToolCreate,\n integrationToolList,\n integrationToolPause,\n integrationToolRead,\n integrationToolRestart,\n integrationToolResume,\n} from \"./graphql/integration-tool.js\";\nimport {\n type CreateLoadBalancerArgs,\n type LoadBalancer,\n loadBalancerCreate,\n loadBalancerList,\n loadBalancerPause,\n loadBalancerRead,\n loadBalancerRestart,\n loadBalancerResume,\n} from \"./graphql/load-balancer.js\";\nimport {\n type CreateMiddlewareArgs,\n graphMiddlewareSubgraphs,\n type Middleware,\n type MiddlewareWithSubgraphs,\n middlewareCreate,\n middlewareList,\n middlewarePause,\n middlewareRead,\n middlewareRestart,\n middlewareResume,\n} from \"./graphql/middleware.js\";\nimport { getPlatformConfig, type PlatformConfig } from \"./graphql/platform.js\";\nimport {\n type CreatePrivateKeyArgs,\n type PrivateKey,\n privateKeyCreate,\n privateKeyList,\n privateKeyPause,\n privateKeyRestart,\n privateKeyResume,\n privatekeyRead,\n} from \"./graphql/private-key.js\";\nimport {\n type CreateStorageArgs,\n type Storage,\n storageCreate,\n storageList,\n storagePause,\n storageRead,\n storageRestart,\n storageResume,\n} from \"./graphql/storage.js\";\nimport {\n type CreateWorkspaceArgs,\n type Workspace,\n workspaceAddCredits,\n workspaceCreate,\n workspaceDelete,\n workspaceList,\n workspaceRead,\n} from \"./graphql/workspace.js\";\nimport { type ClientOptions, ClientOptionsSchema } from \"./helpers/client-options.schema.js\";\nimport {\n getPincodeVerificationChallengeResponse,\n getPincodeVerificationChallenges,\n type PincodeVerificationChallengeResponseArgs,\n type PincodeVerificationChallengesArgs,\n type VerificationChallenge,\n} from \"./pincode-verification.js\";\n\n/**\n * Options for the Settlemint client.\n */\nexport interface SettlemintClientOptions extends Omit<ClientOptions, \"accessToken\"> {\n /** The access token used to authenticate with the SettleMint platform */\n accessToken?: string;\n /** Whether to allow anonymous access (no access token required) */\n anonymous?: boolean;\n}\n\n/**\n * Client interface for interacting with the SettleMint platform.\n */\nexport interface SettlemintClient {\n workspace: {\n list: () => Promise<Workspace[]>;\n read: (workspaceUniqueName: string) => Promise<Workspace>;\n create: (args: CreateWorkspaceArgs) => Promise<Workspace>;\n delete: (workspaceUniqueName: string) => Promise<Workspace>;\n addCredits: (workspaceId: Id, amount: number) => Promise<boolean>;\n };\n application: {\n list: (workspaceUniqueName: string) => Promise<Application[]>;\n read: (applicationUniqueName: string) => Promise<Application>;\n create: (args: CreateApplicationArgs) => Promise<Application>;\n delete: (applicationId: Id) => Promise<Application>;\n };\n blockchainNetwork: {\n list: (applicationUniqueName: string) => Promise<BlockchainNetwork[]>;\n read: (blockchainNetworkUniqueName: string) => Promise<BlockchainNetwork>;\n create: (args: CreateBlockchainNetworkArgs) => Promise<BlockchainNetwork>;\n delete: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n restart: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n pause: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n resume: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n };\n blockchainNode: {\n list: (applicationUniqueName: string) => Promise<BlockchainNode[]>;\n read: (blockchainNodeUniqueName: string) => Promise<BlockchainNode>;\n create: (args: CreateBlockchainNodeArgs) => Promise<BlockchainNode>;\n restart: (nodeUniqueName: string) => Promise<BlockchainNode>;\n pause: (nodeUniqueName: string) => Promise<BlockchainNode>;\n resume: (nodeUniqueName: string) => Promise<BlockchainNode>;\n };\n loadBalancer: {\n list: (applicationUniqueName: string) => Promise<LoadBalancer[]>;\n read: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n create: (args: CreateLoadBalancerArgs) => Promise<LoadBalancer>;\n restart: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n pause: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n resume: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n };\n middleware: {\n list: (applicationUniqueName: string) => Promise<Middleware[]>;\n read: (middlewareUniqueName: string) => Promise<Middleware>;\n graphSubgraphs: (middlewareUniqueName: string, noCache?: boolean) => Promise<MiddlewareWithSubgraphs>;\n create: (args: CreateMiddlewareArgs) => Promise<Middleware>;\n restart: (middlewareUniqueName: string) => Promise<Middleware>;\n pause: (middlewareUniqueName: string) => Promise<Middleware>;\n resume: (middlewareUniqueName: string) => Promise<Middleware>;\n };\n integrationTool: {\n list: (applicationUniqueName: string) => Promise<IntegrationTool[]>;\n read: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n create: (args: CreateIntegrationToolArgs) => Promise<IntegrationTool>;\n restart: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n pause: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n resume: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n };\n storage: {\n list: (applicationUniqueName: string) => Promise<Storage[]>;\n read: (storageUniqueName: string) => Promise<Storage>;\n create: (args: CreateStorageArgs) => Promise<Storage>;\n restart: (storageUniqueName: string) => Promise<Storage>;\n pause: (storageUniqueName: string) => Promise<Storage>;\n resume: (storageUniqueName: string) => Promise<Storage>;\n };\n privateKey: {\n list: (applicationUniqueName: string) => Promise<PrivateKey[]>;\n read: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n create: (args: CreatePrivateKeyArgs) => Promise<PrivateKey>;\n restart: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n pause: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n resume: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n };\n insights: {\n list: (applicationUniqueName: string) => Promise<Insights[]>;\n read: (insightsUniqueName: string) => Promise<Insights>;\n create: (args: CreateInsightsArgs) => Promise<Insights>;\n restart: (insightsUniqueName: string) => Promise<Insights>;\n pause: (insightsUniqueName: string) => Promise<Insights>;\n resume: (insightsUniqueName: string) => Promise<Insights>;\n };\n customDeployment: {\n list: (applicationUniqueName: string) => Promise<CustomDeployment[]>;\n read: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n create: (args: CreateCustomDeploymentArgs) => Promise<CustomDeployment>;\n update: (customDeploymentUniqueName: string, imageTag: string) => Promise<CustomDeployment>;\n restart: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n pause: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n resume: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n };\n foundry: {\n env: (blockchainNodeUniqueName: string) => Promise<Record<string, string>>;\n };\n applicationAccessToken: {\n create: (args: CreateApplicationAccessTokenArgs) => Promise<string>;\n };\n platform: {\n config: () => Promise<PlatformConfig>;\n };\n wallet: {\n pincodeVerificationChallengeResponse: (args: PincodeVerificationChallengeResponseArgs) => string;\n pincodeVerificationChallenges: (\n args: Omit<PincodeVerificationChallengesArgs, \"instance\" | \"accessToken\">,\n ) => Promise<VerificationChallenge[]>;\n };\n}\n\n/**\n * Creates a SettleMint client with the provided options. The client provides methods to interact with\n * various SettleMint resources like workspaces, applications, blockchain networks, blockchain nodes, middleware,\n * integration tools, storage, private keys, insights and custom deployments.\n *\n * @param {ClientOptions} options - Configuration options for the client including access token and instance URL\n * @returns {SettlemintClient} A SettleMint client object with resource-specific methods\n * @throws {Error} If options are invalid or if called in browser environment\n * @throws {ValidationError} If provided options fail schema validation\n *\n * @example\n * import { createSettleMintClient } from '@settlemint/sdk-js';\n *\n * const client = createSettleMintClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * instance: process.env.SETTLEMINT_INSTANCE,\n * });\n *\n * // List workspaces\n * const workspaces = await client.workspace.list();\n *\n * // Read a specific workspace\n * const workspace = await client.workspace.read('workspace-unique-name');\n */\nexport function createSettleMintClient(options: SettlemintClientOptions): SettlemintClient {\n ensureServer();\n\n if (options.instance === STANDALONE_INSTANCE || options.instance === LOCAL_INSTANCE) {\n if (options.anonymous) {\n // Fallback to the public instance for anonymous access\n // Anonymous use does not interact with platform services, only used for bootstrapping new projects using SettleMint templates\n options.instance = \"https://console.settlemint.com\";\n } else {\n throw new Error(\"Standalone and local instances cannot connect to the SettleMint platform\");\n }\n }\n\n const validatedOptions = options.anonymous\n ? validate(\n z.object({\n ...ClientOptionsSchema.shape,\n accessToken: z.literal(\"\"),\n }),\n options,\n )\n : validate(ClientOptionsSchema, options);\n\n const baseUrl = new URL(validatedOptions.instance).toString().replace(/\\/$/, \"\");\n const gqlClient = new GraphQLClient(`${baseUrl}/api/graphql`, {\n headers: {\n \"x-auth-token\": validatedOptions.accessToken ?? \"\",\n },\n fetch: (async (input: RequestInfo | URL, init?: RequestInit) => {\n const response = await fetchWithRetry(input, init);\n // Parse and handle GraphQL errors from response\n const contentType = response.headers.get(\"content-type\");\n if (contentType?.includes(\"application/json\") || contentType?.includes(\"application/graphql-response+json\")) {\n const data: { errors: { message: string }[] } = await response.clone().json();\n if (data.errors?.length > 0) {\n const errorMessages = data.errors.map((e) => e.message).join(\", \");\n throw new Error(errorMessages);\n }\n }\n return response;\n }) as typeof fetch,\n });\n\n return {\n workspace: {\n list: workspaceList(gqlClient),\n read: workspaceRead(gqlClient),\n create: workspaceCreate(gqlClient),\n delete: workspaceDelete(gqlClient),\n addCredits: workspaceAddCredits(gqlClient),\n },\n application: {\n list: applicationList(gqlClient),\n read: applicationRead(gqlClient),\n create: applicationCreate(gqlClient),\n delete: applicationDelete(gqlClient),\n },\n blockchainNetwork: {\n list: blockchainNetworkList(gqlClient),\n read: blockchainNetworkRead(gqlClient),\n create: blockchainNetworkCreate(gqlClient),\n delete: blockchainNetworkDelete(gqlClient),\n restart: blockchainNetworkRestart(gqlClient),\n pause: blockchainNetworkPause(gqlClient),\n resume: blockchainNetworkResume(gqlClient),\n },\n blockchainNode: {\n list: blockchainNodeList(gqlClient),\n read: blockchainNodeRead(gqlClient),\n create: blockchainNodeCreate(gqlClient),\n restart: blockchainNodeRestart(gqlClient),\n pause: blockchainNodePause(gqlClient),\n resume: blockchainNodeResume(gqlClient),\n },\n loadBalancer: {\n list: loadBalancerList(gqlClient),\n read: loadBalancerRead(gqlClient),\n create: loadBalancerCreate(gqlClient),\n restart: loadBalancerRestart(gqlClient),\n pause: loadBalancerPause(gqlClient),\n resume: loadBalancerResume(gqlClient),\n },\n middleware: {\n list: middlewareList(gqlClient),\n read: middlewareRead(gqlClient),\n graphSubgraphs: graphMiddlewareSubgraphs(gqlClient),\n create: middlewareCreate(gqlClient),\n restart: middlewareRestart(gqlClient),\n pause: middlewarePause(gqlClient),\n resume: middlewareResume(gqlClient),\n },\n integrationTool: {\n list: integrationToolList(gqlClient),\n read: integrationToolRead(gqlClient),\n create: integrationToolCreate(gqlClient),\n restart: integrationToolRestart(gqlClient),\n pause: integrationToolPause(gqlClient),\n resume: integrationToolResume(gqlClient),\n },\n storage: {\n list: storageList(gqlClient),\n read: storageRead(gqlClient),\n create: storageCreate(gqlClient),\n restart: storageRestart(gqlClient),\n pause: storagePause(gqlClient),\n resume: storageResume(gqlClient),\n },\n privateKey: {\n list: privateKeyList(gqlClient),\n read: privatekeyRead(gqlClient),\n create: privateKeyCreate(gqlClient),\n restart: privateKeyRestart(gqlClient),\n pause: privateKeyPause(gqlClient),\n resume: privateKeyResume(gqlClient),\n },\n insights: {\n list: insightsList(gqlClient),\n read: insightsRead(gqlClient),\n create: insightsCreate(gqlClient),\n restart: insightsRestart(gqlClient),\n pause: insightsPause(gqlClient),\n resume: insightsResume(gqlClient),\n },\n customDeployment: {\n list: customdeploymentList(gqlClient),\n read: customdeploymentRead(gqlClient),\n create: customdeploymentCreate(gqlClient),\n update: customdeploymentUpdate(gqlClient),\n restart: customDeploymentRestart(gqlClient),\n pause: customDeploymentPause(gqlClient),\n resume: customDeploymentResume(gqlClient),\n },\n foundry: {\n env: getEnv(gqlClient),\n },\n applicationAccessToken: {\n create: applicationAccessTokenCreate(gqlClient),\n },\n platform: {\n config: getPlatformConfig(gqlClient),\n },\n wallet: {\n pincodeVerificationChallengeResponse: getPincodeVerificationChallengeResponse,\n pincodeVerificationChallenges: (args) =>\n getPincodeVerificationChallenges({\n ...args,\n instance: validatedOptions.instance,\n accessToken: validatedOptions.accessToken,\n }),\n },\n };\n}\n\nexport type { Application } from \"./graphql/application.js\";\nexport type { BlockchainNetwork } from \"./graphql/blockchain-network.js\";\nexport type { BlockchainNode } from \"./graphql/blockchain-node.js\";\nexport type { CustomDeployment } from \"./graphql/custom-deployment.js\";\nexport type { Insights } from \"./graphql/insights.js\";\nexport type { IntegrationTool } from \"./graphql/integration-tool.js\";\nexport type { LoadBalancer } from \"./graphql/load-balancer.js\";\nexport type { Middleware, MiddlewareWithSubgraphs } from \"./graphql/middleware.js\";\nexport type { PlatformConfig } from \"./graphql/platform.js\";\nexport type { PrivateKey } from \"./graphql/private-key.js\";\nexport type { Storage } from \"./graphql/storage.js\";\nexport type { Workspace } from \"./graphql/workspace.js\";\nexport type { VerificationChallenge } from \"./pincode-verification.js\";\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAaA,UAYR;;;;;;;AClBL,MAAM,oBAAoB,QACxB;;;;;;;;;;;;;;;AAsBF,MAAM,+BAA+B,QACnC;;;;;;;;;KAUA,CAAC;;;;AAMH,MAAM,eAAe,QACnB;;;;;;KAOA,CAAC;;;;AAMH,MAAM,kBAAkB,QACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BA,CAAC;;;;AAQH,MAAM,kBAAkB,QACtB;;;;;;KAOA,CAAC;;;;AAMH,MAAM,aAAa,QACjB;;;;;;;;;;;;AAcF,MAAa,iBAAiB,cAA2D;AACvF,QAAO,YAAY;EACjB,MAAM,EAAE,eAAe,MAAM,UAAU,QAAQ;EAC/C,MAAM,gBAAgB,WAAW,QAAqB,KAAK,cAAc;AACvE,OAAI,KAAK;AACT,OAAI,UAAU,iBAAiB;AAC7B,QAAI,KAAK,GAAG,UAAU;;AAExB,UAAO;KACN;AACH,SAAO,cAAc,MAAM,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE;;;;;;;;;;AAW/D,MAAa,iBAAiB,cAAoF;AAChH,QAAO,OAAO,wBAAgC;EAC5C,MAAM,EAAE,0BAA0B,MAAM,UAAU,QAAQ,cAAc,EAAE,YAAY;AACtF,SAAO;;;;;;;;;;AAWX,MAAa,mBAAmB,cAA6B;AAC3D,QAAO,OAAO,wBAA6C;EACzD,MAAM,EAAE,iBAAiB,cAAc,MAAM,UAAU,QAA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qBAAqB;GAC3B,MAAM,qBAAqB;GAC3B,QAAQ,uBAAuB;GAC/B,QAAQ,uBAAuB;GAC/B,SAAS,wBAAwB;GACjC,OAAO,sBAAsB;GAC7B,QAAQ,uBAAuB;;EAEjC,SAAS,EACP,KAAK,OAAO;EAEd,wBAAwB,EACtB,QAAQ,6BAA6B;EAEvC,UAAU,EACR,QAAQ,kBAAkB;EAE5B,QAAQ;GACN,sCAAsC;GACtC,gCAAgC,SAC9B,iCAAiC;IAC/B,GAAG;IACH,UAAU,iBAAiB;IAC3B,aAAa,iBAAiB"}
|
|
1
|
+
{"version":3,"file":"settlemint.js","names":["graphql: initGraphQLTada<{\n introspection: introspection;\n disableMasking: true;\n scalars: {\n DateTime: Date;\n JSON: Record<string, unknown>;\n Bytes: string;\n Int8: string;\n BigInt: string;\n BigDecimal: string;\n Timestamp: string;\n };\n}>","verificationChallenges: VerificationChallenge[]","data: { errors: { message: string }[] }"],"sources":["../src/helpers/graphql.ts","../src/graphql/workspace.ts","../src/graphql/application.ts","../src/graphql/application-access-tokens.ts","../src/defaults/cluster-service-defaults.ts","../src/defaults/blockchain-network-defaults.ts","../src/graphql/blockchain-network.ts","../src/graphql/blockchain-node.ts","../src/graphql/custom-deployment.ts","../src/graphql/foundry.ts","../src/graphql/load-balancer.ts","../src/graphql/insights.ts","../src/graphql/integration-tool.ts","../src/graphql/storage.ts","../src/graphql/middleware.ts","../src/graphql/platform.ts","../src/graphql/private-key.ts","../src/helpers/client-options.schema.ts","../src/pincode-verification.ts","../src/settlemint.ts"],"sourcesContent":["/**\n * This module initializes and exports GraphQL-related utilities using gql.tada.\n * It sets up the GraphQL client with specific configurations and exports necessary types and functions.\n */\n\nimport { initGraphQLTada } from \"gql.tada\";\nimport type { introspection } from \"./graphql-env.d.ts\";\n\n/**\n * Initializes the GraphQL client with specific configurations.\n *\n * @returns A configured GraphQL client instance.\n */\nexport const graphql: initGraphQLTada<{\n introspection: introspection;\n disableMasking: true;\n scalars: {\n DateTime: Date;\n JSON: Record<string, unknown>;\n Bytes: string;\n Int8: string;\n BigInt: string;\n BigDecimal: string;\n Timestamp: string;\n };\n}> = initGraphQLTada<{\n introspection: introspection;\n disableMasking: true;\n scalars: {\n DateTime: Date;\n JSON: Record<string, unknown>;\n Bytes: string;\n Int8: string;\n BigInt: string;\n BigDecimal: string;\n Timestamp: string;\n };\n}>();\n\nexport { readFragment } from \"gql.tada\";\nexport type { FragmentOf, ResultOf, VariablesOf } from \"gql.tada\";\n","import { type Id, IdSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * GraphQL fragment containing core workspace fields.\n */\nconst WorkspaceFragment = graphql(\n `\n fragment Workspace on Workspace {\n id\n uniqueName\n name\n applications {\n id\n uniqueName\n name\n }\n }\n `,\n);\n\n/**\n * Type representing a workspace entity.\n */\nexport type Workspace = ResultOf<typeof WorkspaceFragment>;\n\n/**\n * Query to fetch all workspaces and their applications.\n */\nconst getWorkspacesAndApplications = graphql(\n `\n query getWorkspacesAndApplications {\n workspaces {\n ...Workspace\n childWorkspaces {\n ...Workspace\n }\n }\n }\n `,\n [WorkspaceFragment],\n);\n\n/**\n * Query to fetch a specific workspace by unique name.\n */\nconst getWorkspace = graphql(\n `\n query getWorkspace($uniqueName: String!) {\n workspaceByUniqueName(uniqueName: $uniqueName) {\n ...Workspace\n }\n }\n `,\n [WorkspaceFragment],\n);\n\n/**\n * Mutation to create a new workspace.\n */\nconst createWorkspace = graphql(\n `\n mutation CreateWorkspace(\n $addressLine1: String\n $addressLine2: String\n $city: String\n $companyName: String\n $country: String\n $name: String!\n $parentId: String\n $paymentMethodId: String\n $postalCode: String\n $taxIdType: String\n $taxIdValue: String\n ) {\n createWorkspace(\n addressLine1: $addressLine1\n addressLine2: $addressLine2\n city: $city\n companyName: $companyName\n country: $country\n name: $name\n parentId: $parentId\n paymentMethodId: $paymentMethodId\n postalCode: $postalCode\n taxIdType: $taxIdType\n taxIdValue: $taxIdValue\n ) {\n ...Workspace\n }\n }\n `,\n [WorkspaceFragment],\n);\n\nexport type CreateWorkspaceArgs = VariablesOf<typeof createWorkspace>;\n\n/**\n * Mutation to delete a workspace.\n */\nconst deleteWorkspace = graphql(\n `\n mutation deleteWorkspace($uniqueName: String!) {\n deleteWorkspaceByUniqueName(uniqueName: $uniqueName) {\n ...Workspace\n }\n }\n `,\n [WorkspaceFragment],\n);\n\n/**\n * Mutation to add credits to a workspace.\n */\nconst addCredits = graphql(\n `\n mutation addCredits($workspaceId: String!, $amount: Float!) {\n addCredits(workspaceId: $workspaceId, amount: $amount)\n }\n `,\n);\n\n/**\n * Creates a function to list all workspaces and their applications.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that returns all workspaces sorted by name\n * @throws If the request fails\n */\nexport const workspaceList = (gqlClient: GraphQLClient): (() => Promise<Workspace[]>) => {\n return async () => {\n const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);\n const allWorkspaces = workspaces.reduce<Workspace[]>((acc, workspace) => {\n acc.push(workspace);\n if (workspace.childWorkspaces) {\n acc.push(...workspace.childWorkspaces);\n }\n return acc;\n }, []);\n return allWorkspaces.sort((a, b) => a.name.localeCompare(b.name));\n };\n};\n\n/**\n * Creates a function to read a specific workspace by unique name.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single workspace by unique name\n * @throws If the workspace cannot be found or the request fails\n */\nexport const workspaceRead = (gqlClient: GraphQLClient): ((workspaceUniqueName: string) => Promise<Workspace>) => {\n return async (workspaceUniqueName: string) => {\n const { workspaceByUniqueName } = await gqlClient.request(getWorkspace, { uniqueName: workspaceUniqueName });\n return workspaceByUniqueName;\n };\n};\n\n/**\n * Creates a function to create a new workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new workspace with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const workspaceCreate = (gqlClient: GraphQLClient) => {\n return async (createWorkspaceArgs: CreateWorkspaceArgs) => {\n const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);\n return workspace;\n };\n};\n\n/**\n * Creates a function to delete a workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that deletes a workspace by unique name\n * @throws If the workspace cannot be found or the deletion fails\n */\nexport const workspaceDelete = (gqlClient: GraphQLClient) => {\n return async (workspaceUniqueName: string) => {\n const { deleteWorkspaceByUniqueName: workspace } = await gqlClient.request(deleteWorkspace, {\n uniqueName: workspaceUniqueName,\n });\n return workspace;\n };\n};\n\n/**\n * Creates a function to add credits to a workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that adds credits to a workspace\n * @throws If the workspace ID is invalid or amount is not positive\n */\nexport const workspaceAddCredits = (gqlClient: GraphQLClient) => {\n return async (workspaceId: Id, amount: number) => {\n const id = validate(IdSchema, workspaceId);\n if (amount <= 0) {\n throw new Error(\"Credit amount must be a positive number\");\n }\n const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });\n return result;\n };\n};\n","import { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { workspaceRead } from \"./workspace.js\";\n\n/**\n * GraphQL fragment containing core application fields.\n */\nconst ApplicationFragment = graphql(`\n fragment Application on Application {\n id\n uniqueName\n name\n workspace {\n id\n uniqueName\n name\n }\n }\n`);\n\n/**\n * Type representing an application entity.\n */\nexport type Application = ResultOf<typeof ApplicationFragment>;\n\n/**\n * Query to fetch applications for a workspace.\n */\nconst listApplications = graphql(\n `\n query ListApplications($workspaceUniqueName: String!) {\n workspaceByUniqueName(uniqueName: $workspaceUniqueName) {\n applications {\n ...Application\n }\n }\n }\n `,\n [ApplicationFragment],\n);\n\n/**\n * Query to fetch a specific application.\n */\nconst readApplication = graphql(\n `\n query ReadApplication($applicationUniqueName: String!) {\n applicationByUniqueName(uniqueName: $applicationUniqueName) {\n ...Application\n }\n }\n `,\n [ApplicationFragment],\n);\n\n/**\n * Mutation to create a new application.\n */\nconst createApplication = graphql(\n `\n mutation CreateApplication($name: String!, $workspaceId: ID!) {\n createApplication(name: $name, workspaceId: $workspaceId) {\n ...Application\n }\n }\n `,\n [ApplicationFragment],\n);\n\n/**\n * Mutation to delete an application.\n */\nconst deleteApplication = graphql(\n `\n mutation DeleteApplication($uniqueName: String!) {\n deleteApplicationByUniqueName(uniqueName: $uniqueName) {\n ...Application\n }\n }\n `,\n [ApplicationFragment],\n);\n\n/**\n * Arguments required to create an application.\n */\nexport type CreateApplicationArgs = Omit<VariablesOf<typeof createApplication>, \"workspaceId\"> & {\n workspaceUniqueName: string;\n};\n\n/**\n * Creates a function to list applications in a workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches applications for a workspace\n * @throws If the workspace cannot be found or the request fails\n */\nexport const applicationList = (gqlClient: GraphQLClient) => {\n return async (workspaceUniqueName: string): Promise<Application[]> => {\n const {\n workspaceByUniqueName: { applications },\n } = await gqlClient.request(listApplications, { workspaceUniqueName });\n return applications;\n };\n};\n\n/**\n * Creates a function to fetch a specific application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single application by unique name\n * @throws If the application cannot be found or the request fails\n */\nexport const applicationRead = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string): Promise<Application> => {\n const { applicationByUniqueName: application } = await gqlClient.request(readApplication, {\n applicationUniqueName,\n });\n return application;\n };\n};\n\n/**\n * Creates a function to create a new application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new application with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const applicationCreate = (gqlClient: GraphQLClient) => {\n return async (args: CreateApplicationArgs): Promise<Application> => {\n const { workspaceUniqueName, ...otherArgs } = args;\n const workspace = await workspaceRead(gqlClient)(workspaceUniqueName);\n const { createApplication: application } = await gqlClient.request(createApplication, {\n ...otherArgs,\n workspaceId: workspace.id,\n });\n return application;\n };\n};\n\n/**\n * Creates a function to delete an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that deletes an application by unique name\n * @throws If the application cannot be found or the deletion fails\n */\nexport const applicationDelete = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string): Promise<Application> => {\n const { deleteApplicationByUniqueName: application } = await gqlClient.request(deleteApplication, {\n uniqueName: applicationUniqueName,\n });\n return application;\n };\n};\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\nconst createApplicationAccessToken = graphql(\n `\n mutation CreateApplicationAccessToken(\n $applicationId: ID!,\n $blockchainNetworkScope: BlockchainNetworkScopeInputType!,\n $blockchainNodeScope: BlockchainNodeScopeInputType!,\n $customDeploymentScope: CustomDeploymentScopeInputType!,\n $insightsScope: InsightsScopeInputType!,\n $integrationScope: IntegrationScopeInputType!,\n $loadBalancerScope: LoadBalancerScopeInputType!,\n $middlewareScope: MiddlewareScopeInputType!,\n $name: String!,\n $privateKeyScope: PrivateKeyScopeInputType!,\n $smartContractSetScope: SmartContractSetScopeInputType!,\n $storageScope: StorageScopeInputType!,\n $validityPeriod: AccessTokenValidityPeriod!\n ) {\n createApplicationAccessToken(\n applicationId: $applicationId,\n blockchainNetworkScope: $blockchainNetworkScope,\n blockchainNodeScope: $blockchainNodeScope,\n customDeploymentScope: $customDeploymentScope,\n insightsScope: $insightsScope,\n integrationScope: $integrationScope,\n loadBalancerScope: $loadBalancerScope,\n middlewareScope: $middlewareScope,\n name: $name,\n privateKeyScope: $privateKeyScope,\n smartContractSetScope: $smartContractSetScope,\n storageScope: $storageScope,\n validityPeriod: $validityPeriod\n ) {\n token\n }\n }\n `,\n [],\n);\n\nexport type CreateApplicationAccessTokenArgs = Omit<\n VariablesOf<typeof createApplicationAccessToken>,\n \"applicationId\"\n> & { applicationUniqueName: string };\n\n/**\n * Creates a new application.\n *\n * @param gqlClient - The GraphQL client instance used to execute the mutation.\n * @returns A function that accepts the arguments for creating an application and returns a promise resolving to the created application.\n */\nexport const applicationAccessTokenCreate = (gqlClient: GraphQLClient) => {\n return async (args: CreateApplicationAccessTokenArgs): Promise<string> => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(\n createApplicationAccessToken,\n {\n ...otherArgs,\n applicationId: application.id,\n },\n );\n if (!applicationAccessToken.token) {\n throw new Error(\"Failed to create application access token\");\n }\n return applicationAccessToken.token;\n };\n};\n","/**\n * Sets the default values for a cluster service.\n *\n * @param args - The arguments for creating a cluster service.\n * @returns The modified arguments with default values set.\n */\nexport function setClusterServiceDefaults<\n Args extends {\n size?: \"SMALL\" | \"MEDIUM\" | \"LARGE\" | \"CUSTOM\" | null | undefined;\n type?: \"SHARED\" | \"DEDICATED\" | null | undefined;\n },\n>(args: Args): Args {\n return {\n ...args,\n size: args.size ?? \"SMALL\",\n type: args.type ?? \"SHARED\",\n };\n}\n","import type { CreateBlockchainNetworkArgs } from \"../graphql/blockchain-network.js\";\nimport { setClusterServiceDefaults } from \"./cluster-service-defaults.js\";\n\n/**\n * Sets the default values for a blockchain network.\n *\n * @param args - The arguments for creating a blockchain network.\n * @returns The modified arguments with default values set.\n */\nexport function setNetworkDefaults(\n args: Omit<CreateBlockchainNetworkArgs, \"applicationUniqueName\">,\n): Omit<CreateBlockchainNetworkArgs, \"applicationUniqueName\"> {\n const clusterServiceArgs = setClusterServiceDefaults(args);\n if (args.consensusAlgorithm === \"BESU_QBFT\") {\n return {\n ...clusterServiceArgs,\n chainId: args.chainId ?? 46040,\n contractSizeLimit: args.contractSizeLimit ?? 2147483647,\n evmStackSize: args.evmStackSize ?? 2048,\n gasLimit: args.gasLimit ?? \"9007199254740991\",\n gasPrice: args.gasPrice ?? 0,\n secondsPerBlock: args.secondsPerBlock ?? 2,\n };\n }\n return clusterServiceArgs;\n}\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { setNetworkDefaults } from \"../defaults/blockchain-network-defaults.js\";\n\n/**\n * Fragment containing core blockchain network fields.\n */\nconst BlockchainNetworkFragment = graphql(`\n fragment BlockchainNetwork on BlockchainNetwork {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n ... on BesuQBFTBlockchainNetwork {\n chainId\n }\n ... on BesuIbftv2BlockchainNetwork {\n chainId\n }\n ... on PolygonEdgePoABlockchainNetwork {\n chainId\n }\n ... on QuorumQBFTBlockchainNetwork {\n chainId\n }\n ... on GethCliqueBlockchainNetwork {\n chainId\n }\n ... on PublicEvmBlockchainNetwork {\n chainId\n }\n blockchainNodes {\n ... on BlockchainNode {\n id\n name\n uniqueName\n endpoints {\n id\n label\n displayValue\n }\n }\n }\n }\n`);\n\n/**\n * Type representing a blockchain network entity.\n */\nexport type BlockchainNetwork = ResultOf<typeof BlockchainNetworkFragment>;\n\n/**\n * Query to fetch blockchain networks for an application.\n */\nconst getBlockchainNetworks = graphql(\n `\n query getBlockchainNetworks($applicationUniqueName: String!) {\n blockchainNetworksByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...BlockchainNetwork\n }\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Query to fetch a specific blockchain network.\n */\nconst getBlockchainNetwork = graphql(\n `\n query getBlockchainNetwork($uniqueName: String!) {\n blockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to create a new blockchain network.\n */\nconst createBlockchainNetwork = graphql(\n `\n mutation createBlockchainNetwork(\n $applicationId: ID!\n $chainId: Int\n $consensusAlgorithm: ConsensusAlgorithm!\n $contractSizeLimit: Int\n $evmStackSize: Int\n $gasLimit: String\n $gasPrice: Int\n $name: String!\n $nodeName: String!\n $secondsPerBlock: Int\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $batchTimeout: Float\n $maxMessageCount: Int\n $absoluteMaxBytes: Int\n $preferredMaxBytes: Int\n $endorsementPolicy: FabricEndorsementPolicy\n $maxCodeSize: Int\n $txnSizeLimit: Int\n $besuIbft2Genesis: BesuIbft2GenesisInput\n $besuQbftGenesis: BesuQbftGenesisInput\n $quorumGenesis: QuorumGenesisInput\n $externalNodes: [BlockchainNetworkExternalNodeInput!]\n $privateKeyId: ID\n $includePredeployedContracts: Boolean\n ) {\n createBlockchainNetwork(\n applicationId: $applicationId\n chainId: $chainId\n consensusAlgorithm: $consensusAlgorithm\n contractSizeLimit: $contractSizeLimit\n evmStackSize: $evmStackSize\n gasLimit: $gasLimit\n gasPrice: $gasPrice\n name: $name\n nodeName: $nodeName\n secondsPerBlock: $secondsPerBlock\n provider: $provider\n region: $region\n size: $size\n type: $type\n batchTimeout: $batchTimeout\n maxMessageCount: $maxMessageCount\n absoluteMaxBytes: $absoluteMaxBytes\n preferredMaxBytes: $preferredMaxBytes\n endorsementPolicy: $endorsementPolicy\n maxCodeSize: $maxCodeSize\n txnSizeLimit: $txnSizeLimit\n besuIbft2Genesis: $besuIbft2Genesis\n besuQbftGenesis: $besuQbftGenesis\n quorumGenesis: $quorumGenesis\n externalNodes: $externalNodes\n keyMaterial: $privateKeyId\n includePredeployedContracts: $includePredeployedContracts\n ) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Arguments required to create a blockchain network.\n */\nexport type CreateBlockchainNetworkArgs = Omit<VariablesOf<typeof createBlockchainNetwork>, \"applicationId\"> & {\n applicationUniqueName: string;\n};\n\n/**\n * Mutation to delete a blockchain network.\n */\nconst deleteBlockchainNetwork = graphql(\n `\n mutation deleteBlockchainNetwork($uniqueName: String!) {\n deleteBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to restart a blockchain network.\n */\nconst restartBlockchainNetwork = graphql(\n `\n mutation RestartBlockchainNetwork($uniqueName: String!) {\n restartBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to pause a blockchain network.\n */\nconst pauseBlockchainNetwork = graphql(\n `\n mutation PauseBlockchainNetwork($uniqueName: String!) {\n pauseBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to resume a blockchain network.\n */\nconst resumeBlockchainNetwork = graphql(\n `\n mutation ResumeBlockchainNetwork($uniqueName: String!) {\n resumeBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNetwork\n }\n }\n `,\n [BlockchainNetworkFragment],\n);\n\n/**\n * Creates a function to list blockchain networks for a given application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches networks for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const blockchainNetworkList = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string) => {\n const {\n blockchainNetworksByUniqueName: { items },\n } = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single network by unique name\n * @throws If the network cannot be found or the request fails\n */\nexport const blockchainNetworkRead = (gqlClient: GraphQLClient) => {\n return async (blockchainNetworkUniqueName: string) => {\n const { blockchainNetworkByUniqueName } = await gqlClient.request(getBlockchainNetwork, {\n uniqueName: blockchainNetworkUniqueName,\n });\n return blockchainNetworkByUniqueName;\n };\n};\n\n/**\n * Creates a function to create a new blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new network with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const blockchainNetworkCreate = (\n gqlClient: GraphQLClient,\n): ((args: CreateBlockchainNetworkArgs) => Promise<BlockchainNetwork>) => {\n return async (args: CreateBlockchainNetworkArgs) => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const blockchainNetworkArgs = setNetworkDefaults(otherArgs);\n const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, {\n ...blockchainNetworkArgs,\n applicationId: application.id,\n });\n return blockchainNetwork;\n };\n};\n\n/**\n * Creates a function to delete a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that deletes a network by unique name\n * @throws If the network cannot be found or the deletion fails\n */\nexport const blockchainNetworkDelete = (gqlClient: GraphQLClient) => {\n return async (blockchainNetworkUniqueName: string) => {\n const { deleteBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(\n deleteBlockchainNetwork,\n {\n uniqueName: blockchainNetworkUniqueName,\n },\n );\n return blockchainNetwork;\n };\n};\n\n/**\n * Creates a function to restart a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a network by unique name\n * @throws If the network cannot be found or the restart fails\n */\nexport const blockchainNetworkRestart =\n (gqlClient: GraphQLClient) =>\n async (blockchainNetworkUniqueName: string): Promise<BlockchainNetwork> => {\n const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(\n restartBlockchainNetwork,\n { uniqueName: blockchainNetworkUniqueName },\n );\n return blockchainNetwork;\n };\n\n/**\n * Creates a function to pause a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses a network by unique name\n * @throws If the network cannot be found or the pause fails\n */\nexport const blockchainNetworkPause =\n (gqlClient: GraphQLClient) =>\n async (blockchainNetworkUniqueName: string): Promise<BlockchainNetwork> => {\n const { pauseBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(pauseBlockchainNetwork, {\n uniqueName: blockchainNetworkUniqueName,\n });\n return blockchainNetwork;\n };\n\n/**\n * Creates a function to resume a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes a network by unique name\n * @throws If the network cannot be found or the resume fails\n */\nexport const blockchainNetworkResume =\n (gqlClient: GraphQLClient) =>\n async (blockchainNetworkUniqueName: string): Promise<BlockchainNetwork> => {\n const { resumeBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(\n resumeBlockchainNetwork,\n { uniqueName: blockchainNetworkUniqueName },\n );\n return blockchainNetwork;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { blockchainNetworkRead } from \"./blockchain-network.js\";\n\n/**\n * Fragment containing core blockchain node fields.\n */\nconst BlockchainNodeFragment = graphql(`\n fragment BlockchainNode on BlockchainNode {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n isEvm\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n blockchainNetwork {\n ... on AbstractClusterService {\n id\n name\n uniqueName\n ... on BesuQBFTBlockchainNetwork {\n chainId\n }\n ... on BesuIbftv2BlockchainNetwork {\n chainId\n }\n ... on PolygonEdgePoABlockchainNetwork {\n chainId\n }\n ... on QuorumQBFTBlockchainNetwork {\n chainId\n }\n ... on GethCliqueBlockchainNetwork {\n chainId\n }\n ... on PublicEvmBlockchainNetwork {\n chainId\n }\n }\n }\n privateKeys {\n ... on PrivateKey {\n id\n name\n privateKeyType\n address\n }\n }\n }\n`);\n\n/**\n * Type representing a blockchain node entity.\n */\nexport type BlockchainNode = ResultOf<typeof BlockchainNodeFragment>;\n\n/**\n * Query to fetch blockchain nodes for an application.\n */\nconst getBlockchainNodes = graphql(\n `\n query getBlockchainNodes($applicationUniqueName: String!) {\n blockchainNodesByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...BlockchainNode\n }\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Query to fetch a specific blockchain node.\n */\nconst getBlockchainNode = graphql(\n `\n query getBlockchainNode($uniqueName: String!) {\n blockchainNodeByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Mutation to create a blockchain node.\n */\nconst createBlockchainNode = graphql(\n `\n mutation createBlockchainNode(\n $applicationId: ID!\n $blockchainNetworkId: ID!\n $name: String!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $nodeType: NodeType\n $keyMaterial: ID\n ) {\n createBlockchainNode(\n applicationId: $applicationId\n blockchainNetworkId: $blockchainNetworkId\n name: $name\n provider: $provider\n region: $region\n size: $size\n type: $type\n nodeType: $nodeType\n keyMaterial: $keyMaterial\n ) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Arguments required to create a blockchain node.\n */\nexport type CreateBlockchainNodeArgs = Omit<\n VariablesOf<typeof createBlockchainNode>,\n \"applicationId\" | \"blockchainNetworkId\"\n> & {\n applicationUniqueName: string;\n blockchainNetworkUniqueName: string;\n};\n\n/**\n * Mutation to restart a blockchain node.\n */\nconst restartBlockchainNode = graphql(\n `\n mutation RestartBlockchainNode($uniqueName: String!) {\n restartBlockchainNodeByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Mutation to pause a blockchain node.\n */\nconst pauseBlockchainNode = graphql(\n `\n mutation PauseBlockchainNode($uniqueName: String!) {\n pauseBlockchainNodeByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Mutation to resume a blockchain node.\n */\nconst resumeBlockchainNode = graphql(\n `\n mutation ResumeBlockchainNode($uniqueName: String!) {\n resumeBlockchainNodeByUniqueName(uniqueName: $uniqueName) {\n ...BlockchainNode\n }\n }\n `,\n [BlockchainNodeFragment],\n);\n\n/**\n * Creates a function to list blockchain nodes for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches blockchain nodes for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const blockchainNodeList = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string): Promise<BlockchainNode[]> => {\n const {\n blockchainNodesByUniqueName: { items },\n } = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single blockchain node by unique name\n * @throws If the blockchain node cannot be found or the request fails\n */\nexport const blockchainNodeRead = (gqlClient: GraphQLClient) => {\n return async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n const { blockchainNodeByUniqueName } = await gqlClient.request(getBlockchainNode, {\n uniqueName: blockchainNodeUniqueName,\n });\n return blockchainNodeByUniqueName;\n };\n};\n\n/**\n * Creates a function to create a new blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new blockchain node with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const blockchainNodeCreate = (gqlClient: GraphQLClient) => {\n return async (args: CreateBlockchainNodeArgs): Promise<BlockchainNode> => {\n const { applicationUniqueName, blockchainNetworkUniqueName, ...otherArgs } = args;\n const [application, blockchainNetwork] = await Promise.all([\n applicationRead(gqlClient)(applicationUniqueName),\n blockchainNetworkRead(gqlClient)(blockchainNetworkUniqueName),\n ]);\n const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNetworkId: blockchainNetwork.id,\n });\n return blockchainNode;\n };\n};\n\n/**\n * Creates a function to restart a blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a blockchain node by unique name\n * @throws If the blockchain node cannot be found or the restart fails\n */\nexport const blockchainNodeRestart =\n (gqlClient: GraphQLClient) =>\n async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, {\n uniqueName: blockchainNodeUniqueName,\n });\n return blockchainNode;\n };\n\n/**\n * Creates a function to pause a blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses a blockchain node by unique name\n * @throws If the blockchain node cannot be found or the pause fails\n */\nexport const blockchainNodePause =\n (gqlClient: GraphQLClient) =>\n async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n const { pauseBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(pauseBlockchainNode, {\n uniqueName: blockchainNodeUniqueName,\n });\n return blockchainNode;\n };\n\n/**\n * Creates a function to resume a blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes a blockchain node by unique name\n * @throws If the blockchain node cannot be found or the resume fails\n */\nexport const blockchainNodeResume =\n (gqlClient: GraphQLClient) =>\n async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n const { resumeBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(resumeBlockchainNode, {\n uniqueName: blockchainNodeUniqueName,\n });\n return blockchainNode;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * Fragment containing core custom deployment fields.\n */\nconst CustomDeploymentFragment = graphql(`\n fragment CustomDeployment on CustomDeployment {\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing a custom deployment entity.\n */\nexport type CustomDeployment = ResultOf<typeof CustomDeploymentFragment>;\n\n/**\n * Query to fetch custom deployments for an application.\n */\nconst getCustomDeployments = graphql(\n `\n query getCustomDeployments($applicationUniqueName: String!) {\n customDeploymentsByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...CustomDeployment\n }\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Query to fetch a specific custom deployment.\n */\nconst getCustomDeployment = graphql(\n `\n query getCustomDeployment($uniqueName: String!) {\n customDeploymentByUniqueName(uniqueName: $uniqueName) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to edit a custom deployment.\n */\nconst editCustomDeployment = graphql(\n `\n mutation EditCustomDeployment($uniqueName: String!, $imageTag: String) {\n editCustomDeploymentByUniqueName(uniqueName: $uniqueName, imageTag: $imageTag) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to create a custom deployment.\n */\nconst createCustomDeployment = graphql(\n `\n mutation CreateCustomDeployment(\n $applicationId: ID!\n $name: String!\n $imageTag: String!\n $imageName: String!\n $imageRepository: String!\n $environmentVariables: JSON\n $port: Int!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n ) {\n createCustomDeployment(\n applicationId: $applicationId\n name: $name\n imageTag: $imageTag\n imageName: $imageName\n imageRepository: $imageRepository\n port: $port\n environmentVariables: $environmentVariables\n provider: $provider\n region: $region\n size: $size\n type: $type\n ) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Arguments required to create a custom deployment.\n */\nexport type CreateCustomDeploymentArgs = Omit<VariablesOf<typeof createCustomDeployment>, \"applicationId\"> & {\n applicationUniqueName: string;\n};\n\n/**\n * Mutation to restart a custom deployment.\n */\nconst restartCustomDeployment = graphql(\n `\n mutation RestartCustomDeployment($uniqueName: String!) {\n restartCustomDeploymentByUniqueName(uniqueName: $uniqueName) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to pause a custom deployment.\n */\nconst pauseCustomDeployment = graphql(\n `\n mutation PauseCustomDeployment($uniqueName: String!) {\n pauseCustomDeploymentByUniqueName(uniqueName: $uniqueName) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to resume a custom deployment.\n */\nconst resumeCustomDeployment = graphql(\n `\n mutation ResumeCustomDeployment($uniqueName: String!) {\n resumeCustomDeploymentByUniqueName(uniqueName: $uniqueName) {\n ...CustomDeployment\n }\n }\n `,\n [CustomDeploymentFragment],\n);\n\n/**\n * Creates a function to list custom deployments for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches custom deployments for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const customdeploymentList = (\n gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<CustomDeployment[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n customDeploymentsByUniqueName: { items },\n } = await gqlClient.request(getCustomDeployments, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single custom deployment by unique name\n * @throws If the custom deployment cannot be found or the request fails\n */\nexport const customdeploymentRead = (\n gqlClient: GraphQLClient,\n): ((customDeploymentUniqueName: string) => Promise<CustomDeployment>) => {\n return async (customDeploymentUniqueName: string) => {\n const { customDeploymentByUniqueName: customDeployment } = await gqlClient.request(getCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n });\n return customDeployment;\n };\n};\n\n/**\n * Creates a function to update a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that updates a custom deployment with a new image tag\n * @throws If the custom deployment cannot be found or the update fails\n */\nexport const customdeploymentUpdate = (\n gqlClient: GraphQLClient,\n): ((customDeploymentUniqueName: string, imageTag: string) => Promise<CustomDeployment>) => {\n return async (customDeploymentUniqueName: string, imageTag: string) => {\n const { editCustomDeploymentByUniqueName: cd } = await gqlClient.request(editCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n imageTag,\n });\n return cd;\n };\n};\n\n/**\n * Creates a function to create a new custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new custom deployment with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const customdeploymentCreate = (\n gqlClient: GraphQLClient,\n): ((args: CreateCustomDeploymentArgs) => Promise<CustomDeployment>) => {\n return async (args: CreateCustomDeploymentArgs) => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, {\n ...otherArgs,\n applicationId: application.id,\n });\n return customDeployment;\n };\n};\n\n/**\n * Creates a function to restart a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a custom deployment by unique name\n * @throws If the custom deployment cannot be found or the restart fails\n */\nexport const customDeploymentRestart =\n (gqlClient: GraphQLClient) =>\n async (customDeploymentUniqueName: string): Promise<CustomDeployment> => {\n const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n });\n return customDeployment;\n };\n\n/**\n * Creates a function to pause a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses a custom deployment by unique name\n * @throws If the custom deployment cannot be found or the pause fails\n */\nexport const customDeploymentPause =\n (gqlClient: GraphQLClient) =>\n async (customDeploymentUniqueName: string): Promise<CustomDeployment> => {\n const { pauseCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(pauseCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n });\n return customDeployment;\n };\n\n/**\n * Creates a function to resume a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes a custom deployment by unique name\n * @throws If the custom deployment cannot be found or the resume fails\n */\nexport const customDeploymentResume =\n (gqlClient: GraphQLClient) =>\n async (customDeploymentUniqueName: string): Promise<CustomDeployment> => {\n const { resumeCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(resumeCustomDeployment, {\n uniqueName: customDeploymentUniqueName,\n });\n return customDeployment;\n };\n","import { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * Query to fetch Foundry environment configuration for a blockchain node.\n */\nconst getFoundryEnvConfig = graphql(\n `\n query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {\n foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)\n }\n `,\n);\n\n/**\n * Variables for the Foundry environment config query.\n */\nexport type GetFoundryEnvConfigVariables = VariablesOf<typeof getFoundryEnvConfig>;\n\n/**\n * Result type for the Foundry environment config query.\n */\nexport type GetFoundryEnvConfigResult = ResultOf<typeof getFoundryEnvConfig>;\n\n/**\n * Creates a function to fetch Foundry environment configuration.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches Foundry environment configuration for a blockchain node\n * @throws If the blockchain node cannot be found or the request fails\n */\nexport const getEnv = (gqlClient: GraphQLClient) => {\n return async (blockchainNodeUniqueName: string): Promise<Record<string, string>> => {\n const { foundryEnvConfigByUniqueName } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeUniqueName });\n return foundryEnvConfigByUniqueName as Record<string, string>;\n };\n};\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { blockchainNetworkRead } from \"@/graphql/blockchain-network.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { blockchainNodeRead } from \"./blockchain-node.js\";\n\n/**\n * GraphQL fragment containing core load balancer fields.\n */\nconst LoadBalancerFragment = graphql(`\n fragment LoadBalancer on LoadBalancer {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n endpoints {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing a load balancer entity.\n */\nexport type LoadBalancer = ResultOf<typeof LoadBalancerFragment>;\n\n/**\n * Query to fetch a specific load balancer.\n */\nconst getLoadBalancer = graphql(\n `\n query GetLoadBalancer($uniqueName: String!) {\n loadBalancerByUniqueName(uniqueName: $uniqueName) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Query to fetch all load balancers for an application.\n */\nconst getLoadBalancers = graphql(\n `\n query getLoadBalancers($applicationUniqueName: String!) {\n loadBalancersByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...LoadBalancer\n }\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Mutation to create a load balancer.\n */\nconst createLoadBalancer = graphql(\n `\n mutation createLoadBalancer(\n $applicationId: ID!\n $blockchainNetworkId: ID!\n $name: String!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $connectedNodes: [ID!]!\n ) {\n createLoadBalancer(\n applicationId: $applicationId\n blockchainNetworkId: $blockchainNetworkId\n name: $name\n provider: $provider\n region: $region\n size: $size\n type: $type\n connectedNodes: $connectedNodes\n ) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Arguments required to create a load balancer.\n */\nexport type CreateLoadBalancerArgs = Omit<\n VariablesOf<typeof createLoadBalancer>,\n \"applicationId\" | \"blockchainNetworkId\" | \"connectedNodes\"\n> & {\n applicationUniqueName: string;\n blockchainNetworkUniqueName: string;\n connectedNodesUniqueNames: string[];\n};\n\n/**\n * Mutation to restart a load balancer.\n */\nconst restartLoadBalancer = graphql(\n `\n mutation RestartLoadBalancer($uniqueName: String!) {\n restartLoadBalancerByUniqueName(uniqueName: $uniqueName) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Mutation to pause a load balancer.\n */\nconst pauseLoadBalancer = graphql(\n `\n mutation PauseLoadBalancer($uniqueName: String!) {\n pauseLoadBalancerByUniqueName(uniqueName: $uniqueName) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Mutation to resume a load balancer.\n */\nconst resumeLoadBalancer = graphql(\n `\n mutation ResumeLoadBalancer($uniqueName: String!) {\n resumeLoadBalancerByUniqueName(uniqueName: $uniqueName) {\n ...LoadBalancer\n }\n }\n `,\n [LoadBalancerFragment],\n);\n\n/**\n * Creates a function to fetch a specific load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single load balancer by unique name\n * @throws If the load balancer cannot be found or the request fails\n */\nexport const loadBalancerRead = (\n gqlClient: GraphQLClient,\n): ((loadBalancerUniqueName: string) => Promise<LoadBalancer>) => {\n return async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {\n uniqueName: loadBalancerUniqueName,\n });\n return loadBalancer as LoadBalancer;\n };\n};\n\n/**\n * Creates a function to list load balancers for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches load balancers for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const loadBalancerList = (gqlClient: GraphQLClient) => {\n return async (applicationUniqueName: string): Promise<LoadBalancer[]> => {\n const {\n loadBalancersByUniqueName: { items },\n } = await gqlClient.request(getLoadBalancers, { applicationUniqueName });\n return items as LoadBalancer[];\n };\n};\n\n/**\n * Creates a function to create a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a load balancer\n * @throws If the load balancer cannot be created or the request fails\n */\nexport const loadBalancerCreate = (gqlClient: GraphQLClient) => {\n return async (args: CreateLoadBalancerArgs): Promise<LoadBalancer> => {\n const { applicationUniqueName, blockchainNetworkUniqueName, connectedNodesUniqueNames, ...otherArgs } = args;\n const [application, blockchainNetwork, connectedNodes] = await Promise.all([\n applicationRead(gqlClient)(applicationUniqueName),\n blockchainNetworkRead(gqlClient)(blockchainNetworkUniqueName),\n Promise.all(connectedNodesUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName))),\n ]);\n const { createLoadBalancer: loadBalancer } = await gqlClient.request(createLoadBalancer, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNetworkId: blockchainNetwork.id,\n connectedNodes: connectedNodes.map((node) => node.id),\n });\n return loadBalancer as LoadBalancer;\n };\n};\n\n/**\n * Creates a function to restart a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a load balancer\n * @throws If the load balancer cannot be restarted or the request fails\n */\nexport const loadBalancerRestart =\n (gqlClient: GraphQLClient) =>\n async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n const { restartLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(restartLoadBalancer, {\n uniqueName: loadBalancerUniqueName,\n });\n return loadBalancer as LoadBalancer;\n };\n\n/**\n * Creates a function to pause a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses a load balancer\n * @throws If the load balancer cannot be paused or the request fails\n */\nexport const loadBalancerPause =\n (gqlClient: GraphQLClient) =>\n async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n const { pauseLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(pauseLoadBalancer, {\n uniqueName: loadBalancerUniqueName,\n });\n return loadBalancer as LoadBalancer;\n };\n\n/**\n * Creates a function to resume a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes a load balancer\n * @throws If the load balancer cannot be resumed or the request fails\n */\nexport const loadBalancerResume =\n (gqlClient: GraphQLClient) =>\n async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n const { resumeLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(resumeLoadBalancer, {\n uniqueName: loadBalancerUniqueName,\n });\n return loadBalancer as LoadBalancer;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { blockchainNodeRead } from \"@/graphql/blockchain-node.js\";\nimport { loadBalancerRead } from \"@/graphql/load-balancer.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * GraphQL fragment containing core insights fields.\n */\nconst InsightsFragment = graphql(`\n fragment Insights on Insights {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n insightsCategory\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing an insights entity.\n */\nexport type Insights = ResultOf<typeof InsightsFragment>;\n\n/**\n * Query to fetch insights for an application.\n */\nconst getInsights = graphql(\n `\n query GetInsights($applicationUniqueName: String!) {\n insightsListByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...Insights\n }\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Query to fetch a specific insight.\n */\nconst getInsight = graphql(\n `\n query GetInsight($uniqueName: String!) {\n insightsByUniqueName(uniqueName: $uniqueName) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Mutation to create insights.\n */\nconst createInsights = graphql(\n `\n mutation CreateInsights(\n $applicationId: ID!\n $name: String!\n $insightsCategory: InsightsCategory!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $blockchainNode: ID\n $loadBalancer: ID\n ) {\n createInsights(\n applicationId: $applicationId\n name: $name\n insightsCategory: $insightsCategory\n provider: $provider\n region: $region\n size: $size\n type: $type\n blockchainNode: $blockchainNode\n loadBalancer: $loadBalancer\n ) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Arguments required to create insights.\n */\nexport type CreateInsightsArgs = Omit<\n VariablesOf<typeof createInsights>,\n \"applicationId\" | \"blockchainNode\" | \"loadBalancer\"\n> & {\n applicationUniqueName: string;\n blockchainNodeUniqueName?: string;\n loadBalancerUniqueName?: string;\n};\n\n/**\n * Mutation to restart insights.\n */\nconst restartInsights = graphql(\n `\n mutation RestartInsights($uniqueName: String!) {\n restartInsightsByUniqueName(uniqueName: $uniqueName) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Mutation to pause insights.\n */\nconst pauseInsights = graphql(\n `\n mutation PauseInsights($uniqueName: String!) {\n pauseInsightsByUniqueName(uniqueName: $uniqueName) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Mutation to resume insights.\n */\nconst resumeInsights = graphql(\n `\n mutation ResumeInsights($uniqueName: String!) {\n resumeInsightsByUniqueName(uniqueName: $uniqueName) {\n ...Insights\n }\n }\n `,\n [InsightsFragment],\n);\n\n/**\n * Creates a function to list insights for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches insights for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const insightsList = (gqlClient: GraphQLClient): ((applicationUniqueName: string) => Promise<Insights[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n insightsListByUniqueName: { items },\n } = await gqlClient.request(getInsights, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific insight.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single insight by unique name\n * @throws If the insight cannot be found or the request fails\n */\nexport const insightsRead = (gqlClient: GraphQLClient): ((insightsUniqueName: string) => Promise<Insights>) => {\n return async (insightsUniqueName: string) => {\n const { insightsByUniqueName: insights } = await gqlClient.request(getInsight, { uniqueName: insightsUniqueName });\n return insights;\n };\n};\n\n/**\n * Creates a function to create new insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new insights with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const insightsCreate = (gqlClient: GraphQLClient): ((args: CreateInsightsArgs) => Promise<Insights>) => {\n return async (args: CreateInsightsArgs) => {\n const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, ...otherArgs } = args;\n const [application, blockchainNode, loadBalancer] = await Promise.all([\n applicationRead(gqlClient)(applicationUniqueName),\n blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(undefined),\n loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(undefined),\n ]);\n const { createInsights: insights } = await gqlClient.request(createInsights, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNode: blockchainNode?.id,\n loadBalancer: loadBalancer?.id,\n });\n return insights;\n };\n};\n\n/**\n * Creates a function to restart insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts insights by unique name\n * @throws If the insights cannot be found or the restart fails\n */\nexport const insightsRestart =\n (gqlClient: GraphQLClient) =>\n async (insightsUniqueName: string): Promise<Insights> => {\n const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, {\n uniqueName: insightsUniqueName,\n });\n return insights;\n };\n\n/**\n * Creates a function to pause insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses insights by unique name\n * @throws If the insights cannot be found or the pause fails\n */\nexport const insightsPause =\n (gqlClient: GraphQLClient) =>\n async (insightsUniqueName: string): Promise<Insights> => {\n const { pauseInsightsByUniqueName: insights } = await gqlClient.request(pauseInsights, {\n uniqueName: insightsUniqueName,\n });\n return insights;\n };\n\n/**\n * Creates a function to resume insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes insights by unique name\n * @throws If the insights cannot be found or the resume fails\n */\nexport const insightsResume =\n (gqlClient: GraphQLClient) =>\n async (insightsUniqueName: string): Promise<Insights> => {\n const { resumeInsightsByUniqueName: insights } = await gqlClient.request(resumeInsights, {\n uniqueName: insightsUniqueName,\n });\n return insights;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * GraphQL fragment containing core integration fields.\n */\nconst IntegrationFragment = graphql(`\n fragment Integration on Integration {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n integrationType\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing an integration tool entity.\n */\nexport type IntegrationTool = ResultOf<typeof IntegrationFragment>;\n\n/**\n * Query to fetch integrations for an application.\n */\nconst getIntegrations = graphql(\n `\n query GetIntegrations($applicationUniqueName: String!) {\n integrationsByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...Integration\n }\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Query to fetch a specific integration.\n */\nconst getIntegration = graphql(\n `\n query GetIntegration($uniqueName: String!) {\n integrationByUniqueName(uniqueName: $uniqueName) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Mutation to create a new integration.\n */\nconst createIntegration = graphql(\n `\n mutation CreateIntegration(\n $applicationId: ID!\n $name: String!\n $integrationType: IntegrationType!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n ) {\n createIntegration(\n applicationId: $applicationId\n name: $name\n integrationType: $integrationType\n provider: $provider\n region: $region\n size: $size\n type: $type\n ) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Arguments required to create an integration tool.\n */\nexport type CreateIntegrationToolArgs = Omit<VariablesOf<typeof createIntegration>, \"applicationId\"> & {\n applicationUniqueName: string;\n};\n\n/**\n * Mutation to restart an integration.\n */\nconst restartIntegrationTool = graphql(\n `\n mutation RestartIntegrationTool($uniqueName: String!) {\n restartIntegrationByUniqueName(uniqueName: $uniqueName) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Mutation to pause an integration.\n */\nconst pauseIntegrationTool = graphql(\n `\n mutation PauseIntegrationTool($uniqueName: String!) {\n pauseIntegrationByUniqueName(uniqueName: $uniqueName) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Mutation to resume an integration.\n */\nconst resumeIntegrationTool = graphql(\n `\n mutation ResumeIntegrationTool($uniqueName: String!) {\n resumeIntegrationByUniqueName(uniqueName: $uniqueName) {\n ...Integration\n }\n }\n `,\n [IntegrationFragment],\n);\n\n/**\n * Creates a function to list integration tools for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches integration tools for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const integrationToolList = (\n gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<IntegrationTool[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n integrationsByUniqueName: { items },\n } = await gqlClient.request(getIntegrations, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single integration tool by unique name\n * @throws If the integration tool cannot be found or the request fails\n */\nexport const integrationToolRead = (\n gqlClient: GraphQLClient,\n): ((integrationUniqueName: string) => Promise<IntegrationTool>) => {\n return async (integrationUniqueName: string) => {\n const { integrationByUniqueName } = await gqlClient.request(getIntegration, { uniqueName: integrationUniqueName });\n return integrationByUniqueName;\n };\n};\n\n/**\n * Creates a function to create a new integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new integration tool with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const integrationToolCreate = (\n gqlClient: GraphQLClient,\n): ((args: CreateIntegrationToolArgs) => Promise<IntegrationTool>) => {\n return async (args: CreateIntegrationToolArgs) => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const { createIntegration: integration } = await gqlClient.request(createIntegration, {\n ...otherArgs,\n applicationId: application.id,\n });\n return integration;\n };\n};\n\n/**\n * Creates a function to restart an integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts integration tool by unique name\n * @throws If the integration tool cannot be found or the restart fails\n */\nexport const integrationToolRestart =\n (gqlClient: GraphQLClient) =>\n async (integrationUniqueName: string): Promise<IntegrationTool> => {\n const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, {\n uniqueName: integrationUniqueName,\n });\n return integration;\n };\n\n/**\n * Creates a function to pause an integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses integration tool by unique name\n * @throws If the integration tool cannot be found or the pause fails\n */\nexport const integrationToolPause =\n (gqlClient: GraphQLClient) =>\n async (integrationUniqueName: string): Promise<IntegrationTool> => {\n const { pauseIntegrationByUniqueName: integration } = await gqlClient.request(pauseIntegrationTool, {\n uniqueName: integrationUniqueName,\n });\n return integration;\n };\n\n/**\n * Creates a function to resume an integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes integration tool by unique name\n * @throws If the integration tool cannot be found or the resume fails\n */\nexport const integrationToolResume =\n (gqlClient: GraphQLClient) =>\n async (integrationUniqueName: string): Promise<IntegrationTool> => {\n const { resumeIntegrationByUniqueName: integration } = await gqlClient.request(resumeIntegrationTool, {\n uniqueName: integrationUniqueName,\n });\n return integration;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\n\n/**\n * GraphQL fragment containing core storage fields.\n */\nconst StorageFragment = graphql(`\n fragment Storage on Storage {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n storageProtocol\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n }\n`);\n\n/**\n * Type representing a storage entity.\n */\nexport type Storage = ResultOf<typeof StorageFragment>;\n\n/**\n * Query to fetch storages for an application.\n */\nconst getStorages = graphql(\n `\n query GetStorages($applicationUniqueName: String!) {\n storagesByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...Storage\n }\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Query to fetch a specific storage.\n */\nconst getStorage = graphql(\n `\n query GetStorage($uniqueName: String!) {\n storageByUniqueName(uniqueName: $uniqueName) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Mutation to create a new storage.\n */\nconst createStorage = graphql(\n `\n mutation CreateStorage(\n $applicationId: ID!\n $name: String!\n $storageProtocol: StorageProtocol!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n ) {\n createStorage(\n applicationId: $applicationId\n name: $name\n storageProtocol: $storageProtocol\n provider: $provider\n region: $region\n size: $size\n type: $type\n ) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Arguments required to create a storage.\n */\nexport type CreateStorageArgs = Omit<VariablesOf<typeof createStorage>, \"applicationId\"> & {\n applicationUniqueName: string;\n};\n\n/**\n * Mutation to restart a storage.\n */\nconst restartStorage = graphql(\n `\n mutation RestartStorage($uniqueName: String!) {\n restartStorageByUniqueName(uniqueName: $uniqueName) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Mutation to pause a storage.\n */\nconst pauseStorage = graphql(\n `\n mutation PauseStorage($uniqueName: String!) {\n pauseStorageByUniqueName(uniqueName: $uniqueName) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Mutation to resume a storage.\n */\nconst resumeStorage = graphql(\n `\n mutation ResumeStorage($uniqueName: String!) {\n resumeStorageByUniqueName(uniqueName: $uniqueName) {\n ...Storage\n }\n }\n `,\n [StorageFragment],\n);\n\n/**\n * Creates a function to list storages for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches storages for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const storageList = (gqlClient: GraphQLClient): ((applicationUniqueName: string) => Promise<Storage[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n storagesByUniqueName: { items },\n } = await gqlClient.request(getStorages, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single storage by unique name\n * @throws If the storage cannot be found or the request fails\n */\nexport const storageRead = (gqlClient: GraphQLClient): ((storageUniqueName: string) => Promise<Storage>) => {\n return async (storageUniqueName: string) => {\n const { storageByUniqueName: storage } = await gqlClient.request(getStorage, { uniqueName: storageUniqueName });\n return storage;\n };\n};\n\n/**\n * Creates a function to create a new storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new storage with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const storageCreate = (gqlClient: GraphQLClient): ((args: CreateStorageArgs) => Promise<Storage>) => {\n return async (args: CreateStorageArgs) => {\n const { applicationUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const { createStorage: storage } = await gqlClient.request(createStorage, {\n ...otherArgs,\n applicationId: application.id,\n });\n return storage;\n };\n};\n\n/**\n * Creates a function to restart a storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts storage by unique name\n * @throws If the storage cannot be found or the restart fails\n */\nexport const storageRestart =\n (gqlClient: GraphQLClient) =>\n async (storageUniqueName: string): Promise<Storage> => {\n const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, {\n uniqueName: storageUniqueName,\n });\n return storage;\n };\n\n/**\n * Creates a function to pause a storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses storage by unique name\n * @throws If the storage cannot be found or the pause fails\n */\nexport const storagePause =\n (gqlClient: GraphQLClient) =>\n async (storageUniqueName: string): Promise<Storage> => {\n const { pauseStorageByUniqueName: storage } = await gqlClient.request(pauseStorage, {\n uniqueName: storageUniqueName,\n });\n return storage;\n };\n\n/**\n * Creates a function to resume a storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes storage by unique name\n * @throws If the storage cannot be found or the resume fails\n */\nexport const storageResume =\n (gqlClient: GraphQLClient) =>\n async (storageUniqueName: string): Promise<Storage> => {\n const { resumeStorageByUniqueName: storage } = await gqlClient.request(resumeStorage, {\n uniqueName: storageUniqueName,\n });\n return storage;\n };\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { blockchainNodeRead } from \"./blockchain-node.js\";\nimport { loadBalancerRead } from \"./load-balancer.js\";\nimport { storageRead } from \"./storage.js\";\n\n/**\n * GraphQL fragment containing core middleware fields.\n */\nconst MiddlewareFragment = graphql(`\n fragment Middleware on Middleware {\n __typename\n id\n uniqueName\n name\n status\n healthStatus\n provider\n region\n interface\n entityVersion\n serviceUrl\n endpoints {\n id\n label\n displayValue\n }\n credentials {\n id\n label\n displayValue\n }\n ... on HAGraphMiddleware {\n specVersion\n }\n ... on HAGraphPostgresMiddleware {\n specVersion\n }\n }\n`);\n\nconst SubgraphFragment = graphql(`\n fragment Subgraph on Subgraph {\n name\n graphqlQueryEndpoint {\n displayValue\n id\n }\n }\n`);\n\n/**\n * Type representing a middleware entity.\n */\nexport type Middleware = ResultOf<typeof MiddlewareFragment>;\n\n/**\n * Query to fetch middlewares for an application.\n */\nconst getMiddlewares = graphql(\n `\n query GetMiddlewares($applicationUniqueName: String!) {\n middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...Middleware\n }\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Query to fetch a specific middleware.\n */\nconst getMiddleware = graphql(\n `\n query GetMiddleware($uniqueName: String!) {\n middlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Query to fetch a specific middleware with subgraphs.\n */\nconst getGraphMiddlewareSubgraphs = graphql(\n `\n query GetMiddleware($uniqueName: String!, $noCache: Boolean) {\n middlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n ... on HAGraphMiddleware {\n subgraphs(noCache: $noCache) {\n ...Subgraph\n }\n }\n ... on HAGraphPostgresMiddleware {\n subgraphs(noCache: $noCache) {\n ...Subgraph\n }\n }\n }\n }\n `,\n [MiddlewareFragment, SubgraphFragment],\n);\n\n/**\n * Type representing a middleware entity with subgraphs.\n */\nexport type MiddlewareWithSubgraphs = ResultOf<typeof getGraphMiddlewareSubgraphs>[\"middlewareByUniqueName\"];\n\n/**\n * Mutation to create a new middleware.\n */\nconst createMiddleware = graphql(\n `\n mutation CreateMiddleware(\n $applicationId: ID!\n $name: String!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $interface: MiddlewareType!\n $storageId: ID\n $blockchainNodeId: ID\n $loadBalancerId: ID\n $abis: [SmartContractPortalMiddlewareAbiInputDto!]\n $includePredeployedAbis: [String!]\n ) {\n createMiddleware(\n applicationId: $applicationId\n name: $name\n provider: $provider\n region: $region\n size: $size\n type: $type\n interface: $interface\n storageId: $storageId\n blockchainNodeId: $blockchainNodeId\n loadBalancerId: $loadBalancerId\n abis: $abis\n includePredeployedAbis: $includePredeployedAbis\n ) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Arguments required to create a middleware.\n */\nexport type CreateMiddlewareArgs = Omit<\n VariablesOf<typeof createMiddleware>,\n \"applicationId\" | \"blockchainNodeId\" | \"loadBalancerId\" | \"storageId\"\n> & {\n applicationUniqueName: string;\n blockchainNodeUniqueName?: string;\n loadBalancerUniqueName?: string;\n storageUniqueName?: string;\n};\n\n/**\n * Mutation to restart a middleware.\n */\nconst restartMiddleware = graphql(\n `\n mutation RestartMiddleware($uniqueName: String!) {\n restartMiddlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Mutation to pause a middleware.\n */\nconst pauseMiddleware = graphql(\n `\n mutation PauseMiddleware($uniqueName: String!) {\n pauseMiddlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Mutation to resume a middleware.\n */\nconst resumeMiddleware = graphql(\n `\n mutation ResumeMiddleware($uniqueName: String!) {\n resumeMiddlewareByUniqueName(uniqueName: $uniqueName) {\n ...Middleware\n }\n }\n `,\n [MiddlewareFragment],\n);\n\n/**\n * Creates a function to list middlewares for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches middlewares for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const middlewareList = (\n gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<Middleware[]>) => {\n return async (applicationUniqueName: string): Promise<Middleware[]> => {\n const {\n middlewaresByUniqueName: { items },\n } = await gqlClient.request(getMiddlewares, { applicationUniqueName });\n return items;\n };\n};\n\n/**\n * Creates a function to fetch a specific middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single middleware by unique name\n * @throws If the middleware cannot be found or the request fails\n */\nexport const middlewareRead = (gqlClient: GraphQLClient): ((middlewareUniqueName: string) => Promise<Middleware>) => {\n return async (middlewareUniqueName: string): Promise<Middleware> => {\n const { middlewareByUniqueName: middleware } = await gqlClient.request(getMiddleware, {\n uniqueName: middlewareUniqueName,\n });\n return middleware;\n };\n};\n\n/**\n * Creates a function to fetch a specific middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single middleware by unique name\n * @throws If the middleware cannot be found or the request fails\n */\nexport const graphMiddlewareSubgraphs = (\n gqlClient: GraphQLClient,\n): ((middlewareUniqueName: string, noCache?: boolean) => Promise<MiddlewareWithSubgraphs>) => {\n return async (middlewareUniqueName: string, noCache = false): Promise<MiddlewareWithSubgraphs> => {\n const { middlewareByUniqueName: middleware } = await gqlClient.request(getGraphMiddlewareSubgraphs, {\n uniqueName: middlewareUniqueName,\n noCache,\n });\n return middleware;\n };\n};\n\n/**\n * Creates a function to create a new middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new middleware with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const middlewareCreate = (gqlClient: GraphQLClient): ((args: CreateMiddlewareArgs) => Promise<Middleware>) => {\n return async (args: CreateMiddlewareArgs): Promise<Middleware> => {\n const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } =\n args;\n const [application, blockchainNode, loadBalancer, storage] = await Promise.all([\n applicationRead(gqlClient)(applicationUniqueName),\n blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(undefined),\n loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(undefined),\n storageUniqueName ? storageRead(gqlClient)(storageUniqueName) : Promise.resolve(undefined),\n ]);\n const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNodeId: blockchainNode?.id,\n loadBalancerId: loadBalancer?.id,\n storageId: storage?.id,\n });\n return middleware;\n };\n};\n\n/**\n * Creates a function to restart a middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts middleware by unique name\n * @throws If the middleware cannot be found or the restart fails\n */\nexport const middlewareRestart =\n (gqlClient: GraphQLClient) =>\n async (middlewareUniqueName: string): Promise<Middleware> => {\n const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, {\n uniqueName: middlewareUniqueName,\n });\n return middleware;\n };\n\n/**\n * Creates a function to pause a middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses middleware by unique name\n * @throws If the middleware cannot be found or the pause fails\n */\nexport const middlewarePause =\n (gqlClient: GraphQLClient) =>\n async (middlewareUniqueName: string): Promise<Middleware> => {\n const { pauseMiddlewareByUniqueName: middleware } = await gqlClient.request(pauseMiddleware, {\n uniqueName: middlewareUniqueName,\n });\n return middleware;\n };\n\n/**\n * Creates a function to resume a middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes middleware by unique name\n * @throws If the middleware cannot be found or the resume fails\n */\nexport const middlewareResume =\n (gqlClient: GraphQLClient) =>\n async (middlewareUniqueName: string): Promise<Middleware> => {\n const { resumeMiddlewareByUniqueName: middleware } = await gqlClient.request(resumeMiddleware, {\n uniqueName: middlewareUniqueName,\n });\n return middleware;\n };\n","import { type ResultOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * GraphQL query to fetch platform configuration.\n */\nconst getPlatformConfigQuery = graphql(\n `\n query platformConfig {\n config {\n smartContractSets {\n id\n sets {\n id\n name\n featureflagged\n image {\n repository\n tag\n registry\n }\n }\n }\n deploymentEngineTargets {\n id\n name\n disabled\n clusters {\n id\n name\n disabled\n }\n }\n preDeployedAbis {\n id\n featureflagged\n abis\n label\n }\n sdkVersion\n kits {\n id\n name\n description\n npmPackageName\n }\n }\n }\n `,\n [],\n);\n\n/**\n * Type representing the platform configuration.\n */\nexport type PlatformConfig = ResultOf<typeof getPlatformConfigQuery>[\"config\"];\n\n/**\n * Creates a function to fetch the platform configuration.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches the platform configuration\n * @throws If the request fails\n */\nexport const getPlatformConfig = (gqlClient: GraphQLClient) => {\n return async (): Promise<PlatformConfig> => {\n const { config } = await gqlClient.request(getPlatformConfigQuery);\n return config;\n };\n};\n","import type { GraphQLClient } from \"graphql-request\";\nimport { applicationRead } from \"@/graphql/application.js\";\nimport { graphql, type ResultOf, type VariablesOf } from \"@/helpers/graphql.js\";\nimport { blockchainNodeRead } from \"./blockchain-node.js\";\nimport { getPlatformConfig } from \"./platform.js\";\n\n/**\n * GraphQL fragment containing core private key fields.\n */\nconst PrivateKeyFragment = graphql(`\n fragment PrivateKey on PrivateKey {\n __typename\n id\n uniqueName\n name\n privateKeyType\n status\n healthStatus\n provider\n region\n address\n trustedForwarderName\n trustedForwarderAddress\n relayerKey {\n ... on PrivateKey {\n id\n name\n uniqueName\n }\n }\n blockchainNodes {\n ... on BlockchainNode {\n id\n name\n uniqueName\n }\n }\n }\n`);\n\n/**\n * Type representing a private key entity.\n */\nexport type PrivateKey = ResultOf<typeof PrivateKeyFragment>;\n\n/**\n * Query to fetch private keys for an application.\n */\nconst getPrivateKeys = graphql(\n `\n query GetPrivateKeys($applicationUniqueName: String!) {\n privateKeysByUniqueName(applicationUniqueName: $applicationUniqueName) {\n items {\n ...PrivateKey\n }\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Query to fetch a specific private key.\n */\nconst getPrivateKey = graphql(\n `\n query GetPrivateKey($uniqueName: String!) {\n privateKeyByUniqueName(uniqueName: $uniqueName) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Mutation to create a new private key.\n */\nconst createPrivateKey = graphql(\n `\n mutation CreatePrivateKey(\n $applicationId: ID!\n $name: String!\n $privateKeyType: PrivateKeyType!\n $provider: String!\n $region: String!\n $size: ClusterServiceSize\n $type: ClusterServiceType\n $blockchainNodes: [ID!]\n $trustedForwarderName: String\n $trustedForwarderAddress: String\n $relayerKey: ID\n ) {\n createPrivateKey(\n applicationId: $applicationId\n name: $name\n privateKeyType: $privateKeyType\n provider: $provider\n region: $region\n size: $size\n type: $type\n blockchainNodes: $blockchainNodes\n trustedForwarderName: $trustedForwarderName\n trustedForwarderAddress: $trustedForwarderAddress\n relayerKey: $relayerKey\n ) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Arguments required to create a private key.\n */\nexport type CreatePrivateKeyArgs = Omit<\n VariablesOf<typeof createPrivateKey>,\n \"applicationId\" | \"blockchainNodes\" | \"region\" | \"provider\" | \"size\" | \"type\" | \"relayerKey\"\n> & {\n applicationUniqueName: string;\n blockchainNodeUniqueNames?: string[];\n relayerKeyUniqueName?: string;\n};\n\n/**\n * Mutation to restart a private key.\n */\nconst restartPrivateKey = graphql(\n `\n mutation RestartPrivateKey($uniqueName: String!) {\n restartPrivateKeyByUniqueName(uniqueName: $uniqueName) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Mutation to pause a private key.\n */\nconst pausePrivateKey = graphql(\n `\n mutation PausePrivateKey($uniqueName: String!) {\n pausePrivateKeyByUniqueName(uniqueName: $uniqueName) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Mutation to resume a private key.\n */\nconst resumePrivateKey = graphql(\n `\n mutation ResumePrivateKey($uniqueName: String!) {\n resumePrivateKeyByUniqueName(uniqueName: $uniqueName) {\n ...PrivateKey\n }\n }\n `,\n [PrivateKeyFragment],\n);\n\n/**\n * Creates a function to list private keys for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches private keys for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const privateKeyList = (\n gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<PrivateKey[]>) => {\n return async (applicationUniqueName: string) => {\n const {\n privateKeysByUniqueName: { items },\n } = await gqlClient.request(getPrivateKeys, { applicationUniqueName });\n return items as PrivateKey[];\n };\n};\n\n/**\n * Creates a function to fetch a specific private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single private key by unique name\n * @throws If the private key cannot be found or the request fails\n */\nexport const privatekeyRead = (gqlClient: GraphQLClient): ((privateKeyUniqueName: string) => Promise<PrivateKey>) => {\n return async (privateKeyUniqueName: string) => {\n const { privateKeyByUniqueName: privateKey } = await gqlClient.request(getPrivateKey, {\n uniqueName: privateKeyUniqueName,\n });\n return privateKey as PrivateKey;\n };\n};\n\n/**\n * Creates a function to create a new private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new private key with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const privateKeyCreate = (gqlClient: GraphQLClient): ((args: CreatePrivateKeyArgs) => Promise<PrivateKey>) => {\n return async (args: CreatePrivateKeyArgs) => {\n const { applicationUniqueName, blockchainNodeUniqueNames, relayerKeyUniqueName, ...otherArgs } = args;\n const application = await applicationRead(gqlClient)(applicationUniqueName);\n const blockchainNodes = blockchainNodeUniqueNames\n ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName)))\n : [];\n const relayerKey = relayerKeyUniqueName ? await privatekeyRead(gqlClient)(relayerKeyUniqueName) : undefined;\n const platformConfig = await getPlatformConfig(gqlClient)();\n const defaultProvider = platformConfig.deploymentEngineTargets.find(\n (target) => !target.disabled && target.clusters.some((cluster) => !cluster.disabled),\n );\n const defaultRegion = defaultProvider?.clusters.find((cluster) => !cluster.disabled);\n const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, {\n ...otherArgs,\n applicationId: application.id,\n blockchainNodes: blockchainNodes.map((node) => node?.id),\n relayerKey: relayerKey?.id,\n provider: defaultProvider?.id ?? \"gke\",\n region: defaultRegion?.id?.split(\"-\")[1] ?? \"europe\",\n size: \"SMALL\",\n type: \"SHARED\",\n });\n return privateKey;\n };\n};\n\n/**\n * Creates a function to restart a private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts private key by unique name\n * @throws If the private key cannot be found or the restart fails\n */\nexport const privateKeyRestart =\n (gqlClient: GraphQLClient) =>\n async (privateKeyUniqueName: string): Promise<PrivateKey> => {\n const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, {\n uniqueName: privateKeyUniqueName,\n });\n return privateKey as PrivateKey;\n };\n\n/**\n * Creates a function to pause a private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that pauses private key by unique name\n * @throws If the private key cannot be found or the pause fails\n */\nexport const privateKeyPause =\n (gqlClient: GraphQLClient) =>\n async (privateKeyUniqueName: string): Promise<PrivateKey> => {\n const { pausePrivateKeyByUniqueName: privateKey } = await gqlClient.request(pausePrivateKey, {\n uniqueName: privateKeyUniqueName,\n });\n return privateKey as PrivateKey;\n };\n\n/**\n * Creates a function to resume a private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that resumes private key by unique name\n * @throws If the private key cannot be found or the resume fails\n */\nexport const privateKeyResume =\n (gqlClient: GraphQLClient) =>\n async (privateKeyUniqueName: string): Promise<PrivateKey> => {\n const { resumePrivateKeyByUniqueName: privateKey } = await gqlClient.request(resumePrivateKey, {\n uniqueName: privateKeyUniqueName,\n });\n return privateKey as PrivateKey;\n };\n","import { AccessTokenSchema, UrlSchema } from \"@settlemint/sdk-utils/validation\";\nimport { z } from \"zod\";\n\n/**\n * Schema for validating SettleMint client options.\n */\nexport const ClientOptionsSchema = z.object({\n /** The access token used to authenticate with the SettleMint platform */\n accessToken: AccessTokenSchema,\n /** The URL of the SettleMint instance to connect to */\n instance: UrlSchema,\n});\n\n/**\n * Type definition for SettleMint client options, inferred from ClientOptionsSchema.\n */\nexport type ClientOptions = z.infer<typeof ClientOptionsSchema>;\n","import { createHash } from \"node:crypto\";\n\nfunction hashPincode(pincode: string, salt: string): string {\n return createHash(\"sha256\").update(`${salt}${pincode}`).digest(\"hex\");\n}\n\nfunction generateResponse(pincode: string, salt: string, challenge: string): string {\n const hashedPincode = hashPincode(pincode, salt);\n return createHash(\"sha256\").update(`${hashedPincode}_${challenge}`).digest(\"hex\");\n}\n\nexport interface PincodeVerificationChallengesArgs {\n userWalletAddress: string;\n accessToken: string;\n instance: string;\n nodeId: string;\n}\n\nexport interface PincodeVerificationChallengeResponseArgs {\n verificationChallenge: VerificationChallenge;\n pincode: string;\n}\n\nexport interface VerificationChallenge {\n name: string;\n challenge: {\n secret: string;\n salt: string;\n };\n}\n\n/**\n * Get the pincode verification challenges for a user wallet address.\n * @param userWalletAddress - The user's wallet address.\n * @param accessToken - The user's access token.\n * @param instance - The instance URL.\n * @param nodeId - The node ID.\n * @returns The pincode verification challenges.\n */\nexport async function getPincodeVerificationChallenges({\n userWalletAddress,\n accessToken,\n instance,\n nodeId,\n}: PincodeVerificationChallengesArgs) {\n const response = await fetch(\n `${instance}/cm/nodes/${encodeURIComponent(nodeId)}/user-wallets/${encodeURIComponent(userWalletAddress)}/verifications/challenges?type=PINCODE`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-auth-token\": accessToken,\n },\n },\n );\n\n if (!response.ok) {\n if (response.status === 404) {\n throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);\n }\n throw new Error(\"Failed to get verification challenge\");\n }\n\n const verificationChallenges: VerificationChallenge[] = await response.json();\n return verificationChallenges;\n}\n\n/**\n * Get the pincode verification challenge response for a user wallet address.\n * @param verificationChallenge - The verification challenge.\n * @param pincode - The user's pincode.\n * @returns The pincode verification challenge response.\n */\nexport function getPincodeVerificationChallengeResponse({\n verificationChallenge,\n pincode,\n}: PincodeVerificationChallengeResponseArgs) {\n if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt) {\n throw new Error(\"Could not authenticate pin code, invalid challenge format\");\n }\n\n const { secret, salt } = verificationChallenge.challenge;\n return generateResponse(pincode, salt, secret);\n}\n","import { fetchWithRetry } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { type Id, LOCAL_INSTANCE, STANDALONE_INSTANCE, validate } from \"@settlemint/sdk-utils/validation\";\nimport { GraphQLClient } from \"graphql-request\";\nimport { z } from \"zod\";\nimport {\n type Application,\n applicationCreate,\n applicationDelete,\n applicationList,\n applicationRead,\n type CreateApplicationArgs,\n} from \"./graphql/application.js\";\nimport {\n applicationAccessTokenCreate,\n type CreateApplicationAccessTokenArgs,\n} from \"./graphql/application-access-tokens.js\";\nimport {\n type BlockchainNetwork,\n blockchainNetworkCreate,\n blockchainNetworkDelete,\n blockchainNetworkList,\n blockchainNetworkPause,\n blockchainNetworkRead,\n blockchainNetworkRestart,\n blockchainNetworkResume,\n type CreateBlockchainNetworkArgs,\n} from \"./graphql/blockchain-network.js\";\nimport {\n type BlockchainNode,\n blockchainNodeCreate,\n blockchainNodeList,\n blockchainNodePause,\n blockchainNodeRead,\n blockchainNodeRestart,\n blockchainNodeResume,\n type CreateBlockchainNodeArgs,\n} from \"./graphql/blockchain-node.js\";\nimport {\n type CreateCustomDeploymentArgs,\n type CustomDeployment,\n customDeploymentPause,\n customDeploymentRestart,\n customDeploymentResume,\n customdeploymentCreate,\n customdeploymentList,\n customdeploymentRead,\n customdeploymentUpdate,\n} from \"./graphql/custom-deployment.js\";\nimport { getEnv } from \"./graphql/foundry.js\";\nimport {\n type CreateInsightsArgs,\n type Insights,\n insightsCreate,\n insightsList,\n insightsPause,\n insightsRead,\n insightsRestart,\n insightsResume,\n} from \"./graphql/insights.js\";\nimport {\n type CreateIntegrationToolArgs,\n type IntegrationTool,\n integrationToolCreate,\n integrationToolList,\n integrationToolPause,\n integrationToolRead,\n integrationToolRestart,\n integrationToolResume,\n} from \"./graphql/integration-tool.js\";\nimport {\n type CreateLoadBalancerArgs,\n type LoadBalancer,\n loadBalancerCreate,\n loadBalancerList,\n loadBalancerPause,\n loadBalancerRead,\n loadBalancerRestart,\n loadBalancerResume,\n} from \"./graphql/load-balancer.js\";\nimport {\n type CreateMiddlewareArgs,\n graphMiddlewareSubgraphs,\n type Middleware,\n type MiddlewareWithSubgraphs,\n middlewareCreate,\n middlewareList,\n middlewarePause,\n middlewareRead,\n middlewareRestart,\n middlewareResume,\n} from \"./graphql/middleware.js\";\nimport { getPlatformConfig, type PlatformConfig } from \"./graphql/platform.js\";\nimport {\n type CreatePrivateKeyArgs,\n type PrivateKey,\n privateKeyCreate,\n privateKeyList,\n privateKeyPause,\n privateKeyRestart,\n privateKeyResume,\n privatekeyRead,\n} from \"./graphql/private-key.js\";\nimport {\n type CreateStorageArgs,\n type Storage,\n storageCreate,\n storageList,\n storagePause,\n storageRead,\n storageRestart,\n storageResume,\n} from \"./graphql/storage.js\";\nimport {\n type CreateWorkspaceArgs,\n type Workspace,\n workspaceAddCredits,\n workspaceCreate,\n workspaceDelete,\n workspaceList,\n workspaceRead,\n} from \"./graphql/workspace.js\";\nimport { type ClientOptions, ClientOptionsSchema } from \"./helpers/client-options.schema.js\";\nimport {\n getPincodeVerificationChallengeResponse,\n getPincodeVerificationChallenges,\n type PincodeVerificationChallengeResponseArgs,\n type PincodeVerificationChallengesArgs,\n type VerificationChallenge,\n} from \"./pincode-verification.js\";\n\n/**\n * Options for the Settlemint client.\n */\nexport interface SettlemintClientOptions extends Omit<ClientOptions, \"accessToken\"> {\n /** The access token used to authenticate with the SettleMint platform */\n accessToken?: string;\n /** Whether to allow anonymous access (no access token required) */\n anonymous?: boolean;\n}\n\n/**\n * Client interface for interacting with the SettleMint platform.\n */\nexport interface SettlemintClient {\n workspace: {\n list: () => Promise<Workspace[]>;\n read: (workspaceUniqueName: string) => Promise<Workspace>;\n create: (args: CreateWorkspaceArgs) => Promise<Workspace>;\n delete: (workspaceUniqueName: string) => Promise<Workspace>;\n addCredits: (workspaceId: Id, amount: number) => Promise<boolean>;\n };\n application: {\n list: (workspaceUniqueName: string) => Promise<Application[]>;\n read: (applicationUniqueName: string) => Promise<Application>;\n create: (args: CreateApplicationArgs) => Promise<Application>;\n delete: (applicationId: Id) => Promise<Application>;\n };\n blockchainNetwork: {\n list: (applicationUniqueName: string) => Promise<BlockchainNetwork[]>;\n read: (blockchainNetworkUniqueName: string) => Promise<BlockchainNetwork>;\n create: (args: CreateBlockchainNetworkArgs) => Promise<BlockchainNetwork>;\n delete: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n restart: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n pause: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n resume: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n };\n blockchainNode: {\n list: (applicationUniqueName: string) => Promise<BlockchainNode[]>;\n read: (blockchainNodeUniqueName: string) => Promise<BlockchainNode>;\n create: (args: CreateBlockchainNodeArgs) => Promise<BlockchainNode>;\n restart: (nodeUniqueName: string) => Promise<BlockchainNode>;\n pause: (nodeUniqueName: string) => Promise<BlockchainNode>;\n resume: (nodeUniqueName: string) => Promise<BlockchainNode>;\n };\n loadBalancer: {\n list: (applicationUniqueName: string) => Promise<LoadBalancer[]>;\n read: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n create: (args: CreateLoadBalancerArgs) => Promise<LoadBalancer>;\n restart: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n pause: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n resume: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n };\n middleware: {\n list: (applicationUniqueName: string) => Promise<Middleware[]>;\n read: (middlewareUniqueName: string) => Promise<Middleware>;\n graphSubgraphs: (middlewareUniqueName: string, noCache?: boolean) => Promise<MiddlewareWithSubgraphs>;\n create: (args: CreateMiddlewareArgs) => Promise<Middleware>;\n restart: (middlewareUniqueName: string) => Promise<Middleware>;\n pause: (middlewareUniqueName: string) => Promise<Middleware>;\n resume: (middlewareUniqueName: string) => Promise<Middleware>;\n };\n integrationTool: {\n list: (applicationUniqueName: string) => Promise<IntegrationTool[]>;\n read: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n create: (args: CreateIntegrationToolArgs) => Promise<IntegrationTool>;\n restart: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n pause: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n resume: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n };\n storage: {\n list: (applicationUniqueName: string) => Promise<Storage[]>;\n read: (storageUniqueName: string) => Promise<Storage>;\n create: (args: CreateStorageArgs) => Promise<Storage>;\n restart: (storageUniqueName: string) => Promise<Storage>;\n pause: (storageUniqueName: string) => Promise<Storage>;\n resume: (storageUniqueName: string) => Promise<Storage>;\n };\n privateKey: {\n list: (applicationUniqueName: string) => Promise<PrivateKey[]>;\n read: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n create: (args: CreatePrivateKeyArgs) => Promise<PrivateKey>;\n restart: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n pause: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n resume: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n };\n insights: {\n list: (applicationUniqueName: string) => Promise<Insights[]>;\n read: (insightsUniqueName: string) => Promise<Insights>;\n create: (args: CreateInsightsArgs) => Promise<Insights>;\n restart: (insightsUniqueName: string) => Promise<Insights>;\n pause: (insightsUniqueName: string) => Promise<Insights>;\n resume: (insightsUniqueName: string) => Promise<Insights>;\n };\n customDeployment: {\n list: (applicationUniqueName: string) => Promise<CustomDeployment[]>;\n read: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n create: (args: CreateCustomDeploymentArgs) => Promise<CustomDeployment>;\n update: (customDeploymentUniqueName: string, imageTag: string) => Promise<CustomDeployment>;\n restart: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n pause: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n resume: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n };\n foundry: {\n env: (blockchainNodeUniqueName: string) => Promise<Record<string, string>>;\n };\n applicationAccessToken: {\n create: (args: CreateApplicationAccessTokenArgs) => Promise<string>;\n };\n platform: {\n config: () => Promise<PlatformConfig>;\n };\n wallet: {\n pincodeVerificationChallengeResponse: (args: PincodeVerificationChallengeResponseArgs) => string;\n pincodeVerificationChallenges: (\n args: Omit<PincodeVerificationChallengesArgs, \"instance\" | \"accessToken\">,\n ) => Promise<VerificationChallenge[]>;\n };\n}\n\n/**\n * Creates a SettleMint client with the provided options. The client provides methods to interact with\n * various SettleMint resources like workspaces, applications, blockchain networks, blockchain nodes, middleware,\n * integration tools, storage, private keys, insights and custom deployments.\n *\n * @param {ClientOptions} options - Configuration options for the client including access token and instance URL\n * @returns {SettlemintClient} A SettleMint client object with resource-specific methods\n * @throws {Error} If options are invalid or if called in browser environment\n * @throws {ValidationError} If provided options fail schema validation\n *\n * @example\n * import { createSettleMintClient } from '@settlemint/sdk-js';\n *\n * const client = createSettleMintClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * instance: process.env.SETTLEMINT_INSTANCE,\n * });\n *\n * // List workspaces\n * const workspaces = await client.workspace.list();\n *\n * // Read a specific workspace\n * const workspace = await client.workspace.read('workspace-unique-name');\n */\nexport function createSettleMintClient(options: SettlemintClientOptions): SettlemintClient {\n ensureServer();\n\n if (options.instance === STANDALONE_INSTANCE || options.instance === LOCAL_INSTANCE) {\n if (options.anonymous) {\n // Fallback to the public instance for anonymous access\n // Anonymous use does not interact with platform services, only used for bootstrapping new projects using SettleMint templates\n options.instance = \"https://console.settlemint.com\";\n } else {\n throw new Error(\"Standalone and local instances cannot connect to the SettleMint platform\");\n }\n }\n\n const validatedOptions = options.anonymous\n ? validate(\n z.object({\n ...ClientOptionsSchema.shape,\n accessToken: z.literal(\"\"),\n }),\n options,\n )\n : validate(ClientOptionsSchema, options);\n\n const baseUrl = new URL(validatedOptions.instance).toString().replace(/\\/$/, \"\");\n const gqlClient = new GraphQLClient(`${baseUrl}/api/graphql`, {\n headers: {\n \"x-auth-token\": validatedOptions.accessToken ?? \"\",\n },\n fetch: (async (input: RequestInfo | URL, init?: RequestInit) => {\n const response = await fetchWithRetry(input, init);\n // Parse and handle GraphQL errors from response\n const contentType = response.headers.get(\"content-type\");\n if (contentType?.includes(\"application/json\") || contentType?.includes(\"application/graphql-response+json\")) {\n const data: { errors: { message: string }[] } = await response.clone().json();\n if (data.errors?.length > 0) {\n const errorMessages = data.errors.map((e) => e.message).join(\", \");\n throw new Error(errorMessages);\n }\n }\n return response;\n }) as typeof fetch,\n });\n\n return {\n workspace: {\n list: workspaceList(gqlClient),\n read: workspaceRead(gqlClient),\n create: workspaceCreate(gqlClient),\n delete: workspaceDelete(gqlClient),\n addCredits: workspaceAddCredits(gqlClient),\n },\n application: {\n list: applicationList(gqlClient),\n read: applicationRead(gqlClient),\n create: applicationCreate(gqlClient),\n delete: applicationDelete(gqlClient),\n },\n blockchainNetwork: {\n list: blockchainNetworkList(gqlClient),\n read: blockchainNetworkRead(gqlClient),\n create: blockchainNetworkCreate(gqlClient),\n delete: blockchainNetworkDelete(gqlClient),\n restart: blockchainNetworkRestart(gqlClient),\n pause: blockchainNetworkPause(gqlClient),\n resume: blockchainNetworkResume(gqlClient),\n },\n blockchainNode: {\n list: blockchainNodeList(gqlClient),\n read: blockchainNodeRead(gqlClient),\n create: blockchainNodeCreate(gqlClient),\n restart: blockchainNodeRestart(gqlClient),\n pause: blockchainNodePause(gqlClient),\n resume: blockchainNodeResume(gqlClient),\n },\n loadBalancer: {\n list: loadBalancerList(gqlClient),\n read: loadBalancerRead(gqlClient),\n create: loadBalancerCreate(gqlClient),\n restart: loadBalancerRestart(gqlClient),\n pause: loadBalancerPause(gqlClient),\n resume: loadBalancerResume(gqlClient),\n },\n middleware: {\n list: middlewareList(gqlClient),\n read: middlewareRead(gqlClient),\n graphSubgraphs: graphMiddlewareSubgraphs(gqlClient),\n create: middlewareCreate(gqlClient),\n restart: middlewareRestart(gqlClient),\n pause: middlewarePause(gqlClient),\n resume: middlewareResume(gqlClient),\n },\n integrationTool: {\n list: integrationToolList(gqlClient),\n read: integrationToolRead(gqlClient),\n create: integrationToolCreate(gqlClient),\n restart: integrationToolRestart(gqlClient),\n pause: integrationToolPause(gqlClient),\n resume: integrationToolResume(gqlClient),\n },\n storage: {\n list: storageList(gqlClient),\n read: storageRead(gqlClient),\n create: storageCreate(gqlClient),\n restart: storageRestart(gqlClient),\n pause: storagePause(gqlClient),\n resume: storageResume(gqlClient),\n },\n privateKey: {\n list: privateKeyList(gqlClient),\n read: privatekeyRead(gqlClient),\n create: privateKeyCreate(gqlClient),\n restart: privateKeyRestart(gqlClient),\n pause: privateKeyPause(gqlClient),\n resume: privateKeyResume(gqlClient),\n },\n insights: {\n list: insightsList(gqlClient),\n read: insightsRead(gqlClient),\n create: insightsCreate(gqlClient),\n restart: insightsRestart(gqlClient),\n pause: insightsPause(gqlClient),\n resume: insightsResume(gqlClient),\n },\n customDeployment: {\n list: customdeploymentList(gqlClient),\n read: customdeploymentRead(gqlClient),\n create: customdeploymentCreate(gqlClient),\n update: customdeploymentUpdate(gqlClient),\n restart: customDeploymentRestart(gqlClient),\n pause: customDeploymentPause(gqlClient),\n resume: customDeploymentResume(gqlClient),\n },\n foundry: {\n env: getEnv(gqlClient),\n },\n applicationAccessToken: {\n create: applicationAccessTokenCreate(gqlClient),\n },\n platform: {\n config: getPlatformConfig(gqlClient),\n },\n wallet: {\n pincodeVerificationChallengeResponse: getPincodeVerificationChallengeResponse,\n pincodeVerificationChallenges: (args) =>\n getPincodeVerificationChallenges({\n ...args,\n instance: validatedOptions.instance,\n accessToken: validatedOptions.accessToken,\n }),\n },\n };\n}\n\nexport type { Application } from \"./graphql/application.js\";\nexport type { BlockchainNetwork } from \"./graphql/blockchain-network.js\";\nexport type { BlockchainNode } from \"./graphql/blockchain-node.js\";\nexport type { CustomDeployment } from \"./graphql/custom-deployment.js\";\nexport type { Insights } from \"./graphql/insights.js\";\nexport type { IntegrationTool } from \"./graphql/integration-tool.js\";\nexport type { LoadBalancer } from \"./graphql/load-balancer.js\";\nexport type { Middleware, MiddlewareWithSubgraphs } from \"./graphql/middleware.js\";\nexport type { PlatformConfig } from \"./graphql/platform.js\";\nexport type { PrivateKey } from \"./graphql/private-key.js\";\nexport type { Storage } from \"./graphql/storage.js\";\nexport type { Workspace } from \"./graphql/workspace.js\";\nexport type { VerificationChallenge } from \"./pincode-verification.js\";\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAaA,UAYR,iBAYD;;;;;;;AC9BJ,MAAM,oBAAoB,QACxB;;;;;;;;;;;IAYD;;;;AAUD,MAAM,+BAA+B,QACnC;;;;;;;;;KAUA,CAAC,kBAAkB,CACpB;;;;AAKD,MAAM,eAAe,QACnB;;;;;;KAOA,CAAC,kBAAkB,CACpB;;;;AAKD,MAAM,kBAAkB,QACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BA,CAAC,kBAAkB,CACpB;;;;AAOD,MAAM,kBAAkB,QACtB;;;;;;KAOA,CAAC,kBAAkB,CACpB;;;;AAKD,MAAM,aAAa,QACjB;;;;IAKD;;;;;;;;AASD,MAAa,iBAAiB,cAA2D;AACvF,QAAO,YAAY;EACjB,MAAM,EAAE,eAAe,MAAM,UAAU,QAAQ,6BAA6B;EAC5E,MAAM,gBAAgB,WAAW,QAAqB,KAAK,cAAc;AACvE,OAAI,KAAK,UAAU;AACnB,OAAI,UAAU,iBAAiB;AAC7B,QAAI,KAAK,GAAG,UAAU,gBAAgB;;AAExC,UAAO;KACN,EAAE,CAAC;AACN,SAAO,cAAc,MAAM,GAAG,MAAM,EAAE,KAAK,cAAc,EAAE,KAAK,CAAC;;;;;;;;;;AAWrE,MAAa,iBAAiB,cAAoF;AAChH,QAAO,OAAO,wBAAgC;EAC5C,MAAM,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