chore: add update graphql generated code
parent
23b0935fb1
commit
fee262be11
|
|
@ -1,10 +1,8 @@
|
||||||
import { Metadata } from "next"
|
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 { UserAuthForm } from "./components/user-auth-form"
|
||||||
|
import { useGraphQL } from "@/lib/hooks/use-graphql"
|
||||||
|
import { getIsAdminInitialized } from "@/lib/gql/request-documents"
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Authentication",
|
title: "Authentication",
|
||||||
|
|
@ -14,17 +12,17 @@ export const metadata: Metadata = {
|
||||||
export default function AuthenticationPage() {
|
export default function AuthenticationPage() {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center justify-center flex-1">
|
<div className="flex flex-col items-center justify-center flex-1">
|
||||||
<div className="space-y-6 w-[350px]">
|
<div className="space-y-6 w-[350px]">
|
||||||
<div className="flex flex-col space-y-2 text-center">
|
<div className="flex flex-col space-y-2 text-center">
|
||||||
<h1 className="text-2xl font-semibold tracking-tight">
|
<h1 className="text-2xl font-semibold tracking-tight">
|
||||||
Create an account
|
Create an account
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
Enter your credentials below to create admin account
|
Enter your credentials below to create admin account
|
||||||
</p>
|
</p>
|
||||||
</div>
|
|
||||||
<UserAuthForm />
|
|
||||||
</div>
|
</div>
|
||||||
|
<UserAuthForm />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import { fontMono, fontSans } from '@/lib/fonts'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
import { TailwindIndicator } from '@/components/tailwind-indicator'
|
import { TailwindIndicator } from '@/components/tailwind-indicator'
|
||||||
import { Providers } from '@/components/providers'
|
import { Providers } from '@/components/providers'
|
||||||
import { Header } from '@/components/header'
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: {
|
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':
|
'\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,
|
types.GetWorkersDocument,
|
||||||
'\n query GetRegistrationToken {\n registrationToken\n }\n':
|
'\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(
|
export function graphql(
|
||||||
source: '\n query GetRegistrationToken {\n registrationToken\n }\n'
|
source: '\n query GetRegistrationToken {\n registrationToken\n }\n'
|
||||||
): (typeof documents)['\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) {
|
export function graphql(source: string) {
|
||||||
return (documents as any)[source] ?? {}
|
return (documents as any)[source] ?? {}
|
||||||
|
|
|
||||||
|
|
@ -29,17 +29,87 @@ export type Scalars = {
|
||||||
Float: { input: number; output: number }
|
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 = {
|
export type Mutation = {
|
||||||
__typename?: 'Mutation'
|
__typename?: 'Mutation'
|
||||||
|
createInvitation: Scalars['Int']['output']
|
||||||
|
deleteInvitation: Scalars['Int']['output']
|
||||||
|
register: RegisterResponse
|
||||||
resetRegistrationToken: Scalars['String']['output']
|
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 = {
|
export type Query = {
|
||||||
__typename?: 'Query'
|
__typename?: 'Query'
|
||||||
|
invitations: Array<Invitation>
|
||||||
|
isAdminInitialized: Scalars['Boolean']['output']
|
||||||
|
me: UserInfo
|
||||||
registrationToken: Scalars['String']['output']
|
registrationToken: Scalars['String']['output']
|
||||||
workers: Array<Worker>
|
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 = {
|
export type Worker = {
|
||||||
__typename?: 'Worker'
|
__typename?: 'Worker'
|
||||||
addr: Scalars['String']['output']
|
addr: Scalars['String']['output']
|
||||||
|
|
@ -81,6 +151,15 @@ export type GetRegistrationTokenQuery = {
|
||||||
registrationToken: string
|
registrationToken: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type GetIsAdminInitializedQueryVariables = Exact<{
|
||||||
|
[key: string]: never
|
||||||
|
}>
|
||||||
|
|
||||||
|
export type GetIsAdminInitializedQuery = {
|
||||||
|
__typename?: 'Query'
|
||||||
|
isAdminInitialized: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export const GetWorkersDocument = {
|
export const GetWorkersDocument = {
|
||||||
kind: 'Document',
|
kind: 'Document',
|
||||||
definitions: [
|
definitions: [
|
||||||
|
|
@ -132,3 +211,22 @@ export const GetRegistrationTokenDocument = {
|
||||||
GetRegistrationTokenQuery,
|
GetRegistrationTokenQuery,
|
||||||
GetRegistrationTokenQueryVariables
|
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
|
registrationToken
|
||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
|
export const getIsAdminInitialized = graphql(/* GraphQL */ `
|
||||||
|
query GetIsAdminInitialized {
|
||||||
|
isAdminInitialized
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue