diff --git a/packages/graphql-api/codegen.yml b/packages/graphql-api/codegen.yml index 7baab3ec6..9e54d5b3f 100644 --- a/packages/graphql-api/codegen.yml +++ b/packages/graphql-api/codegen.yml @@ -9,4 +9,14 @@ generates: - add: /* tslint:disable */ - typescript - typescript-resolvers - - typescript-operations \ No newline at end of file + - typescript-operations + ./src/type-graphql.ts: + config: + noNamespaces: true +# declarationType: +# type: "abstract class" +# decoratorName: +# type: "InterfaceType" + plugins: + - add: /* tslint:disable */ + - typescript-type-graphql \ No newline at end of file diff --git a/packages/graphql-api/src/type-graphql.ts b/packages/graphql-api/src/type-graphql.ts new file mode 100644 index 000000000..043251908 --- /dev/null +++ b/packages/graphql-api/src/type-graphql.ts @@ -0,0 +1,234 @@ +/* tslint:disable */ +import * as TypeGraphQL from 'type-graphql'; +export type Maybe = T | null; +type FixDecorator = T; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; +}; + +export type AuthenticateParamsInput = { + access_token?: Maybe; + access_token_secret?: Maybe; + provider?: Maybe; + password?: Maybe; + user?: Maybe; + code?: Maybe; +}; + +export type CreateUserInput = { + username?: Maybe; + email?: Maybe; + password?: Maybe; +}; + +@TypeGraphQL.ObjectType() +export class EmailRecord { + __typename?: 'EmailRecord'; + + @TypeGraphQL.Field(type => String, { nullable: true }) + address!: Maybe; + + @TypeGraphQL.Field(type => Boolean, { nullable: true }) + verified!: Maybe; +} + +@TypeGraphQL.ObjectType() +export class ImpersonateReturn { + __typename?: 'ImpersonateReturn'; + + @TypeGraphQL.Field(type => Boolean, { nullable: true }) + authorized!: Maybe; + + @TypeGraphQL.Field(type => Tokens, { nullable: true }) + tokens!: Maybe; + + @TypeGraphQL.Field(type => User, { nullable: true }) + user!: Maybe; +} + +@TypeGraphQL.ObjectType() +export class LoginResult { + __typename?: 'LoginResult'; + + @TypeGraphQL.Field(type => String, { nullable: true }) + sessionId!: Maybe; + + @TypeGraphQL.Field(type => Tokens, { nullable: true }) + tokens!: Maybe; +} + +export class Mutation { + __typename?: 'Mutation'; + + @TypeGraphQL.Field(type => TypeGraphQL.ID, { nullable: true }) + createUser!: Maybe; + + @TypeGraphQL.Field(type => Boolean, { nullable: true }) + verifyEmail!: Maybe; + + @TypeGraphQL.Field(type => LoginResult, { nullable: true }) + resetPassword!: Maybe; + + @TypeGraphQL.Field(type => Boolean, { nullable: true }) + sendVerificationEmail!: Maybe; + + @TypeGraphQL.Field(type => Boolean, { nullable: true }) + sendResetPasswordEmail!: Maybe; + + @TypeGraphQL.Field(type => Boolean, { nullable: true }) + changePassword!: Maybe; + + @TypeGraphQL.Field(type => Boolean, { nullable: true }) + twoFactorSet!: Maybe; + + @TypeGraphQL.Field(type => Boolean, { nullable: true }) + twoFactorUnset!: Maybe; + + @TypeGraphQL.Field(type => ImpersonateReturn, { nullable: true }) + impersonate!: Maybe; + + @TypeGraphQL.Field(type => LoginResult, { nullable: true }) + refreshTokens!: Maybe; + + @TypeGraphQL.Field(type => Boolean, { nullable: true }) + logout!: Maybe; + + @TypeGraphQL.Field(type => LoginResult, { nullable: true }) + authenticate!: Maybe; +} + +export type MutationCreateUserArgs = { + user: CreateUserInput; +}; + +export type MutationVerifyEmailArgs = { + token: Scalars['String']; +}; + +export type MutationResetPasswordArgs = { + token: Scalars['String']; + newPassword: Scalars['String']; +}; + +export type MutationSendVerificationEmailArgs = { + email: Scalars['String']; +}; + +export type MutationSendResetPasswordEmailArgs = { + email: Scalars['String']; +}; + +export type MutationChangePasswordArgs = { + oldPassword: Scalars['String']; + newPassword: Scalars['String']; +}; + +export type MutationTwoFactorSetArgs = { + secret: TwoFactorSecretKeyInput; + code: Scalars['String']; +}; + +export type MutationTwoFactorUnsetArgs = { + code: Scalars['String']; +}; + +export type MutationImpersonateArgs = { + accessToken: Scalars['String']; + username: Scalars['String']; +}; + +export type MutationRefreshTokensArgs = { + accessToken: Scalars['String']; + refreshToken: Scalars['String']; +}; + +export type MutationAuthenticateArgs = { + serviceName: Scalars['String']; + params: AuthenticateParamsInput; +}; + +export class Query { + __typename?: 'Query'; + + @TypeGraphQL.Field(type => TwoFactorSecretKey, { nullable: true }) + twoFactorSecret!: Maybe; + + @TypeGraphQL.Field(type => User, { nullable: true }) + getUser!: Maybe; +} + +@TypeGraphQL.ObjectType() +export class Tokens { + __typename?: 'Tokens'; + + @TypeGraphQL.Field(type => String, { nullable: true }) + refreshToken!: Maybe; + + @TypeGraphQL.Field(type => String, { nullable: true }) + accessToken!: Maybe; +} + +@TypeGraphQL.ObjectType() +export class TwoFactorSecretKey { + __typename?: 'TwoFactorSecretKey'; + + @TypeGraphQL.Field(type => String, { nullable: true }) + ascii!: Maybe; + + @TypeGraphQL.Field(type => String, { nullable: true }) + base32!: Maybe; + + @TypeGraphQL.Field(type => String, { nullable: true }) + hex!: Maybe; + + @TypeGraphQL.Field(type => String, { nullable: true }) + qr_code_ascii!: Maybe; + + @TypeGraphQL.Field(type => String, { nullable: true }) + qr_code_hex!: Maybe; + + @TypeGraphQL.Field(type => String, { nullable: true }) + qr_code_base32!: Maybe; + + @TypeGraphQL.Field(type => String, { nullable: true }) + google_auth_qr!: Maybe; + + @TypeGraphQL.Field(type => String, { nullable: true }) + otpauth_url!: Maybe; +} + +export type TwoFactorSecretKeyInput = { + ascii?: Maybe; + base32?: Maybe; + hex?: Maybe; + qr_code_ascii?: Maybe; + qr_code_hex?: Maybe; + qr_code_base32?: Maybe; + google_auth_qr?: Maybe; + otpauth_url?: Maybe; +}; + +@TypeGraphQL.ObjectType() +export class User { + __typename?: 'User'; + + @TypeGraphQL.Field(type => TypeGraphQL.ID) + id!: Scalars['ID']; + + @TypeGraphQL.Field(type => [EmailRecord], { nullable: true }) + emails!: Maybe>; + + @TypeGraphQL.Field(type => String, { nullable: true }) + username!: Maybe; +} + +export type UserInput = { + id?: Maybe; + email?: Maybe; + username?: Maybe; +}; diff --git a/packages/graphql-api/tsconfig.json b/packages/graphql-api/tsconfig.json index 9ff9c2e86..5844cf062 100644 --- a/packages/graphql-api/tsconfig.json +++ b/packages/graphql-api/tsconfig.json @@ -5,6 +5,7 @@ "outDir": "./lib", "noUnusedParameters": false, "noUnusedLocals": false, + "experimentalDecorators": true, "importHelpers": true }, "exclude": ["node_modules", "__tests__", "lib"]