chore: add update graphql generated code
parent
23b0935fb1
commit
fee262be11
|
|
@ -1,10 +1,8 @@
|
|||
import { Metadata } from "next"
|
||||
import Image from "next/image"
|
||||
import Link from "next/link"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { buttonVariants } from "@/components/ui/button"
|
||||
import { UserAuthForm } from "./components/user-auth-form"
|
||||
import { useGraphQL } from "@/lib/hooks/use-graphql"
|
||||
import { getIsAdminInitialized } from "@/lib/gql/request-documents"
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Authentication",
|
||||
|
|
@ -14,17 +12,17 @@ export const metadata: Metadata = {
|
|||
export default function AuthenticationPage() {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center flex-1">
|
||||
<div className="space-y-6 w-[350px]">
|
||||
<div className="flex flex-col space-y-2 text-center">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">
|
||||
Create an account
|
||||
</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Enter your credentials below to create admin account
|
||||
</p>
|
||||
</div>
|
||||
<UserAuthForm />
|
||||
<div className="space-y-6 w-[350px]">
|
||||
<div className="flex flex-col space-y-2 text-center">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">
|
||||
Create an account
|
||||
</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Enter your credentials below to create admin account
|
||||
</p>
|
||||
</div>
|
||||
<UserAuthForm />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import { fontMono, fontSans } from '@/lib/fonts'
|
|||
import { cn } from '@/lib/utils'
|
||||
import { TailwindIndicator } from '@/components/tailwind-indicator'
|
||||
import { Providers } from '@/components/providers'
|
||||
import { Header } from '@/components/header'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ const documents = {
|
|||
'\n query GetWorkers {\n workers {\n kind\n name\n addr\n device\n arch\n cpuInfo\n cpuCount\n cudaDevices\n }\n }\n':
|
||||
types.GetWorkersDocument,
|
||||
'\n query GetRegistrationToken {\n registrationToken\n }\n':
|
||||
types.GetRegistrationTokenDocument
|
||||
types.GetRegistrationTokenDocument,
|
||||
'\n query GetIsAdminInitialized {\n isAdminInitialized\n }\n':
|
||||
types.GetIsAdminInitializedDocument
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -45,6 +47,12 @@ export function graphql(
|
|||
export function graphql(
|
||||
source: '\n query GetRegistrationToken {\n registrationToken\n }\n'
|
||||
): (typeof documents)['\n query GetRegistrationToken {\n registrationToken\n }\n']
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(
|
||||
source: '\n query GetIsAdminInitialized {\n isAdminInitialized\n }\n'
|
||||
): (typeof documents)['\n query GetIsAdminInitialized {\n isAdminInitialized\n }\n']
|
||||
|
||||
export function graphql(source: string) {
|
||||
return (documents as any)[source] ?? {}
|
||||
|
|
|
|||
|
|
@ -29,17 +29,87 @@ export type Scalars = {
|
|||
Float: { input: number; output: number }
|
||||
}
|
||||
|
||||
export type Claims = {
|
||||
__typename?: 'Claims'
|
||||
exp: Scalars['Float']['output']
|
||||
iat: Scalars['Float']['output']
|
||||
user: UserInfo
|
||||
}
|
||||
|
||||
export type Invitation = {
|
||||
__typename?: 'Invitation'
|
||||
code: Scalars['String']['output']
|
||||
createdAt: Scalars['String']['output']
|
||||
email: Scalars['String']['output']
|
||||
id: Scalars['Int']['output']
|
||||
}
|
||||
|
||||
export type Mutation = {
|
||||
__typename?: 'Mutation'
|
||||
createInvitation: Scalars['Int']['output']
|
||||
deleteInvitation: Scalars['Int']['output']
|
||||
register: RegisterResponse
|
||||
resetRegistrationToken: Scalars['String']['output']
|
||||
tokenAuth: TokenAuthResponse
|
||||
verifyToken: VerifyTokenResponse
|
||||
}
|
||||
|
||||
export type MutationCreateInvitationArgs = {
|
||||
email: Scalars['String']['input']
|
||||
}
|
||||
|
||||
export type MutationDeleteInvitationArgs = {
|
||||
id: Scalars['Int']['input']
|
||||
}
|
||||
|
||||
export type MutationRegisterArgs = {
|
||||
email: Scalars['String']['input']
|
||||
invitationCode?: InputMaybe<Scalars['String']['input']>
|
||||
password1: Scalars['String']['input']
|
||||
password2: Scalars['String']['input']
|
||||
}
|
||||
|
||||
export type MutationTokenAuthArgs = {
|
||||
email: Scalars['String']['input']
|
||||
password: Scalars['String']['input']
|
||||
}
|
||||
|
||||
export type MutationVerifyTokenArgs = {
|
||||
token: Scalars['String']['input']
|
||||
}
|
||||
|
||||
export type Query = {
|
||||
__typename?: 'Query'
|
||||
invitations: Array<Invitation>
|
||||
isAdminInitialized: Scalars['Boolean']['output']
|
||||
me: UserInfo
|
||||
registrationToken: Scalars['String']['output']
|
||||
workers: Array<Worker>
|
||||
}
|
||||
|
||||
export type RegisterResponse = {
|
||||
__typename?: 'RegisterResponse'
|
||||
accessToken: Scalars['String']['output']
|
||||
refreshToken: Scalars['String']['output']
|
||||
}
|
||||
|
||||
export type TokenAuthResponse = {
|
||||
__typename?: 'TokenAuthResponse'
|
||||
accessToken: Scalars['String']['output']
|
||||
refreshToken: Scalars['String']['output']
|
||||
}
|
||||
|
||||
export type UserInfo = {
|
||||
__typename?: 'UserInfo'
|
||||
email: Scalars['String']['output']
|
||||
isAdmin: Scalars['Boolean']['output']
|
||||
}
|
||||
|
||||
export type VerifyTokenResponse = {
|
||||
__typename?: 'VerifyTokenResponse'
|
||||
claims: Claims
|
||||
}
|
||||
|
||||
export type Worker = {
|
||||
__typename?: 'Worker'
|
||||
addr: Scalars['String']['output']
|
||||
|
|
@ -81,6 +151,15 @@ export type GetRegistrationTokenQuery = {
|
|||
registrationToken: string
|
||||
}
|
||||
|
||||
export type GetIsAdminInitializedQueryVariables = Exact<{
|
||||
[key: string]: never
|
||||
}>
|
||||
|
||||
export type GetIsAdminInitializedQuery = {
|
||||
__typename?: 'Query'
|
||||
isAdminInitialized: boolean
|
||||
}
|
||||
|
||||
export const GetWorkersDocument = {
|
||||
kind: 'Document',
|
||||
definitions: [
|
||||
|
|
@ -132,3 +211,22 @@ export const GetRegistrationTokenDocument = {
|
|||
GetRegistrationTokenQuery,
|
||||
GetRegistrationTokenQueryVariables
|
||||
>
|
||||
export const GetIsAdminInitializedDocument = {
|
||||
kind: 'Document',
|
||||
definitions: [
|
||||
{
|
||||
kind: 'OperationDefinition',
|
||||
operation: 'query',
|
||||
name: { kind: 'Name', value: 'GetIsAdminInitialized' },
|
||||
selectionSet: {
|
||||
kind: 'SelectionSet',
|
||||
selections: [
|
||||
{ kind: 'Field', name: { kind: 'Name', value: 'isAdminInitialized' } }
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
} as unknown as DocumentNode<
|
||||
GetIsAdminInitializedQuery,
|
||||
GetIsAdminInitializedQueryVariables
|
||||
>
|
||||
|
|
|
|||
|
|
@ -20,3 +20,9 @@ export const getRegistrationTokenDocument = graphql(/* GraphQL */ `
|
|||
registrationToken
|
||||
}
|
||||
`)
|
||||
|
||||
export const getIsAdminInitialized = graphql(/* GraphQL */ `
|
||||
query GetIsAdminInitialized {
|
||||
isAdminInitialized
|
||||
}
|
||||
`)
|
||||
|
|
|
|||
Loading…
Reference in New Issue