2021-07-08 12:15:19 +00:00
|
|
|
# GraphQL schema example
|
|
|
|
#
|
|
|
|
# https://gqlgen.com/getting-started/
|
2021-07-12 18:22:16 +00:00
|
|
|
scalar Int64
|
2021-09-20 05:06:26 +00:00
|
|
|
scalar Map
|
|
|
|
scalar Any
|
2021-07-08 12:15:19 +00:00
|
|
|
|
2021-07-28 07:55:52 +00:00
|
|
|
type Meta {
|
2021-08-06 13:47:52 +00:00
|
|
|
version: String!
|
2021-12-22 05:21:12 +00:00
|
|
|
is_google_login_enabled: Boolean!
|
|
|
|
is_facebook_login_enabled: Boolean!
|
|
|
|
is_github_login_enabled: Boolean!
|
|
|
|
is_email_verification_enabled: Boolean!
|
|
|
|
is_basic_authentication_enabled: Boolean!
|
|
|
|
is_magic_link_login_enabled: Boolean!
|
2021-07-28 07:55:52 +00:00
|
|
|
}
|
|
|
|
|
2021-07-12 18:22:16 +00:00
|
|
|
type User {
|
2021-08-06 13:47:52 +00:00
|
|
|
id: ID!
|
|
|
|
email: String!
|
2021-12-22 05:21:12 +00:00
|
|
|
email_verified: Boolean!
|
|
|
|
signup_methods: String!
|
|
|
|
given_name: String
|
|
|
|
family_name: String
|
|
|
|
middle_name: String
|
|
|
|
nickname: String
|
|
|
|
# defaults to email
|
|
|
|
preferred_username: String
|
|
|
|
gender: String
|
|
|
|
birthdate: String
|
|
|
|
phone_number: String
|
|
|
|
phone_number_verified: Boolean
|
|
|
|
picture: String
|
2021-09-20 05:06:26 +00:00
|
|
|
roles: [String!]!
|
2021-12-22 05:21:12 +00:00
|
|
|
created_at: Int64
|
|
|
|
updated_at: Int64
|
2021-07-08 12:15:19 +00:00
|
|
|
}
|
|
|
|
|
2021-07-12 18:22:16 +00:00
|
|
|
type VerificationRequest {
|
2021-08-06 13:47:52 +00:00
|
|
|
id: ID!
|
|
|
|
identifier: String
|
|
|
|
token: String
|
|
|
|
email: String
|
|
|
|
expires: Int64
|
2021-12-22 05:21:12 +00:00
|
|
|
created_at: Int64
|
|
|
|
updated_at: Int64
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Error {
|
2021-08-06 13:47:52 +00:00
|
|
|
message: String!
|
|
|
|
reason: String!
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|
|
|
|
|
2021-07-28 10:13:08 +00:00
|
|
|
type AuthResponse {
|
2021-08-06 13:47:52 +00:00
|
|
|
message: String!
|
2021-12-22 05:21:12 +00:00
|
|
|
access_token: String
|
|
|
|
expires_at: Int64
|
2021-08-06 13:47:52 +00:00
|
|
|
user: User
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|
|
|
|
|
2021-07-15 09:43:00 +00:00
|
|
|
type Response {
|
2021-08-06 13:47:52 +00:00
|
|
|
message: String!
|
2021-07-15 09:43:00 +00:00
|
|
|
}
|
|
|
|
|
2022-01-23 19:02:06 +00:00
|
|
|
type ValidJWTResponse {
|
|
|
|
valid: Boolean!
|
|
|
|
message: String!
|
|
|
|
}
|
|
|
|
|
2022-01-17 07:42:46 +00:00
|
|
|
type Env {
|
2021-12-31 11:33:37 +00:00
|
|
|
ADMIN_SECRET: String
|
2022-01-24 04:52:55 +00:00
|
|
|
DATABASE_NAME: String
|
|
|
|
DATABASE_URL: String
|
|
|
|
DATABASE_TYPE: String
|
|
|
|
CUSTOM_ACCESS_TOKEN_SCRIPT: String
|
2021-12-31 11:33:37 +00:00
|
|
|
SMTP_HOST: String
|
|
|
|
SMTP_PORT: String
|
2022-01-08 06:13:12 +00:00
|
|
|
SMTP_USERNAME: String
|
|
|
|
SMTP_PASSWORD: String
|
2021-12-31 11:33:37 +00:00
|
|
|
SENDER_EMAIL: String
|
|
|
|
JWT_TYPE: String
|
|
|
|
JWT_SECRET: String
|
|
|
|
ALLOWED_ORIGINS: [String!]
|
|
|
|
AUTHORIZER_URL: String
|
|
|
|
APP_URL: String
|
|
|
|
REDIS_URL: String
|
|
|
|
COOKIE_NAME: String
|
|
|
|
RESET_PASSWORD_URL: String
|
|
|
|
DISABLE_EMAIL_VERIFICATION: Boolean
|
|
|
|
DISABLE_BASIC_AUTHENTICATION: Boolean
|
|
|
|
DISABLE_MAGIC_LINK_LOGIN: Boolean
|
|
|
|
DISABLE_LOGIN_PAGE: Boolean
|
|
|
|
ROLES: [String!]
|
|
|
|
PROTECTED_ROLES: [String!]
|
|
|
|
DEFAULT_ROLES: [String!]
|
|
|
|
JWT_ROLE_CLAIM: String
|
|
|
|
GOOGLE_CLIENT_ID: String
|
|
|
|
GOOGLE_CLIENT_SECRET: String
|
|
|
|
GITHUB_CLIENT_ID: String
|
|
|
|
GITHUB_CLIENT_SECRET: String
|
|
|
|
FACEBOOK_CLIENT_ID: String
|
|
|
|
FACEBOOK_CLIENT_SECRET: String
|
|
|
|
ORGANIZATION_NAME: String
|
|
|
|
ORGANIZATION_LOGO: String
|
|
|
|
}
|
|
|
|
|
2022-01-17 07:42:46 +00:00
|
|
|
input UpdateEnvInput {
|
2021-12-31 11:33:37 +00:00
|
|
|
ADMIN_SECRET: String
|
2022-01-24 04:52:55 +00:00
|
|
|
CUSTOM_ACCESS_TOKEN_SCRIPT: String
|
2022-01-17 07:50:32 +00:00
|
|
|
OLD_ADMIN_SECRET: String
|
2021-12-31 11:33:37 +00:00
|
|
|
SMTP_HOST: String
|
|
|
|
SMTP_PORT: String
|
2022-01-24 15:46:29 +00:00
|
|
|
SMTP_USERNAME: String
|
|
|
|
SMTP_PASSWORD: String
|
2021-12-31 11:33:37 +00:00
|
|
|
SENDER_EMAIL: String
|
|
|
|
JWT_TYPE: String
|
|
|
|
JWT_SECRET: String
|
|
|
|
ALLOWED_ORIGINS: [String!]
|
|
|
|
AUTHORIZER_URL: String
|
|
|
|
APP_URL: String
|
|
|
|
REDIS_URL: String
|
|
|
|
COOKIE_NAME: String
|
|
|
|
RESET_PASSWORD_URL: String
|
|
|
|
DISABLE_EMAIL_VERIFICATION: Boolean
|
|
|
|
DISABLE_BASIC_AUTHENTICATION: Boolean
|
|
|
|
DISABLE_MAGIC_LINK_LOGIN: Boolean
|
|
|
|
DISABLE_LOGIN_PAGE: Boolean
|
|
|
|
ROLES: [String!]
|
|
|
|
PROTECTED_ROLES: [String!]
|
|
|
|
DEFAULT_ROLES: [String!]
|
|
|
|
JWT_ROLE_CLAIM: String
|
|
|
|
GOOGLE_CLIENT_ID: String
|
|
|
|
GOOGLE_CLIENT_SECRET: String
|
|
|
|
GITHUB_CLIENT_ID: String
|
|
|
|
GITHUB_CLIENT_SECRET: String
|
|
|
|
FACEBOOK_CLIENT_ID: String
|
|
|
|
FACEBOOK_CLIENT_SECRET: String
|
|
|
|
ORGANIZATION_NAME: String
|
|
|
|
ORGANIZATION_LOGO: String
|
|
|
|
}
|
|
|
|
|
2021-12-30 04:31:51 +00:00
|
|
|
input AdminLoginInput {
|
|
|
|
admin_secret: String!
|
|
|
|
}
|
|
|
|
|
2022-01-09 13:10:30 +00:00
|
|
|
input AdminSignupInput {
|
|
|
|
admin_secret: String!
|
|
|
|
}
|
|
|
|
|
2021-07-15 09:43:00 +00:00
|
|
|
input SignUpInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
email: String!
|
2021-12-22 05:21:12 +00:00
|
|
|
given_name: String
|
|
|
|
family_name: String
|
|
|
|
middle_name: String
|
|
|
|
nickname: String
|
|
|
|
gender: String
|
|
|
|
birthdate: String
|
|
|
|
phone_number: String
|
|
|
|
picture: String
|
2021-08-06 13:47:52 +00:00
|
|
|
password: String!
|
2021-12-22 05:21:12 +00:00
|
|
|
confirm_password: String!
|
2021-10-13 16:41:41 +00:00
|
|
|
roles: [String!]
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|
|
|
|
|
2021-07-14 18:43:19 +00:00
|
|
|
input LoginInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
email: String!
|
|
|
|
password: String!
|
2021-10-13 16:41:41 +00:00
|
|
|
roles: [String!]
|
2021-07-08 12:15:19 +00:00
|
|
|
}
|
|
|
|
|
2021-07-18 03:55:20 +00:00
|
|
|
input VerifyEmailInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
token: String!
|
2021-07-13 20:06:11 +00:00
|
|
|
}
|
|
|
|
|
2021-07-18 07:26:17 +00:00
|
|
|
input ResendVerifyEmailInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
email: String!
|
2021-12-23 05:01:52 +00:00
|
|
|
identifier: String!
|
2021-07-18 07:26:17 +00:00
|
|
|
}
|
|
|
|
|
2021-07-18 03:55:20 +00:00
|
|
|
input UpdateProfileInput {
|
2021-12-22 05:21:12 +00:00
|
|
|
old_password: String
|
|
|
|
new_password: String
|
|
|
|
confirm_new_password: String
|
2021-08-06 13:47:52 +00:00
|
|
|
email: String
|
2021-12-22 05:21:12 +00:00
|
|
|
given_name: String
|
|
|
|
family_name: String
|
|
|
|
middle_name: String
|
|
|
|
nickname: String
|
|
|
|
gender: String
|
|
|
|
birthdate: String
|
|
|
|
phone_number: String
|
|
|
|
picture: String
|
2021-07-18 03:55:20 +00:00
|
|
|
}
|
|
|
|
|
2021-12-22 05:21:12 +00:00
|
|
|
input UpdateUserInput {
|
2021-10-13 16:41:41 +00:00
|
|
|
id: ID!
|
|
|
|
email: String
|
2022-01-17 06:02:13 +00:00
|
|
|
email_verified: Boolean
|
2021-12-22 05:21:12 +00:00
|
|
|
given_name: String
|
|
|
|
family_name: String
|
|
|
|
middle_name: String
|
|
|
|
nickname: String
|
|
|
|
gender: String
|
|
|
|
birthdate: String
|
|
|
|
phone_number: String
|
|
|
|
picture: String
|
2021-10-13 16:41:41 +00:00
|
|
|
roles: [String]
|
2021-09-21 02:53:40 +00:00
|
|
|
}
|
|
|
|
|
2021-07-21 08:06:26 +00:00
|
|
|
input ForgotPasswordInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
email: String!
|
2021-07-18 09:56:29 +00:00
|
|
|
}
|
|
|
|
|
2021-08-07 08:41:26 +00:00
|
|
|
input ResetPasswordInput {
|
2021-08-06 13:47:52 +00:00
|
|
|
token: String!
|
|
|
|
password: String!
|
2021-12-22 05:21:12 +00:00
|
|
|
confirm_password: String!
|
2021-08-06 13:47:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
input DeleteUserInput {
|
|
|
|
email: String!
|
2021-07-18 09:56:29 +00:00
|
|
|
}
|
|
|
|
|
2021-12-22 05:21:12 +00:00
|
|
|
input MagicLinkLoginInput {
|
2021-11-11 23:52:03 +00:00
|
|
|
email: String!
|
|
|
|
roles: [String!]
|
|
|
|
}
|
|
|
|
|
2022-01-23 19:02:06 +00:00
|
|
|
input SessionQueryInput {
|
|
|
|
roles: [String!]
|
|
|
|
}
|
|
|
|
|
|
|
|
input IsValidJWTQueryInput {
|
2022-01-24 04:26:12 +00:00
|
|
|
jwt: String
|
2022-01-23 19:02:06 +00:00
|
|
|
roles: [String!]
|
|
|
|
}
|
|
|
|
|
2021-07-08 12:15:19 +00:00
|
|
|
type Mutation {
|
2021-08-06 13:47:52 +00:00
|
|
|
signup(params: SignUpInput!): AuthResponse!
|
|
|
|
login(params: LoginInput!): AuthResponse!
|
2021-12-22 05:21:12 +00:00
|
|
|
magic_link_login(params: MagicLinkLoginInput!): Response!
|
2021-08-06 13:47:52 +00:00
|
|
|
logout: Response!
|
2021-12-22 05:21:12 +00:00
|
|
|
update_profile(params: UpdateProfileInput!): Response!
|
|
|
|
verify_email(params: VerifyEmailInput!): AuthResponse!
|
|
|
|
resend_verify_email(params: ResendVerifyEmailInput!): Response!
|
|
|
|
forgot_password(params: ForgotPasswordInput!): Response!
|
|
|
|
reset_password(params: ResetPasswordInput!): Response!
|
|
|
|
# admin only apis
|
|
|
|
_delete_user(params: DeleteUserInput!): Response!
|
|
|
|
_update_user(params: UpdateUserInput!): User!
|
2022-01-09 13:10:30 +00:00
|
|
|
_admin_signup(params: AdminSignupInput!): Response!
|
|
|
|
_admin_login(params: AdminLoginInput!): Response!
|
2021-12-31 17:36:06 +00:00
|
|
|
_admin_logout: Response!
|
2022-01-17 07:42:46 +00:00
|
|
|
_update_env(params: UpdateEnvInput!): Response!
|
2021-07-14 18:43:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Query {
|
2021-08-06 13:47:52 +00:00
|
|
|
meta: Meta!
|
2022-01-23 19:02:06 +00:00
|
|
|
session(params: SessionQueryInput): AuthResponse!
|
|
|
|
is_valid_jwt(params: IsValidJWTQueryInput): ValidJWTResponse!
|
2021-08-06 13:47:52 +00:00
|
|
|
profile: User!
|
2021-12-22 05:21:12 +00:00
|
|
|
# admin only apis
|
|
|
|
_users: [User!]!
|
|
|
|
_verification_requests: [VerificationRequest!]!
|
2022-01-09 13:10:30 +00:00
|
|
|
_admin_session: Response!
|
2022-01-17 07:42:46 +00:00
|
|
|
_env: Env!
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|