Skip to content

Commit

Permalink
✨ Added some cli queries
Browse files Browse the repository at this point in the history
  • Loading branch information
abdheshnayak committed Jan 1, 2024
1 parent 9193fd6 commit ab0ca70
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions src/apps/auth/server/gql/cli-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,90 @@ import {
} from '~/root/src/generated/gql/server';

export const cliQueries = (executor: IExecutor) => ({
cli_listDevices: executor(
gql`
query Infra_listVPNDevices(
$pq: CursorPaginationIn
$clusterName: String
) {
infra_listVPNDevices(pq: $pq, clusterName: $clusterName) {
edges {
node {
displayName
markedForDeletion
metadata {
name
namespace
}
spec {
cnameRecords {
host
target
}
deviceNamespace
ports {
port
targetPort
}
}
status {
isReady
message {
RawMessage
}
}
}
}
}
}
`,
{
transformer: (data: any) => data.infra_listVPNDevices,
vars: (_: any) => {},
}
),

cli_getDevice: executor(
gql`
query Infra_getVPNDevice($clusterName: String!, $name: String!) {
infra_getVPNDevice(clusterName: $clusterName, name: $name) {
displayName
markedForDeletion
metadata {
name
namespace
}
spec {
cnameRecords {
host
target
}
deviceNamespace
nodeSelector
ports {
port
targetPort
}
}
status {
isReady
message {
RawMessage
}
}
wireguardConfig {
encoding
value
}
}
}
`,
{
transformer: (data: any) => data.infra_getVPNDevice,
vars: (_: any) => {},
}
),

cli_listEnvironments: executor(
gql`
query Core_listProjects($project: ProjectId!, $pq: CursorPaginationIn) {
Expand Down

0 comments on commit ab0ca70

Please sign in to comment.