diff --git a/frontend/src/components/AddEmailForm.tsx b/frontend/src/components/AddEmailForm.tsx index 796f57d6..8eb85929 100644 --- a/frontend/src/components/AddEmailForm.tsx +++ b/frontend/src/components/AddEmailForm.tsx @@ -17,12 +17,16 @@ import { atomWithMutation } from "jotai-urql"; import { useRef, useTransition } from "react"; import { graphql } from "../gql"; +import { LAST_PAGE } from "../pagination"; import Button from "./Button"; import Input from "./Input"; import Typography from "./Typography"; -import UserEmail from "./UserEmail"; -import { emailPageResultFamily } from "./UserEmailList"; +import { + currentPaginationAtom, + emailPageResultFamily, + primaryEmailResultFamily, +} from "./UserEmailList"; const ADD_EMAIL_MUTATION = graphql(/* GraphQL */ ` mutation AddEmail($userId: ID!, $email: String!) { @@ -36,24 +40,36 @@ const ADD_EMAIL_MUTATION = graphql(/* GraphQL */ ` } `); -const addUserEmailAtom = atomWithMutation(ADD_EMAIL_MUTATION); +export const addUserEmailAtom = atomWithMutation(ADD_EMAIL_MUTATION); const AddEmailForm: React.FC<{ userId: string }> = ({ userId }) => { const formRef = useRef(null); const [addEmailResult, addEmail] = useAtom(addUserEmailAtom); const [pending, startTransition] = useTransition(); + // XXX: is this the right way to do this? const refetchList = useSetAtom(emailPageResultFamily(userId)); + const refetchPrimaryEmail = useSetAtom(primaryEmailResultFamily(userId)); + const setCurrentPagination = useSetAtom(currentPaginationAtom); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); - const email = e.currentTarget.email.value; + + const formData = new FormData(e.currentTarget); + const email = formData.get("email") as string; startTransition(() => { addEmail({ userId, email }).then(() => { - refetchList(); - if (formRef.current) { - formRef.current.reset(); - } + startTransition(() => { + // Paginate to the last page + setCurrentPagination(LAST_PAGE); + + // Make it refetch the list and the primary email, in case they changed + refetchList(); + refetchPrimaryEmail(); + + // Reset the form + formRef.current?.reset(); + }); }); }); }; @@ -65,7 +81,6 @@ const AddEmailForm: React.FC<{ userId: string }> = ({ userId }) => {
Email added!
- )} {addEmailResult.data?.addEmail.status === "EXISTS" && ( @@ -73,14 +88,14 @@ const AddEmailForm: React.FC<{ userId: string }> = ({ userId }) => {
Email already exists!
- )}
+ +
)} ); diff --git a/frontend/src/components/UserEmailList.tsx b/frontend/src/components/UserEmailList.tsx index d29baebe..09a079dd 100644 --- a/frontend/src/components/UserEmailList.tsx +++ b/frontend/src/components/UserEmailList.tsx @@ -19,7 +19,12 @@ import { useTransition } from "react"; import { graphql } from "../gql"; import { PageInfo } from "../gql/graphql"; -import { atomWithPagination, pageSizeAtom, Pagination } from "../pagination"; +import { + atomForCurrentPagination, + atomWithPagination, + pageSizeAtom, + Pagination, +} from "../pagination"; import BlockList from "./BlockList"; import PaginationControls from "./PaginationControls"; @@ -35,6 +40,7 @@ const QUERY = graphql(/* GraphQL */ ` ) { user(id: $userId) { id + emails(first: $first, after: $after, last: $last, before: $before) { edges { cursor @@ -55,15 +61,40 @@ const QUERY = graphql(/* GraphQL */ ` } `); -const currentPagination = atomWithDefault((get) => ({ - first: get(pageSizeAtom), - after: null, -})); +const PRIMARY_EMAIL_QUERY = graphql(/* GraphQL */ ` + query UserPrimaryEmail($userId: ID!) { + user(id: $userId) { + id + primaryEmail { + id + } + } + } +`); + +export const primaryEmailResultFamily = atomFamily((userId: string) => { + const primaryEmailResult = atomWithQuery({ + query: PRIMARY_EMAIL_QUERY, + getVariables: () => ({ userId }), + }); + return primaryEmailResult; +}); + +const primaryEmailIdFamily = atomFamily((userId: string) => { + const primaryEmailIdAtom = atom(async (get) => { + const result = await get(primaryEmailResultFamily(userId)); + return result.data?.user?.primaryEmail?.id ?? null; + }); + + return primaryEmailIdAtom; +}); + +export const currentPaginationAtom = atomForCurrentPagination(); export const emailPageResultFamily = atomFamily((userId: string) => { const emailPageResult = atomWithQuery({ query: QUERY, - getVariables: (get) => ({ userId, ...get(currentPagination) }), + getVariables: (get) => ({ userId, ...get(currentPaginationAtom) }), }); return emailPageResult; }); @@ -79,17 +110,21 @@ const pageInfoFamily = atomFamily((userId: string) => { const paginationFamily = atomFamily((userId: string) => { const paginationAtom = atomWithPagination( - currentPagination, + currentPaginationAtom, pageInfoFamily(userId) ); return paginationAtom; }); -const UserEmailList: React.FC<{ userId: string }> = ({ userId }) => { +const UserEmailList: React.FC<{ + userId: string; + highlightedEmail?: string; +}> = ({ userId, highlightedEmail }) => { const [pending, startTransition] = useTransition(); const result = useAtomValue(emailPageResultFamily(userId)); - const setPagination = useSetAtom(currentPagination); + const setPagination = useSetAtom(currentPaginationAtom); const [prevPage, nextPage] = useAtomValue(paginationFamily(userId)); + const primaryEmailId = useAtomValue(primaryEmailIdFamily(userId)); const paginate = (pagination: Pagination) => { startTransition(() => { @@ -106,7 +141,12 @@ const UserEmailList: React.FC<{ userId: string }> = ({ userId }) => { disabled={pending} /> {result.data?.user?.emails?.edges?.map((edge) => ( - + ))} ); diff --git a/frontend/src/components/UserGreeting.tsx b/frontend/src/components/UserGreeting.tsx index 1b78d22b..b931ce6e 100644 --- a/frontend/src/components/UserGreeting.tsx +++ b/frontend/src/components/UserGreeting.tsx @@ -18,7 +18,7 @@ import { atomWithQuery } from "jotai-urql"; import { graphql } from "../gql"; -import { Title } from "./Typography"; +import Typography from "./Typography"; const QUERY = graphql(/* GraphQL */ ` query UserGreeting($userId: ID!) { @@ -42,7 +42,11 @@ const UserGreeting: React.FC<{ userId: string }> = ({ userId }) => { const result = useAtomValue(userGreetingFamily(userId)); if (result.data?.user) { - return Hello, {result.data.user.username}!; + return ( + + Hello, {result.data.user.username}! + + ); } return <>Failed to load user; diff --git a/frontend/src/gql/gql.ts b/frontend/src/gql/gql.ts index de7e21bf..c3892093 100644 --- a/frontend/src/gql/gql.ts +++ b/frontend/src/gql/gql.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as types from './graphql'; -import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +import * as types from "./graphql"; +import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core"; /** * Map of all GraphQL operations in the project. @@ -13,20 +13,40 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel or swc plugin for production. */ const documents = { - "\n query CurrentViewerQuery {\n viewer {\n __typename\n ... on User {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n": types.CurrentViewerQueryDocument, - "\n query CurrentViewerSessionQuery {\n viewerSession {\n __typename\n ... on BrowserSession {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n": types.CurrentViewerSessionQueryDocument, - "\n mutation AddEmail($userId: ID!, $email: String!) {\n addEmail(input: { userId: $userId, email: $email }) {\n status\n email {\n id\n ...UserEmail_email\n }\n }\n }\n": types.AddEmailDocument, - "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n": types.BrowserSession_SessionFragmentDoc, - "\n query BrowserSessionList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n browserSessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...BrowserSession_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n": types.BrowserSessionListDocument, - "\n fragment CompatSsoLogin_login on CompatSsoLogin {\n id\n redirectUri\n createdAt\n session {\n id\n createdAt\n deviceId\n finishedAt\n }\n }\n": types.CompatSsoLogin_LoginFragmentDoc, - "\n query CompatSsoLoginList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n compatSsoLogins(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n node {\n id\n ...CompatSsoLogin_login\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n": types.CompatSsoLoginListDocument, - "\n fragment OAuth2Session_session on Oauth2Session {\n id\n scope\n client {\n id\n clientId\n clientName\n clientUri\n }\n }\n": types.OAuth2Session_SessionFragmentDoc, - "\n query OAuth2SessionListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n oauth2Sessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...OAuth2Session_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n": types.OAuth2SessionListQueryDocument, - "\n fragment UserEmail_email on UserEmail {\n id\n email\n createdAt\n confirmedAt\n }\n": types.UserEmail_EmailFragmentDoc, - "\n query UserEmailListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n emails(first: $first, after: $after, last: $last, before: $before) {\n edges {\n cursor\n node {\n id\n ...UserEmail_email\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n": types.UserEmailListQueryDocument, - "\n query UserGreeting($userId: ID!) {\n user(id: $userId) {\n id\n username\n }\n }\n": types.UserGreetingDocument, - "\n query BrowserSessionQuery($id: ID!) {\n browserSession(id: $id) {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n user {\n id\n username\n }\n }\n }\n": types.BrowserSessionQueryDocument, - "\n query OAuth2ClientQuery($id: ID!) {\n oauth2Client(id: $id) {\n id\n clientId\n clientName\n clientUri\n tosUri\n policyUri\n redirectUris\n }\n }\n": types.OAuth2ClientQueryDocument, + "\n query CurrentViewerQuery {\n viewer {\n __typename\n ... on User {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n": + types.CurrentViewerQueryDocument, + "\n query CurrentViewerSessionQuery {\n viewerSession {\n __typename\n ... on BrowserSession {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n": + types.CurrentViewerSessionQueryDocument, + "\n mutation AddEmail($userId: ID!, $email: String!) {\n addEmail(input: { userId: $userId, email: $email }) {\n status\n email {\n id\n ...UserEmail_email\n }\n }\n }\n": + types.AddEmailDocument, + "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n": + types.BrowserSession_SessionFragmentDoc, + "\n query BrowserSessionList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n browserSessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...BrowserSession_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n": + types.BrowserSessionListDocument, + "\n fragment CompatSsoLogin_login on CompatSsoLogin {\n id\n redirectUri\n createdAt\n session {\n id\n createdAt\n deviceId\n finishedAt\n }\n }\n": + types.CompatSsoLogin_LoginFragmentDoc, + "\n query CompatSsoLoginList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n compatSsoLogins(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n node {\n id\n ...CompatSsoLogin_login\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n": + types.CompatSsoLoginListDocument, + "\n fragment OAuth2Session_session on Oauth2Session {\n id\n scope\n client {\n id\n clientId\n clientName\n clientUri\n }\n }\n": + types.OAuth2Session_SessionFragmentDoc, + "\n query OAuth2SessionListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n oauth2Sessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...OAuth2Session_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n": + types.OAuth2SessionListQueryDocument, + "\n fragment UserEmail_email on UserEmail {\n id\n email\n createdAt\n confirmedAt\n }\n": + types.UserEmail_EmailFragmentDoc, + "\n mutation VerifyEmail($id: ID!, $code: String!) {\n verifyEmail(input: { userEmailId: $id, code: $code }) {\n status\n\n user {\n id\n primaryEmail {\n id\n }\n }\n\n email {\n id\n ...UserEmail_email\n }\n }\n }\n": + types.VerifyEmailDocument, + "\n mutation ResendVerificationEmail($id: ID!) {\n sendVerificationEmail(input: { userEmailId: $id }) {\n status\n\n user {\n id\n primaryEmail {\n id\n }\n }\n\n email {\n id\n ...UserEmail_email\n }\n }\n }\n": + types.ResendVerificationEmailDocument, + "\n query UserEmailListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n\n emails(first: $first, after: $after, last: $last, before: $before) {\n edges {\n cursor\n node {\n id\n ...UserEmail_email\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n": + types.UserEmailListQueryDocument, + "\n query UserPrimaryEmail($userId: ID!) {\n user(id: $userId) {\n id\n primaryEmail {\n id\n }\n }\n }\n": + types.UserPrimaryEmailDocument, + "\n query UserGreeting($userId: ID!) {\n user(id: $userId) {\n id\n username\n }\n }\n": + types.UserGreetingDocument, + "\n query BrowserSessionQuery($id: ID!) {\n browserSession(id: $id) {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n user {\n id\n username\n }\n }\n }\n": + types.BrowserSessionQueryDocument, + "\n query OAuth2ClientQuery($id: ID!) {\n oauth2Client(id: $id) {\n id\n clientId\n clientName\n clientUri\n tosUri\n policyUri\n redirectUris\n }\n }\n": + types.OAuth2ClientQueryDocument, }; /** @@ -46,62 +66,109 @@ export function graphql(source: string): unknown; /** * 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 CurrentViewerQuery {\n viewer {\n __typename\n ... on User {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n"): (typeof documents)["\n query CurrentViewerQuery {\n viewer {\n __typename\n ... on User {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n"]; +export function graphql( + source: "\n query CurrentViewerQuery {\n viewer {\n __typename\n ... on User {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n" +): (typeof documents)["\n query CurrentViewerQuery {\n viewer {\n __typename\n ... on User {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\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 CurrentViewerSessionQuery {\n viewerSession {\n __typename\n ... on BrowserSession {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n"): (typeof documents)["\n query CurrentViewerSessionQuery {\n viewerSession {\n __typename\n ... on BrowserSession {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n"]; +export function graphql( + source: "\n query CurrentViewerSessionQuery {\n viewerSession {\n __typename\n ... on BrowserSession {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\n }\n" +): (typeof documents)["\n query CurrentViewerSessionQuery {\n viewerSession {\n __typename\n ... on BrowserSession {\n id\n }\n\n ... on Anonymous {\n id\n }\n }\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 mutation AddEmail($userId: ID!, $email: String!) {\n addEmail(input: { userId: $userId, email: $email }) {\n status\n email {\n id\n ...UserEmail_email\n }\n }\n }\n"): (typeof documents)["\n mutation AddEmail($userId: ID!, $email: String!) {\n addEmail(input: { userId: $userId, email: $email }) {\n status\n email {\n id\n ...UserEmail_email\n }\n }\n }\n"]; +export function graphql( + source: "\n mutation AddEmail($userId: ID!, $email: String!) {\n addEmail(input: { userId: $userId, email: $email }) {\n status\n email {\n id\n ...UserEmail_email\n }\n }\n }\n" +): (typeof documents)["\n mutation AddEmail($userId: ID!, $email: String!) {\n addEmail(input: { userId: $userId, email: $email }) {\n status\n email {\n id\n ...UserEmail_email\n }\n }\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 fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n"): (typeof documents)["\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n"]; +export function graphql( + source: "\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n }\n" +): (typeof documents)["\n fragment BrowserSession_session on BrowserSession {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\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 BrowserSessionList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n browserSessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...BrowserSession_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n"): (typeof documents)["\n query BrowserSessionList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n browserSessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...BrowserSession_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n"]; +export function graphql( + source: "\n query BrowserSessionList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n browserSessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...BrowserSession_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n" +): (typeof documents)["\n query BrowserSessionList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n browserSessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...BrowserSession_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\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 fragment CompatSsoLogin_login on CompatSsoLogin {\n id\n redirectUri\n createdAt\n session {\n id\n createdAt\n deviceId\n finishedAt\n }\n }\n"): (typeof documents)["\n fragment CompatSsoLogin_login on CompatSsoLogin {\n id\n redirectUri\n createdAt\n session {\n id\n createdAt\n deviceId\n finishedAt\n }\n }\n"]; +export function graphql( + source: "\n fragment CompatSsoLogin_login on CompatSsoLogin {\n id\n redirectUri\n createdAt\n session {\n id\n createdAt\n deviceId\n finishedAt\n }\n }\n" +): (typeof documents)["\n fragment CompatSsoLogin_login on CompatSsoLogin {\n id\n redirectUri\n createdAt\n session {\n id\n createdAt\n deviceId\n finishedAt\n }\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 CompatSsoLoginList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n compatSsoLogins(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n node {\n id\n ...CompatSsoLogin_login\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n"): (typeof documents)["\n query CompatSsoLoginList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n compatSsoLogins(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n node {\n id\n ...CompatSsoLogin_login\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n"]; +export function graphql( + source: "\n query CompatSsoLoginList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n compatSsoLogins(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n node {\n id\n ...CompatSsoLogin_login\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n" +): (typeof documents)["\n query CompatSsoLoginList(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n compatSsoLogins(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n node {\n id\n ...CompatSsoLogin_login\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\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 fragment OAuth2Session_session on Oauth2Session {\n id\n scope\n client {\n id\n clientId\n clientName\n clientUri\n }\n }\n"): (typeof documents)["\n fragment OAuth2Session_session on Oauth2Session {\n id\n scope\n client {\n id\n clientId\n clientName\n clientUri\n }\n }\n"]; +export function graphql( + source: "\n fragment OAuth2Session_session on Oauth2Session {\n id\n scope\n client {\n id\n clientId\n clientName\n clientUri\n }\n }\n" +): (typeof documents)["\n fragment OAuth2Session_session on Oauth2Session {\n id\n scope\n client {\n id\n clientId\n clientName\n clientUri\n }\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 OAuth2SessionListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n oauth2Sessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...OAuth2Session_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n"): (typeof documents)["\n query OAuth2SessionListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n oauth2Sessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...OAuth2Session_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n"]; +export function graphql( + source: "\n query OAuth2SessionListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n oauth2Sessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...OAuth2Session_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n" +): (typeof documents)["\n query OAuth2SessionListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n oauth2Sessions(\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n cursor\n node {\n id\n ...OAuth2Session_session\n }\n }\n\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\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 fragment UserEmail_email on UserEmail {\n id\n email\n createdAt\n confirmedAt\n }\n"): (typeof documents)["\n fragment UserEmail_email on UserEmail {\n id\n email\n createdAt\n confirmedAt\n }\n"]; +export function graphql( + source: "\n fragment UserEmail_email on UserEmail {\n id\n email\n createdAt\n confirmedAt\n }\n" +): (typeof documents)["\n fragment UserEmail_email on UserEmail {\n id\n email\n createdAt\n confirmedAt\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 UserEmailListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n emails(first: $first, after: $after, last: $last, before: $before) {\n edges {\n cursor\n node {\n id\n ...UserEmail_email\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n"): (typeof documents)["\n query UserEmailListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n emails(first: $first, after: $after, last: $last, before: $before) {\n edges {\n cursor\n node {\n id\n ...UserEmail_email\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n"]; +export function graphql( + source: "\n mutation VerifyEmail($id: ID!, $code: String!) {\n verifyEmail(input: { userEmailId: $id, code: $code }) {\n status\n\n user {\n id\n primaryEmail {\n id\n }\n }\n\n email {\n id\n ...UserEmail_email\n }\n }\n }\n" +): (typeof documents)["\n mutation VerifyEmail($id: ID!, $code: String!) {\n verifyEmail(input: { userEmailId: $id, code: $code }) {\n status\n\n user {\n id\n primaryEmail {\n id\n }\n }\n\n email {\n id\n ...UserEmail_email\n }\n }\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 UserGreeting($userId: ID!) {\n user(id: $userId) {\n id\n username\n }\n }\n"): (typeof documents)["\n query UserGreeting($userId: ID!) {\n user(id: $userId) {\n id\n username\n }\n }\n"]; +export function graphql( + source: "\n mutation ResendVerificationEmail($id: ID!) {\n sendVerificationEmail(input: { userEmailId: $id }) {\n status\n\n user {\n id\n primaryEmail {\n id\n }\n }\n\n email {\n id\n ...UserEmail_email\n }\n }\n }\n" +): (typeof documents)["\n mutation ResendVerificationEmail($id: ID!) {\n sendVerificationEmail(input: { userEmailId: $id }) {\n status\n\n user {\n id\n primaryEmail {\n id\n }\n }\n\n email {\n id\n ...UserEmail_email\n }\n }\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 BrowserSessionQuery($id: ID!) {\n browserSession(id: $id) {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n user {\n id\n username\n }\n }\n }\n"): (typeof documents)["\n query BrowserSessionQuery($id: ID!) {\n browserSession(id: $id) {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n user {\n id\n username\n }\n }\n }\n"]; +export function graphql( + source: "\n query UserEmailListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n\n emails(first: $first, after: $after, last: $last, before: $before) {\n edges {\n cursor\n node {\n id\n ...UserEmail_email\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n }\n" +): (typeof documents)["\n query UserEmailListQuery(\n $userId: ID!\n $first: Int\n $after: String\n $last: Int\n $before: String\n ) {\n user(id: $userId) {\n id\n\n emails(first: $first, after: $after, last: $last, before: $before) {\n edges {\n cursor\n node {\n id\n ...UserEmail_email\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\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 OAuth2ClientQuery($id: ID!) {\n oauth2Client(id: $id) {\n id\n clientId\n clientName\n clientUri\n tosUri\n policyUri\n redirectUris\n }\n }\n"): (typeof documents)["\n query OAuth2ClientQuery($id: ID!) {\n oauth2Client(id: $id) {\n id\n clientId\n clientName\n clientUri\n tosUri\n policyUri\n redirectUris\n }\n }\n"]; +export function graphql( + source: "\n query UserPrimaryEmail($userId: ID!) {\n user(id: $userId) {\n id\n primaryEmail {\n id\n }\n }\n }\n" +): (typeof documents)["\n query UserPrimaryEmail($userId: ID!) {\n user(id: $userId) {\n id\n primaryEmail {\n id\n }\n }\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 UserGreeting($userId: ID!) {\n user(id: $userId) {\n id\n username\n }\n }\n" +): (typeof documents)["\n query UserGreeting($userId: ID!) {\n user(id: $userId) {\n id\n username\n }\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 BrowserSessionQuery($id: ID!) {\n browserSession(id: $id) {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n user {\n id\n username\n }\n }\n }\n" +): (typeof documents)["\n query BrowserSessionQuery($id: ID!) {\n browserSession(id: $id) {\n id\n createdAt\n lastAuthentication {\n id\n createdAt\n }\n user {\n id\n username\n }\n }\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 OAuth2ClientQuery($id: ID!) {\n oauth2Client(id: $id) {\n id\n clientId\n clientName\n clientUri\n tosUri\n policyUri\n redirectUris\n }\n }\n" +): (typeof documents)["\n query OAuth2ClientQuery($id: ID!) {\n oauth2Client(id: $id) {\n id\n clientId\n clientName\n clientUri\n tosUri\n policyUri\n redirectUris\n }\n }\n"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; } -export type DocumentType> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never; \ No newline at end of file +export type DocumentType> = + TDocumentNode extends DocumentNode ? TType : never; diff --git a/frontend/src/gql/graphql.ts b/frontend/src/gql/graphql.ts index 9f3195aa..9cac0c64 100644 --- a/frontend/src/gql/graphql.ts +++ b/frontend/src/gql/graphql.ts @@ -1,10 +1,16 @@ /* eslint-disable */ -import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core"; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { [K in keyof T]: T[K] }; -export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; -export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; @@ -25,14 +31,14 @@ export type Scalars = { /** The input for the `addEmail` mutation */ export type AddEmailInput = { /** The email address to add */ - email: Scalars['String']; + email: Scalars["String"]; /** The ID of the user to add the email address to */ - userId: Scalars['ID']; + userId: Scalars["ID"]; }; /** The payload of the `addEmail` mutation */ export type AddEmailPayload = { - __typename?: 'AddEmailPayload'; + __typename?: "AddEmailPayload"; /** The email address that was added */ email: UserEmail; /** Status of the operation */ @@ -44,43 +50,45 @@ export type AddEmailPayload = { /** The status of the `addEmail` mutation */ export enum AddEmailStatus { /** The email address was added */ - Added = 'ADDED', + Added = "ADDED", /** The email address already exists */ - Exists = 'EXISTS' + Exists = "EXISTS", } export type Anonymous = Node & { - __typename?: 'Anonymous'; - id: Scalars['ID']; + __typename?: "Anonymous"; + id: Scalars["ID"]; }; /** * An authentication records when a user enter their credential in a browser * session. */ -export type Authentication = CreationEvent & Node & { - __typename?: 'Authentication'; - /** When the object was created. */ - createdAt: Scalars['DateTime']; - /** ID of the object. */ - id: Scalars['ID']; -}; +export type Authentication = CreationEvent & + Node & { + __typename?: "Authentication"; + /** When the object was created. */ + createdAt: Scalars["DateTime"]; + /** ID of the object. */ + id: Scalars["ID"]; + }; /** A browser session represents a logged in user in a browser. */ -export type BrowserSession = CreationEvent & Node & { - __typename?: 'BrowserSession'; - /** When the object was created. */ - createdAt: Scalars['DateTime']; - /** ID of the object. */ - id: Scalars['ID']; - /** The most recent authentication of this session. */ - lastAuthentication?: Maybe; - /** The user logged in this session. */ - user: User; -}; +export type BrowserSession = CreationEvent & + Node & { + __typename?: "BrowserSession"; + /** When the object was created. */ + createdAt: Scalars["DateTime"]; + /** ID of the object. */ + id: Scalars["ID"]; + /** The most recent authentication of this session. */ + lastAuthentication?: Maybe; + /** The user logged in this session. */ + user: User; + }; export type BrowserSessionConnection = { - __typename?: 'BrowserSessionConnection'; + __typename?: "BrowserSessionConnection"; /** A list of edges. */ edges: Array; /** A list of nodes. */ @@ -91,9 +99,9 @@ export type BrowserSessionConnection = { /** An edge in a connection. */ export type BrowserSessionEdge = { - __typename?: 'BrowserSessionEdge'; + __typename?: "BrowserSessionEdge"; /** A cursor for use in pagination */ - cursor: Scalars['String']; + cursor: Scalars["String"]; /** The item at the end of the edge */ node: BrowserSession; }; @@ -102,45 +110,46 @@ export type BrowserSessionEdge = { * A compat session represents a client session which used the legacy Matrix * login API. */ -export type CompatSession = CreationEvent & Node & { - __typename?: 'CompatSession'; - /** When the object was created. */ - createdAt: Scalars['DateTime']; - /** The Matrix Device ID of this session. */ - deviceId: Scalars['String']; - /** When the session ended. */ - finishedAt?: Maybe; - /** ID of the object. */ - id: Scalars['ID']; - /** The user authorized for this session. */ - user: User; -}; +export type CompatSession = CreationEvent & + Node & { + __typename?: "CompatSession"; + /** When the object was created. */ + createdAt: Scalars["DateTime"]; + /** The Matrix Device ID of this session. */ + deviceId: Scalars["String"]; + /** When the session ended. */ + finishedAt?: Maybe; + /** ID of the object. */ + id: Scalars["ID"]; + /** The user authorized for this session. */ + user: User; + }; /** * A compat SSO login represents a login done through the legacy Matrix login * API, via the `m.login.sso` login method. */ export type CompatSsoLogin = Node & { - __typename?: 'CompatSsoLogin'; + __typename?: "CompatSsoLogin"; /** When the object was created. */ - createdAt: Scalars['DateTime']; + createdAt: Scalars["DateTime"]; /** When the client exchanged the login token sent during the redirection. */ - exchangedAt?: Maybe; + exchangedAt?: Maybe; /** * When the login was fulfilled, and the user was redirected back to the * client. */ - fulfilledAt?: Maybe; + fulfilledAt?: Maybe; /** ID of the object. */ - id: Scalars['ID']; + id: Scalars["ID"]; /** The redirect URI used during the login. */ - redirectUri: Scalars['Url']; + redirectUri: Scalars["Url"]; /** The compat session which was started by this login. */ session?: Maybe; }; export type CompatSsoLoginConnection = { - __typename?: 'CompatSsoLoginConnection'; + __typename?: "CompatSsoLoginConnection"; /** A list of edges. */ edges: Array; /** A list of nodes. */ @@ -151,9 +160,9 @@ export type CompatSsoLoginConnection = { /** An edge in a connection. */ export type CompatSsoLoginEdge = { - __typename?: 'CompatSsoLoginEdge'; + __typename?: "CompatSsoLoginEdge"; /** A cursor for use in pagination */ - cursor: Scalars['String']; + cursor: Scalars["String"]; /** The item at the end of the edge */ node: CompatSsoLogin; }; @@ -161,12 +170,12 @@ export type CompatSsoLoginEdge = { /** An object with a creation date. */ export type CreationEvent = { /** When the object was created. */ - createdAt: Scalars['DateTime']; + createdAt: Scalars["DateTime"]; }; /** The mutations root of the GraphQL interface. */ export type Mutation = { - __typename?: 'Mutation'; + __typename?: "Mutation"; /** Add an email address to the specified user */ addEmail: AddEmailPayload; /** Send a verification code for an email address */ @@ -175,19 +184,16 @@ export type Mutation = { verifyEmail: VerifyEmailPayload; }; - /** The mutations root of the GraphQL interface. */ export type MutationAddEmailArgs = { input: AddEmailInput; }; - /** The mutations root of the GraphQL interface. */ export type MutationSendVerificationEmailArgs = { input: SendVerificationEmailInput; }; - /** The mutations root of the GraphQL interface. */ export type MutationVerifyEmailArgs = { input: VerifyEmailInput; @@ -196,26 +202,26 @@ export type MutationVerifyEmailArgs = { /** An object with an ID. */ export type Node = { /** ID of the object. */ - id: Scalars['ID']; + id: Scalars["ID"]; }; /** An OAuth 2.0 client */ export type Oauth2Client = Node & { - __typename?: 'Oauth2Client'; + __typename?: "Oauth2Client"; /** OAuth 2.0 client ID */ - clientId: Scalars['String']; + clientId: Scalars["String"]; /** Client name advertised by the client. */ - clientName?: Maybe; + clientName?: Maybe; /** Client URI advertised by the client. */ - clientUri?: Maybe; + clientUri?: Maybe; /** ID of the object. */ - id: Scalars['ID']; + id: Scalars["ID"]; /** Privacy policy URI advertised by the client. */ - policyUri?: Maybe; + policyUri?: Maybe; /** List of redirect URIs used for authorization grants by the client. */ - redirectUris: Array; + redirectUris: Array; /** Terms of services URI advertised by the client. */ - tosUri?: Maybe; + tosUri?: Maybe; }; /** @@ -223,21 +229,21 @@ export type Oauth2Client = Node & { * to login. */ export type Oauth2Session = Node & { - __typename?: 'Oauth2Session'; + __typename?: "Oauth2Session"; /** The browser session which started this OAuth 2.0 session. */ browserSession: BrowserSession; /** OAuth 2.0 client used by this session. */ client: Oauth2Client; /** ID of the object. */ - id: Scalars['ID']; + id: Scalars["ID"]; /** Scope granted for this session. */ - scope: Scalars['String']; + scope: Scalars["String"]; /** User authorized for this session. */ user: User; }; export type Oauth2SessionConnection = { - __typename?: 'Oauth2SessionConnection'; + __typename?: "Oauth2SessionConnection"; /** A list of edges. */ edges: Array; /** A list of nodes. */ @@ -248,29 +254,29 @@ export type Oauth2SessionConnection = { /** An edge in a connection. */ export type Oauth2SessionEdge = { - __typename?: 'Oauth2SessionEdge'; + __typename?: "Oauth2SessionEdge"; /** A cursor for use in pagination */ - cursor: Scalars['String']; + cursor: Scalars["String"]; /** The item at the end of the edge */ node: Oauth2Session; }; /** Information about pagination in a connection */ export type PageInfo = { - __typename?: 'PageInfo'; + __typename?: "PageInfo"; /** When paginating forwards, the cursor to continue. */ - endCursor?: Maybe; + endCursor?: Maybe; /** When paginating forwards, are there more items? */ - hasNextPage: Scalars['Boolean']; + hasNextPage: Scalars["Boolean"]; /** When paginating backwards, are there more items? */ - hasPreviousPage: Scalars['Boolean']; + hasPreviousPage: Scalars["Boolean"]; /** When paginating backwards, the cursor to continue. */ - startCursor?: Maybe; + startCursor?: Maybe; }; /** The query root of the GraphQL interface. */ export type Query = { - __typename?: 'Query'; + __typename?: "Query"; /** Fetch a browser session by its ID. */ browserSession?: Maybe; /** @@ -303,66 +309,58 @@ export type Query = { viewerSession: ViewerSession; }; - /** The query root of the GraphQL interface. */ export type QueryBrowserSessionArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - /** The query root of the GraphQL interface. */ export type QueryNodeArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - /** The query root of the GraphQL interface. */ export type QueryOauth2ClientArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - /** The query root of the GraphQL interface. */ export type QueryUpstreamOauth2LinkArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - /** The query root of the GraphQL interface. */ export type QueryUpstreamOauth2ProviderArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - /** The query root of the GraphQL interface. */ export type QueryUpstreamOauth2ProvidersArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; }; - /** The query root of the GraphQL interface. */ export type QueryUserArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - /** The query root of the GraphQL interface. */ export type QueryUserEmailArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; /** The input for the `sendVerificationEmail` mutation */ export type SendVerificationEmailInput = { /** The ID of the email address to verify */ - userEmailId: Scalars['ID']; + userEmailId: Scalars["ID"]; }; /** The payload of the `sendVerificationEmail` mutation */ export type SendVerificationEmailPayload = { - __typename?: 'SendVerificationEmailPayload'; + __typename?: "SendVerificationEmailPayload"; /** The email address to which the verification email was sent */ email: UserEmail; /** Status of the operation */ @@ -374,27 +372,28 @@ export type SendVerificationEmailPayload = { /** The status of the `sendVerificationEmail` mutation */ export enum SendVerificationEmailStatus { /** The email address is already verified */ - AlreadyVerified = 'ALREADY_VERIFIED', + AlreadyVerified = "ALREADY_VERIFIED", /** The verification email was sent */ - Sent = 'SENT' + Sent = "SENT", } -export type UpstreamOAuth2Link = CreationEvent & Node & { - __typename?: 'UpstreamOAuth2Link'; - /** When the object was created. */ - createdAt: Scalars['DateTime']; - /** ID of the object. */ - id: Scalars['ID']; - /** The provider for which this link is. */ - provider: UpstreamOAuth2Provider; - /** Subject used for linking */ - subject: Scalars['String']; - /** The user to which this link is associated. */ - user?: Maybe; -}; +export type UpstreamOAuth2Link = CreationEvent & + Node & { + __typename?: "UpstreamOAuth2Link"; + /** When the object was created. */ + createdAt: Scalars["DateTime"]; + /** ID of the object. */ + id: Scalars["ID"]; + /** The provider for which this link is. */ + provider: UpstreamOAuth2Provider; + /** Subject used for linking */ + subject: Scalars["String"]; + /** The user to which this link is associated. */ + user?: Maybe; + }; export type UpstreamOAuth2LinkConnection = { - __typename?: 'UpstreamOAuth2LinkConnection'; + __typename?: "UpstreamOAuth2LinkConnection"; /** A list of edges. */ edges: Array; /** A list of nodes. */ @@ -405,27 +404,28 @@ export type UpstreamOAuth2LinkConnection = { /** An edge in a connection. */ export type UpstreamOAuth2LinkEdge = { - __typename?: 'UpstreamOAuth2LinkEdge'; + __typename?: "UpstreamOAuth2LinkEdge"; /** A cursor for use in pagination */ - cursor: Scalars['String']; + cursor: Scalars["String"]; /** The item at the end of the edge */ node: UpstreamOAuth2Link; }; -export type UpstreamOAuth2Provider = CreationEvent & Node & { - __typename?: 'UpstreamOAuth2Provider'; - /** Client ID used for this provider. */ - clientId: Scalars['String']; - /** When the object was created. */ - createdAt: Scalars['DateTime']; - /** ID of the object. */ - id: Scalars['ID']; - /** OpenID Connect issuer URL. */ - issuer: Scalars['String']; -}; +export type UpstreamOAuth2Provider = CreationEvent & + Node & { + __typename?: "UpstreamOAuth2Provider"; + /** Client ID used for this provider. */ + clientId: Scalars["String"]; + /** When the object was created. */ + createdAt: Scalars["DateTime"]; + /** ID of the object. */ + id: Scalars["ID"]; + /** OpenID Connect issuer URL. */ + issuer: Scalars["String"]; + }; export type UpstreamOAuth2ProviderConnection = { - __typename?: 'UpstreamOAuth2ProviderConnection'; + __typename?: "UpstreamOAuth2ProviderConnection"; /** A list of edges. */ edges: Array; /** A list of nodes. */ @@ -436,16 +436,16 @@ export type UpstreamOAuth2ProviderConnection = { /** An edge in a connection. */ export type UpstreamOAuth2ProviderEdge = { - __typename?: 'UpstreamOAuth2ProviderEdge'; + __typename?: "UpstreamOAuth2ProviderEdge"; /** A cursor for use in pagination */ - cursor: Scalars['String']; + cursor: Scalars["String"]; /** The item at the end of the edge */ node: UpstreamOAuth2Provider; }; /** A user is an individual's account. */ export type User = Node & { - __typename?: 'User'; + __typename?: "User"; /** Get the list of active browser sessions, chronologically sorted */ browserSessions: BrowserSessionConnection; /** Get the list of compatibility SSO logins, chronologically sorted */ @@ -453,7 +453,7 @@ export type User = Node & { /** Get the list of emails, chronologically sorted */ emails: UserEmailConnection; /** ID of the object. */ - id: Scalars['ID']; + id: Scalars["ID"]; /** Get the list of OAuth 2.0 sessions, chronologically sorted */ oauth2Sessions: Oauth2SessionConnection; /** Primary email address of the user. */ @@ -461,72 +461,68 @@ export type User = Node & { /** Get the list of upstream OAuth 2.0 links */ upstreamOauth2Links: UpstreamOAuth2LinkConnection; /** Username chosen by the user. */ - username: Scalars['String']; + username: Scalars["String"]; }; - /** A user is an individual's account. */ export type UserBrowserSessionsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; }; - /** A user is an individual's account. */ export type UserCompatSsoLoginsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; }; - /** A user is an individual's account. */ export type UserEmailsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; }; - /** A user is an individual's account. */ export type UserOauth2SessionsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; }; - /** A user is an individual's account. */ export type UserUpstreamOauth2LinksArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; }; /** A user email address */ -export type UserEmail = CreationEvent & Node & { - __typename?: 'UserEmail'; - /** - * When the email address was confirmed. Is `null` if the email was never - * verified by the user. - */ - confirmedAt?: Maybe; - /** When the object was created. */ - createdAt: Scalars['DateTime']; - /** Email address */ - email: Scalars['String']; - /** ID of the object. */ - id: Scalars['ID']; -}; +export type UserEmail = CreationEvent & + Node & { + __typename?: "UserEmail"; + /** + * When the email address was confirmed. Is `null` if the email was never + * verified by the user. + */ + confirmedAt?: Maybe; + /** When the object was created. */ + createdAt: Scalars["DateTime"]; + /** Email address */ + email: Scalars["String"]; + /** ID of the object. */ + id: Scalars["ID"]; + }; export type UserEmailConnection = { - __typename?: 'UserEmailConnection'; + __typename?: "UserEmailConnection"; /** A list of edges. */ edges: Array; /** A list of nodes. */ @@ -534,14 +530,14 @@ export type UserEmailConnection = { /** Information to aid in pagination. */ pageInfo: PageInfo; /** Identifies the total count of items in the connection. */ - totalCount: Scalars['Int']; + totalCount: Scalars["Int"]; }; /** An edge in a connection. */ export type UserEmailEdge = { - __typename?: 'UserEmailEdge'; + __typename?: "UserEmailEdge"; /** A cursor for use in pagination */ - cursor: Scalars['String']; + cursor: Scalars["String"]; /** The item at the end of the edge */ node: UserEmail; }; @@ -549,14 +545,14 @@ export type UserEmailEdge = { /** The input for the `verifyEmail` mutation */ export type VerifyEmailInput = { /** The verification code */ - code: Scalars['String']; + code: Scalars["String"]; /** The ID of the email address to verify */ - userEmailId: Scalars['ID']; + userEmailId: Scalars["ID"]; }; /** The payload of the `verifyEmail` mutation */ export type VerifyEmailPayload = { - __typename?: 'VerifyEmailPayload'; + __typename?: "VerifyEmailPayload"; /** The email address that was verified */ email?: Maybe; /** Status of the operation */ @@ -568,11 +564,11 @@ export type VerifyEmailPayload = { /** The status of the `verifyEmail` mutation */ export enum VerifyEmailStatus { /** The email address was already verified before */ - AlreadyVerified = 'ALREADY_VERIFIED', + AlreadyVerified = "ALREADY_VERIFIED", /** The verification code is invalid */ - InvalidCode = 'INVALID_CODE', + InvalidCode = "INVALID_CODE", /** The email address was just verified */ - Verified = 'VERIFIED' + Verified = "VERIFIED", } /** Represents the current viewer */ @@ -581,123 +577,1973 @@ export type Viewer = Anonymous | User; /** Represents the current viewer's session */ export type ViewerSession = Anonymous | BrowserSession; -export type CurrentViewerQueryQueryVariables = Exact<{ [key: string]: never; }>; +export type CurrentViewerQueryQueryVariables = Exact<{ [key: string]: never }>; +export type CurrentViewerQueryQuery = { + __typename?: "Query"; + viewer: + | { __typename: "Anonymous"; id: string } + | { __typename: "User"; id: string }; +}; -export type CurrentViewerQueryQuery = { __typename?: 'Query', viewer: { __typename: 'Anonymous', id: string } | { __typename: 'User', id: string } }; +export type CurrentViewerSessionQueryQueryVariables = Exact<{ + [key: string]: never; +}>; -export type CurrentViewerSessionQueryQueryVariables = Exact<{ [key: string]: never; }>; - - -export type CurrentViewerSessionQueryQuery = { __typename?: 'Query', viewerSession: { __typename: 'Anonymous', id: string } | { __typename: 'BrowserSession', id: string } }; +export type CurrentViewerSessionQueryQuery = { + __typename?: "Query"; + viewerSession: + | { __typename: "Anonymous"; id: string } + | { __typename: "BrowserSession"; id: string }; +}; export type AddEmailMutationVariables = Exact<{ - userId: Scalars['ID']; - email: Scalars['String']; + userId: Scalars["ID"]; + email: Scalars["String"]; }>; +export type AddEmailMutation = { + __typename?: "Mutation"; + addEmail: { + __typename?: "AddEmailPayload"; + status: AddEmailStatus; + email: { __typename?: "UserEmail"; id: string } & { + " $fragmentRefs"?: { UserEmail_EmailFragment: UserEmail_EmailFragment }; + }; + }; +}; -export type AddEmailMutation = { __typename?: 'Mutation', addEmail: { __typename?: 'AddEmailPayload', status: AddEmailStatus, email: ( - { __typename?: 'UserEmail', id: string } - & { ' $fragmentRefs'?: { 'UserEmail_EmailFragment': UserEmail_EmailFragment } } - ) } }; - -export type BrowserSession_SessionFragment = { __typename?: 'BrowserSession', id: string, createdAt: any, lastAuthentication?: { __typename?: 'Authentication', id: string, createdAt: any } | null } & { ' $fragmentName'?: 'BrowserSession_SessionFragment' }; +export type BrowserSession_SessionFragment = { + __typename?: "BrowserSession"; + id: string; + createdAt: any; + lastAuthentication?: { + __typename?: "Authentication"; + id: string; + createdAt: any; + } | null; +} & { " $fragmentName"?: "BrowserSession_SessionFragment" }; export type BrowserSessionListQueryVariables = Exact<{ - userId: Scalars['ID']; - first?: InputMaybe; - after?: InputMaybe; - last?: InputMaybe; - before?: InputMaybe; + userId: Scalars["ID"]; + first?: InputMaybe; + after?: InputMaybe; + last?: InputMaybe; + before?: InputMaybe; }>; +export type BrowserSessionListQuery = { + __typename?: "Query"; + user?: { + __typename?: "User"; + id: string; + browserSessions: { + __typename?: "BrowserSessionConnection"; + edges: Array<{ + __typename?: "BrowserSessionEdge"; + cursor: string; + node: { __typename?: "BrowserSession"; id: string } & { + " $fragmentRefs"?: { + BrowserSession_SessionFragment: BrowserSession_SessionFragment; + }; + }; + }>; + pageInfo: { + __typename?: "PageInfo"; + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; + }; + }; + } | null; +}; -export type BrowserSessionListQuery = { __typename?: 'Query', user?: { __typename?: 'User', id: string, browserSessions: { __typename?: 'BrowserSessionConnection', edges: Array<{ __typename?: 'BrowserSessionEdge', cursor: string, node: ( - { __typename?: 'BrowserSession', id: string } - & { ' $fragmentRefs'?: { 'BrowserSession_SessionFragment': BrowserSession_SessionFragment } } - ) }>, pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | null, endCursor?: string | null } } } | null }; - -export type CompatSsoLogin_LoginFragment = { __typename?: 'CompatSsoLogin', id: string, redirectUri: any, createdAt: any, session?: { __typename?: 'CompatSession', id: string, createdAt: any, deviceId: string, finishedAt?: any | null } | null } & { ' $fragmentName'?: 'CompatSsoLogin_LoginFragment' }; +export type CompatSsoLogin_LoginFragment = { + __typename?: "CompatSsoLogin"; + id: string; + redirectUri: any; + createdAt: any; + session?: { + __typename?: "CompatSession"; + id: string; + createdAt: any; + deviceId: string; + finishedAt?: any | null; + } | null; +} & { " $fragmentName"?: "CompatSsoLogin_LoginFragment" }; export type CompatSsoLoginListQueryVariables = Exact<{ - userId: Scalars['ID']; - first?: InputMaybe; - after?: InputMaybe; - last?: InputMaybe; - before?: InputMaybe; + userId: Scalars["ID"]; + first?: InputMaybe; + after?: InputMaybe; + last?: InputMaybe; + before?: InputMaybe; }>; +export type CompatSsoLoginListQuery = { + __typename?: "Query"; + user?: { + __typename?: "User"; + id: string; + compatSsoLogins: { + __typename?: "CompatSsoLoginConnection"; + edges: Array<{ + __typename?: "CompatSsoLoginEdge"; + node: { __typename?: "CompatSsoLogin"; id: string } & { + " $fragmentRefs"?: { + CompatSsoLogin_LoginFragment: CompatSsoLogin_LoginFragment; + }; + }; + }>; + pageInfo: { + __typename?: "PageInfo"; + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; + }; + }; + } | null; +}; -export type CompatSsoLoginListQuery = { __typename?: 'Query', user?: { __typename?: 'User', id: string, compatSsoLogins: { __typename?: 'CompatSsoLoginConnection', edges: Array<{ __typename?: 'CompatSsoLoginEdge', node: ( - { __typename?: 'CompatSsoLogin', id: string } - & { ' $fragmentRefs'?: { 'CompatSsoLogin_LoginFragment': CompatSsoLogin_LoginFragment } } - ) }>, pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | null, endCursor?: string | null } } } | null }; - -export type OAuth2Session_SessionFragment = { __typename?: 'Oauth2Session', id: string, scope: string, client: { __typename?: 'Oauth2Client', id: string, clientId: string, clientName?: string | null, clientUri?: any | null } } & { ' $fragmentName'?: 'OAuth2Session_SessionFragment' }; +export type OAuth2Session_SessionFragment = { + __typename?: "Oauth2Session"; + id: string; + scope: string; + client: { + __typename?: "Oauth2Client"; + id: string; + clientId: string; + clientName?: string | null; + clientUri?: any | null; + }; +} & { " $fragmentName"?: "OAuth2Session_SessionFragment" }; export type OAuth2SessionListQueryQueryVariables = Exact<{ - userId: Scalars['ID']; - first?: InputMaybe; - after?: InputMaybe; - last?: InputMaybe; - before?: InputMaybe; + userId: Scalars["ID"]; + first?: InputMaybe; + after?: InputMaybe; + last?: InputMaybe; + before?: InputMaybe; }>; +export type OAuth2SessionListQueryQuery = { + __typename?: "Query"; + user?: { + __typename?: "User"; + id: string; + oauth2Sessions: { + __typename?: "Oauth2SessionConnection"; + edges: Array<{ + __typename?: "Oauth2SessionEdge"; + cursor: string; + node: { __typename?: "Oauth2Session"; id: string } & { + " $fragmentRefs"?: { + OAuth2Session_SessionFragment: OAuth2Session_SessionFragment; + }; + }; + }>; + pageInfo: { + __typename?: "PageInfo"; + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; + }; + }; + } | null; +}; -export type OAuth2SessionListQueryQuery = { __typename?: 'Query', user?: { __typename?: 'User', id: string, oauth2Sessions: { __typename?: 'Oauth2SessionConnection', edges: Array<{ __typename?: 'Oauth2SessionEdge', cursor: string, node: ( - { __typename?: 'Oauth2Session', id: string } - & { ' $fragmentRefs'?: { 'OAuth2Session_SessionFragment': OAuth2Session_SessionFragment } } - ) }>, pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | null, endCursor?: string | null } } } | null }; +export type UserEmail_EmailFragment = { + __typename?: "UserEmail"; + id: string; + email: string; + createdAt: any; + confirmedAt?: any | null; +} & { " $fragmentName"?: "UserEmail_EmailFragment" }; -export type UserEmail_EmailFragment = { __typename?: 'UserEmail', id: string, email: string, createdAt: any, confirmedAt?: any | null } & { ' $fragmentName'?: 'UserEmail_EmailFragment' }; +export type VerifyEmailMutationVariables = Exact<{ + id: Scalars["ID"]; + code: Scalars["String"]; +}>; + +export type VerifyEmailMutation = { + __typename?: "Mutation"; + verifyEmail: { + __typename?: "VerifyEmailPayload"; + status: VerifyEmailStatus; + user?: { + __typename?: "User"; + id: string; + primaryEmail?: { __typename?: "UserEmail"; id: string } | null; + } | null; + email?: + | ({ __typename?: "UserEmail"; id: string } & { + " $fragmentRefs"?: { + UserEmail_EmailFragment: UserEmail_EmailFragment; + }; + }) + | null; + }; +}; + +export type ResendVerificationEmailMutationVariables = Exact<{ + id: Scalars["ID"]; +}>; + +export type ResendVerificationEmailMutation = { + __typename?: "Mutation"; + sendVerificationEmail: { + __typename?: "SendVerificationEmailPayload"; + status: SendVerificationEmailStatus; + user: { + __typename?: "User"; + id: string; + primaryEmail?: { __typename?: "UserEmail"; id: string } | null; + }; + email: { __typename?: "UserEmail"; id: string } & { + " $fragmentRefs"?: { UserEmail_EmailFragment: UserEmail_EmailFragment }; + }; + }; +}; export type UserEmailListQueryQueryVariables = Exact<{ - userId: Scalars['ID']; - first?: InputMaybe; - after?: InputMaybe; - last?: InputMaybe; - before?: InputMaybe; + userId: Scalars["ID"]; + first?: InputMaybe; + after?: InputMaybe; + last?: InputMaybe; + before?: InputMaybe; }>; +export type UserEmailListQueryQuery = { + __typename?: "Query"; + user?: { + __typename?: "User"; + id: string; + emails: { + __typename?: "UserEmailConnection"; + totalCount: number; + edges: Array<{ + __typename?: "UserEmailEdge"; + cursor: string; + node: { __typename?: "UserEmail"; id: string } & { + " $fragmentRefs"?: { + UserEmail_EmailFragment: UserEmail_EmailFragment; + }; + }; + }>; + pageInfo: { + __typename?: "PageInfo"; + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; + }; + }; + } | null; +}; -export type UserEmailListQueryQuery = { __typename?: 'Query', user?: { __typename?: 'User', id: string, emails: { __typename?: 'UserEmailConnection', totalCount: number, edges: Array<{ __typename?: 'UserEmailEdge', cursor: string, node: ( - { __typename?: 'UserEmail', id: string } - & { ' $fragmentRefs'?: { 'UserEmail_EmailFragment': UserEmail_EmailFragment } } - ) }>, pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, startCursor?: string | null, endCursor?: string | null } } } | null }; +export type UserPrimaryEmailQueryVariables = Exact<{ + userId: Scalars["ID"]; +}>; + +export type UserPrimaryEmailQuery = { + __typename?: "Query"; + user?: { + __typename?: "User"; + id: string; + primaryEmail?: { __typename?: "UserEmail"; id: string } | null; + } | null; +}; export type UserGreetingQueryVariables = Exact<{ - userId: Scalars['ID']; + userId: Scalars["ID"]; }>; - -export type UserGreetingQuery = { __typename?: 'Query', user?: { __typename?: 'User', id: string, username: string } | null }; +export type UserGreetingQuery = { + __typename?: "Query"; + user?: { __typename?: "User"; id: string; username: string } | null; +}; export type BrowserSessionQueryQueryVariables = Exact<{ - id: Scalars['ID']; + id: Scalars["ID"]; }>; - -export type BrowserSessionQueryQuery = { __typename?: 'Query', browserSession?: { __typename?: 'BrowserSession', id: string, createdAt: any, lastAuthentication?: { __typename?: 'Authentication', id: string, createdAt: any } | null, user: { __typename?: 'User', id: string, username: string } } | null }; +export type BrowserSessionQueryQuery = { + __typename?: "Query"; + browserSession?: { + __typename?: "BrowserSession"; + id: string; + createdAt: any; + lastAuthentication?: { + __typename?: "Authentication"; + id: string; + createdAt: any; + } | null; + user: { __typename?: "User"; id: string; username: string }; + } | null; +}; export type OAuth2ClientQueryQueryVariables = Exact<{ - id: Scalars['ID']; + id: Scalars["ID"]; }>; +export type OAuth2ClientQueryQuery = { + __typename?: "Query"; + oauth2Client?: { + __typename?: "Oauth2Client"; + id: string; + clientId: string; + clientName?: string | null; + clientUri?: any | null; + tosUri?: any | null; + policyUri?: any | null; + redirectUris: Array; + } | null; +}; -export type OAuth2ClientQueryQuery = { __typename?: 'Query', oauth2Client?: { __typename?: 'Oauth2Client', id: string, clientId: string, clientName?: string | null, clientUri?: any | null, tosUri?: any | null, policyUri?: any | null, redirectUris: Array } | null }; - -export const BrowserSession_SessionFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BrowserSession_session"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BrowserSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"lastAuthentication"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]} as unknown as DocumentNode; -export const CompatSsoLogin_LoginFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CompatSsoLogin_login"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CompatSsoLogin"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"redirectUri"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"deviceId"}},{"kind":"Field","name":{"kind":"Name","value":"finishedAt"}}]}}]}}]} as unknown as DocumentNode; -export const OAuth2Session_SessionFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OAuth2Session_session"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Oauth2Session"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}},{"kind":"Field","name":{"kind":"Name","value":"client"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"clientId"}},{"kind":"Field","name":{"kind":"Name","value":"clientName"}},{"kind":"Field","name":{"kind":"Name","value":"clientUri"}}]}}]}}]} as unknown as DocumentNode; -export const UserEmail_EmailFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserEmail_email"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserEmail"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"confirmedAt"}}]}}]} as unknown as DocumentNode; -export const CurrentViewerQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CurrentViewerQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"viewer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Anonymous"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode; -export const CurrentViewerSessionQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CurrentViewerSessionQuery"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"viewerSession"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BrowserSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Anonymous"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode; -export const AddEmailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AddEmail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"userId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"addEmail"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"userId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"userId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"email"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserEmail_email"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserEmail_email"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserEmail"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"confirmedAt"}}]}}]} as unknown as DocumentNode; -export const BrowserSessionListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BrowserSessionList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"userId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"last"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"before"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"userId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"browserSessions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}},{"kind":"Argument","name":{"kind":"Name","value":"last"},"value":{"kind":"Variable","name":{"kind":"Name","value":"last"}}},{"kind":"Argument","name":{"kind":"Name","value":"before"},"value":{"kind":"Variable","name":{"kind":"Name","value":"before"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"BrowserSession_session"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BrowserSession_session"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BrowserSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"lastAuthentication"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]} as unknown as DocumentNode; -export const CompatSsoLoginListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CompatSsoLoginList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"userId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"last"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"before"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"userId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"compatSsoLogins"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}},{"kind":"Argument","name":{"kind":"Name","value":"last"},"value":{"kind":"Variable","name":{"kind":"Name","value":"last"}}},{"kind":"Argument","name":{"kind":"Name","value":"before"},"value":{"kind":"Variable","name":{"kind":"Name","value":"before"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CompatSsoLogin_login"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CompatSsoLogin_login"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CompatSsoLogin"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"redirectUri"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"deviceId"}},{"kind":"Field","name":{"kind":"Name","value":"finishedAt"}}]}}]}}]} as unknown as DocumentNode; -export const OAuth2SessionListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OAuth2SessionListQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"userId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"last"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"before"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"userId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"oauth2Sessions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}},{"kind":"Argument","name":{"kind":"Name","value":"last"},"value":{"kind":"Variable","name":{"kind":"Name","value":"last"}}},{"kind":"Argument","name":{"kind":"Name","value":"before"},"value":{"kind":"Variable","name":{"kind":"Name","value":"before"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"OAuth2Session_session"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"OAuth2Session_session"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Oauth2Session"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}},{"kind":"Field","name":{"kind":"Name","value":"client"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"clientId"}},{"kind":"Field","name":{"kind":"Name","value":"clientName"}},{"kind":"Field","name":{"kind":"Name","value":"clientUri"}}]}}]}}]} as unknown as DocumentNode; -export const UserEmailListQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UserEmailListQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"userId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"last"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"before"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"userId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"emails"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}},{"kind":"Argument","name":{"kind":"Name","value":"last"},"value":{"kind":"Variable","name":{"kind":"Name","value":"last"}}},{"kind":"Argument","name":{"kind":"Name","value":"before"},"value":{"kind":"Variable","name":{"kind":"Name","value":"before"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserEmail_email"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"hasPreviousPage"}},{"kind":"Field","name":{"kind":"Name","value":"startCursor"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserEmail_email"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserEmail"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"confirmedAt"}}]}}]} as unknown as DocumentNode; -export const UserGreetingDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UserGreeting"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"userId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"userId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}}]}}]}}]} as unknown as DocumentNode; -export const BrowserSessionQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"BrowserSessionQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"browserSession"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"lastAuthentication"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"username"}}]}}]}}]}}]} as unknown as DocumentNode; -export const OAuth2ClientQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"OAuth2ClientQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"oauth2Client"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"clientId"}},{"kind":"Field","name":{"kind":"Name","value":"clientName"}},{"kind":"Field","name":{"kind":"Name","value":"clientUri"}},{"kind":"Field","name":{"kind":"Name","value":"tosUri"}},{"kind":"Field","name":{"kind":"Name","value":"policyUri"}},{"kind":"Field","name":{"kind":"Name","value":"redirectUris"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const BrowserSession_SessionFragmentDoc = { + kind: "Document", + definitions: [ + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "BrowserSession_session" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "BrowserSession" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { + kind: "Field", + name: { kind: "Name", value: "lastAuthentication" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const CompatSsoLogin_LoginFragmentDoc = { + kind: "Document", + definitions: [ + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "CompatSsoLogin_login" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "CompatSsoLogin" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "redirectUri" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { + kind: "Field", + name: { kind: "Name", value: "session" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "deviceId" } }, + { kind: "Field", name: { kind: "Name", value: "finishedAt" } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const OAuth2Session_SessionFragmentDoc = { + kind: "Document", + definitions: [ + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "OAuth2Session_session" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "Oauth2Session" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "scope" } }, + { + kind: "Field", + name: { kind: "Name", value: "client" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "clientId" } }, + { kind: "Field", name: { kind: "Name", value: "clientName" } }, + { kind: "Field", name: { kind: "Name", value: "clientUri" } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const UserEmail_EmailFragmentDoc = { + kind: "Document", + definitions: [ + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "UserEmail_email" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "UserEmail" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "email" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "confirmedAt" } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const CurrentViewerQueryDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "CurrentViewerQuery" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "viewer" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "__typename" } }, + { + kind: "InlineFragment", + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "User" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + ], + }, + }, + { + kind: "InlineFragment", + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "Anonymous" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + CurrentViewerQueryQuery, + CurrentViewerQueryQueryVariables +>; +export const CurrentViewerSessionQueryDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "CurrentViewerSessionQuery" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "viewerSession" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "__typename" } }, + { + kind: "InlineFragment", + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "BrowserSession" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + ], + }, + }, + { + kind: "InlineFragment", + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "Anonymous" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + CurrentViewerSessionQueryQuery, + CurrentViewerSessionQueryQueryVariables +>; +export const AddEmailDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "mutation", + name: { kind: "Name", value: "AddEmail" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "email" }, + }, + type: { + kind: "NonNullType", + type: { + kind: "NamedType", + name: { kind: "Name", value: "String" }, + }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "addEmail" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "input" }, + value: { + kind: "ObjectValue", + fields: [ + { + kind: "ObjectField", + name: { kind: "Name", value: "userId" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + }, + { + kind: "ObjectField", + name: { kind: "Name", value: "email" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "email" }, + }, + }, + ], + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "status" } }, + { + kind: "Field", + name: { kind: "Name", value: "email" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "FragmentSpread", + name: { kind: "Name", value: "UserEmail_email" }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "UserEmail_email" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "UserEmail" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "email" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "confirmedAt" } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const BrowserSessionListDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "BrowserSessionList" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "first" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "after" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, + }, + { + kind: "VariableDefinition", + variable: { kind: "Variable", name: { kind: "Name", value: "last" } }, + type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "before" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "user" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "id" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "Field", + name: { kind: "Name", value: "browserSessions" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "first" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "first" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "after" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "after" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "last" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "last" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "before" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "before" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "edges" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "cursor" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "node" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "id" }, + }, + { + kind: "FragmentSpread", + name: { + kind: "Name", + value: "BrowserSession_session", + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "Field", + name: { kind: "Name", value: "pageInfo" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "hasNextPage" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "hasPreviousPage" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "startCursor" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "endCursor" }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "BrowserSession_session" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "BrowserSession" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { + kind: "Field", + name: { kind: "Name", value: "lastAuthentication" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BrowserSessionListQuery, + BrowserSessionListQueryVariables +>; +export const CompatSsoLoginListDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "CompatSsoLoginList" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "first" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "after" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, + }, + { + kind: "VariableDefinition", + variable: { kind: "Variable", name: { kind: "Name", value: "last" } }, + type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "before" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "user" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "id" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "Field", + name: { kind: "Name", value: "compatSsoLogins" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "first" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "first" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "after" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "after" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "last" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "last" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "before" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "before" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "edges" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "node" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "id" }, + }, + { + kind: "FragmentSpread", + name: { + kind: "Name", + value: "CompatSsoLogin_login", + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "Field", + name: { kind: "Name", value: "pageInfo" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "hasNextPage" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "hasPreviousPage" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "startCursor" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "endCursor" }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "CompatSsoLogin_login" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "CompatSsoLogin" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "redirectUri" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { + kind: "Field", + name: { kind: "Name", value: "session" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "deviceId" } }, + { kind: "Field", name: { kind: "Name", value: "finishedAt" } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + CompatSsoLoginListQuery, + CompatSsoLoginListQueryVariables +>; +export const OAuth2SessionListQueryDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "OAuth2SessionListQuery" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "first" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "after" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, + }, + { + kind: "VariableDefinition", + variable: { kind: "Variable", name: { kind: "Name", value: "last" } }, + type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "before" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "user" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "id" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "Field", + name: { kind: "Name", value: "oauth2Sessions" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "first" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "first" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "after" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "after" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "last" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "last" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "before" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "before" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "edges" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "cursor" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "node" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "id" }, + }, + { + kind: "FragmentSpread", + name: { + kind: "Name", + value: "OAuth2Session_session", + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "Field", + name: { kind: "Name", value: "pageInfo" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "hasNextPage" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "hasPreviousPage" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "startCursor" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "endCursor" }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "OAuth2Session_session" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "Oauth2Session" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "scope" } }, + { + kind: "Field", + name: { kind: "Name", value: "client" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "clientId" } }, + { kind: "Field", name: { kind: "Name", value: "clientName" } }, + { kind: "Field", name: { kind: "Name", value: "clientUri" } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + OAuth2SessionListQueryQuery, + OAuth2SessionListQueryQueryVariables +>; +export const VerifyEmailDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "mutation", + name: { kind: "Name", value: "VerifyEmail" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + { + kind: "VariableDefinition", + variable: { kind: "Variable", name: { kind: "Name", value: "code" } }, + type: { + kind: "NonNullType", + type: { + kind: "NamedType", + name: { kind: "Name", value: "String" }, + }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "verifyEmail" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "input" }, + value: { + kind: "ObjectValue", + fields: [ + { + kind: "ObjectField", + name: { kind: "Name", value: "userEmailId" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "id" }, + }, + }, + { + kind: "ObjectField", + name: { kind: "Name", value: "code" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "code" }, + }, + }, + ], + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "status" } }, + { + kind: "Field", + name: { kind: "Name", value: "user" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "Field", + name: { kind: "Name", value: "primaryEmail" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "id" }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "Field", + name: { kind: "Name", value: "email" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "FragmentSpread", + name: { kind: "Name", value: "UserEmail_email" }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "UserEmail_email" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "UserEmail" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "email" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "confirmedAt" } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const ResendVerificationEmailDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "mutation", + name: { kind: "Name", value: "ResendVerificationEmail" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "sendVerificationEmail" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "input" }, + value: { + kind: "ObjectValue", + fields: [ + { + kind: "ObjectField", + name: { kind: "Name", value: "userEmailId" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "id" }, + }, + }, + ], + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "status" } }, + { + kind: "Field", + name: { kind: "Name", value: "user" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "Field", + name: { kind: "Name", value: "primaryEmail" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "id" }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "Field", + name: { kind: "Name", value: "email" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "FragmentSpread", + name: { kind: "Name", value: "UserEmail_email" }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "UserEmail_email" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "UserEmail" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "email" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "confirmedAt" } }, + ], + }, + }, + ], +} as unknown as DocumentNode< + ResendVerificationEmailMutation, + ResendVerificationEmailMutationVariables +>; +export const UserEmailListQueryDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "UserEmailListQuery" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "first" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "after" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, + }, + { + kind: "VariableDefinition", + variable: { kind: "Variable", name: { kind: "Name", value: "last" } }, + type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, + }, + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "before" }, + }, + type: { kind: "NamedType", name: { kind: "Name", value: "String" } }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "user" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "id" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "Field", + name: { kind: "Name", value: "emails" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "first" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "first" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "after" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "after" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "last" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "last" }, + }, + }, + { + kind: "Argument", + name: { kind: "Name", value: "before" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "before" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "edges" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "cursor" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "node" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "id" }, + }, + { + kind: "FragmentSpread", + name: { + kind: "Name", + value: "UserEmail_email", + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "Field", + name: { kind: "Name", value: "totalCount" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "pageInfo" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "hasNextPage" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "hasPreviousPage" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "startCursor" }, + }, + { + kind: "Field", + name: { kind: "Name", value: "endCursor" }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "UserEmail_email" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "UserEmail" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "email" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { kind: "Field", name: { kind: "Name", value: "confirmedAt" } }, + ], + }, + }, + ], +} as unknown as DocumentNode< + UserEmailListQueryQuery, + UserEmailListQueryQueryVariables +>; +export const UserPrimaryEmailDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "UserPrimaryEmail" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "user" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "id" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "Field", + name: { kind: "Name", value: "primaryEmail" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + UserPrimaryEmailQuery, + UserPrimaryEmailQueryVariables +>; +export const UserGreetingDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "UserGreeting" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "user" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "id" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "userId" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "username" } }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const BrowserSessionQueryDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "BrowserSessionQuery" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "browserSession" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "id" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "id" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "createdAt" } }, + { + kind: "Field", + name: { kind: "Name", value: "lastAuthentication" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "Field", + name: { kind: "Name", value: "createdAt" }, + }, + ], + }, + }, + { + kind: "Field", + name: { kind: "Name", value: "user" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "Field", + name: { kind: "Name", value: "username" }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + BrowserSessionQueryQuery, + BrowserSessionQueryQueryVariables +>; +export const OAuth2ClientQueryDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "OAuth2ClientQuery" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "oauth2Client" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "id" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "id" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "clientId" } }, + { kind: "Field", name: { kind: "Name", value: "clientName" } }, + { kind: "Field", name: { kind: "Name", value: "clientUri" } }, + { kind: "Field", name: { kind: "Name", value: "tosUri" } }, + { kind: "Field", name: { kind: "Name", value: "policyUri" } }, + { + kind: "Field", + name: { kind: "Name", value: "redirectUris" }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + OAuth2ClientQueryQuery, + OAuth2ClientQueryQueryVariables +>; diff --git a/frontend/src/pages/Account.tsx b/frontend/src/pages/Account.tsx index 897a18fb..59300f5f 100644 --- a/frontend/src/pages/Account.tsx +++ b/frontend/src/pages/Account.tsx @@ -15,15 +15,19 @@ import { useAtomValue } from "jotai"; import { currentUserIdAtom } from "../atoms"; -import AddEmailForm from "../components/AddEmailForm"; +import AddEmailForm, { addUserEmailAtom } from "../components/AddEmailForm"; import UserEmailList from "../components/UserEmailList"; import UserGreeting from "../components/UserGreeting"; const UserAccount: React.FC<{ id: string }> = ({ id }) => { + const addUserEmail = useAtomValue(addUserEmailAtom); return (
- +
); diff --git a/frontend/src/pagination.ts b/frontend/src/pagination.ts index 1188bdfe..8a3a12c1 100644 --- a/frontend/src/pagination.ts +++ b/frontend/src/pagination.ts @@ -16,6 +16,10 @@ import { atom, Atom } from "jotai"; import { PageInfo } from "./gql/graphql"; +export const FIRST_PAGE = Symbol("FIRST_PAGE"); +export const LAST_PAGE = Symbol("LAST_PAGE"); +const EMPTY = Symbol("EMPTY"); + export type ForwardPagination = { first: number; after: string | null; @@ -45,6 +49,42 @@ export const isBackwardPagination = ( // This atom sets the default page size for pagination. export const pageSizeAtom = atom(6); +export const atomForCurrentPagination = () => { + const dataAtom = atom(EMPTY); + + const currentPaginationAtom = atom( + (get) => { + const data = get(dataAtom); + if (data === EMPTY) { + return { + first: get(pageSizeAtom), + after: null, + }; + } + + return data; + }, + (get, set, action: Pagination | typeof FIRST_PAGE | typeof LAST_PAGE) => { + if (action === FIRST_PAGE) { + set(dataAtom, EMPTY); + } else if (action === LAST_PAGE) { + set(dataAtom, { + last: get(pageSizeAtom), + before: null, + }); + } else { + set(dataAtom, action); + } + } + ); + + currentPaginationAtom.onMount = (setAtom) => { + setAtom(FIRST_PAGE); + }; + + return currentPaginationAtom; +}; + // This atom is used to create a pagination atom that gives the previous and // next pagination objects, given the current pagination and the page info. export const atomWithPagination = (