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
|
|
|
|
2022-01-25 05:27:40 +00:00
|
|
|
type Pagination {
|
|
|
|
limit: Int64!
|
|
|
|
page: Int64!
|
|
|
|
offset: Int64!
|
|
|
|
total: Int64!
|
|
|
|
}
|
|
|
|
|
2021-07-28 07:55:52 +00:00
|
|
|
type Meta {
|
2021-08-06 13:47:52 +00:00
|
|
|
version: String!
|
2022-02-26 15:06:22 +00:00
|
|
|
client_id: String!
|
2021-12-22 05:21:12 +00:00
|
|
|
is_google_login_enabled: Boolean!
|
|
|
|
is_facebook_login_enabled: Boolean!
|
|
|
|
is_github_login_enabled: Boolean!
|
2022-06-06 16:38:32 +00:00
|
|
|
is_linkedin_login_enabled: Boolean!
|
2022-06-12 09:19:48 +00:00
|
|
|
is_apple_login_enabled: Boolean!
|
2021-12-22 05:21:12 +00:00
|
|
|
is_email_verification_enabled: Boolean!
|
|
|
|
is_basic_authentication_enabled: Boolean!
|
|
|
|
is_magic_link_login_enabled: Boolean!
|
2022-03-16 17:19:18 +00:00
|
|
|
is_sign_up_enabled: Boolean!
|
2022-06-18 10:01:57 +00:00
|
|
|
is_strong_password_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
|
2022-03-24 08:43:55 +00:00
|
|
|
revoked_timestamp: Int64
|
2021-07-08 12:15:19 +00:00
|
|
|
}
|
|
|
|
|
2022-01-25 05:27:40 +00:00
|
|
|
type Users {
|
|
|
|
pagination: Pagination!
|
|
|
|
users: [User!]!
|
|
|
|
}
|
|
|
|
|
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
|
2022-03-08 07:06:26 +00:00
|
|
|
nonce: String
|
|
|
|
redirect_uri: String
|
2021-07-12 18:22:16 +00:00
|
|
|
}
|
|
|
|
|
2022-01-25 05:27:40 +00:00
|
|
|
type VerificationRequests {
|
|
|
|
pagination: Pagination!
|
|
|
|
verification_requests: [VerificationRequest!]!
|
|
|
|
}
|
|
|
|
|
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
|
2022-03-02 12:12:31 +00:00
|
|
|
id_token: String
|
|
|
|
refresh_token: String
|
|
|
|
expires_in: 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-17 07:42:46 +00:00
|
|
|
type Env {
|
2022-03-25 12:21:20 +00:00
|
|
|
ACCESS_TOKEN_EXPIRY_TIME: String
|
2021-12-31 11:33:37 +00:00
|
|
|
ADMIN_SECRET: String
|
2022-05-31 07:41:54 +00:00
|
|
|
DATABASE_NAME: String
|
|
|
|
DATABASE_URL: String
|
|
|
|
DATABASE_TYPE: String
|
|
|
|
DATABASE_USERNAME: String
|
|
|
|
DATABASE_PASSWORD: String
|
|
|
|
DATABASE_HOST: String
|
|
|
|
DATABASE_PORT: String
|
2022-02-26 15:06:22 +00:00
|
|
|
CLIENT_ID: String!
|
2022-02-28 07:44:16 +00:00
|
|
|
CLIENT_SECRET: String!
|
2022-01-24 04:52:55 +00:00
|
|
|
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
|
2022-02-12 14:04:22 +00:00
|
|
|
JWT_PRIVATE_KEY: String
|
|
|
|
JWT_PUBLIC_KEY: String
|
2021-12-31 11:33:37 +00:00
|
|
|
ALLOWED_ORIGINS: [String!]
|
|
|
|
APP_URL: String
|
|
|
|
REDIS_URL: String
|
|
|
|
RESET_PASSWORD_URL: String
|
2022-05-31 07:41:54 +00:00
|
|
|
DISABLE_EMAIL_VERIFICATION: Boolean!
|
|
|
|
DISABLE_BASIC_AUTHENTICATION: Boolean!
|
|
|
|
DISABLE_MAGIC_LINK_LOGIN: Boolean!
|
|
|
|
DISABLE_LOGIN_PAGE: Boolean!
|
|
|
|
DISABLE_SIGN_UP: Boolean!
|
|
|
|
DISABLE_REDIS_FOR_ENV: Boolean!
|
2022-06-18 10:01:57 +00:00
|
|
|
DISABLE_STRONG_PASSWORD: Boolean!
|
2021-12-31 11:33:37 +00:00
|
|
|
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
|
2022-06-06 16:38:32 +00:00
|
|
|
LINKEDIN_CLIENT_ID: String
|
|
|
|
LINKEDIN_CLIENT_SECRET: String
|
2022-06-12 09:19:48 +00:00
|
|
|
APPLE_CLIENT_ID: String
|
|
|
|
APPLE_CLIENT_SECRET: String
|
2021-12-31 11:33:37 +00:00
|
|
|
ORGANIZATION_NAME: String
|
|
|
|
ORGANIZATION_LOGO: String
|
|
|
|
}
|
|
|
|
|
2022-03-24 08:01:56 +00:00
|
|
|
type ValidateJWTTokenResponse {
|
|
|
|
is_valid: Boolean!
|
|
|
|
}
|
|
|
|
|
2022-03-24 13:51:52 +00:00
|
|
|
type GenerateJWTKeysResponse {
|
|
|
|
secret: String
|
|
|
|
public_key: String
|
|
|
|
private_key: String
|
|
|
|
}
|
|
|
|
|
2022-01-17 07:42:46 +00:00
|
|
|
input UpdateEnvInput {
|
2022-03-25 12:21:20 +00:00
|
|
|
ACCESS_TOKEN_EXPIRY_TIME: String
|
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
|
2022-02-12 14:04:22 +00:00
|
|
|
JWT_PRIVATE_KEY: String
|
|
|
|
JWT_PUBLIC_KEY: String
|
2021-12-31 11:33:37 +00:00
|
|
|
ALLOWED_ORIGINS: [String!]
|
|
|
|
APP_URL: String
|
|
|
|
RESET_PASSWORD_URL: String
|
|
|
|
DISABLE_EMAIL_VERIFICATION: Boolean
|
|
|
|
DISABLE_BASIC_AUTHENTICATION: Boolean
|
|
|
|
DISABLE_MAGIC_LINK_LOGIN: Boolean
|
|
|
|
DISABLE_LOGIN_PAGE: Boolean
|
2022-03-16 17:19:18 +00:00
|
|
|
DISABLE_SIGN_UP: Boolean
|
2022-05-31 07:41:54 +00:00
|
|
|
DISABLE_REDIS_FOR_ENV: Boolean
|
2022-06-18 10:01:57 +00:00
|
|
|
DISABLE_STRONG_PASSWORD: Boolean
|
2021-12-31 11:33:37 +00:00
|
|
|
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
|
2022-06-06 16:38:32 +00:00
|
|
|
LINKEDIN_CLIENT_ID: String
|
|
|
|
LINKEDIN_CLIENT_SECRET: String
|
2022-06-12 09:19:48 +00:00
|
|
|
APPLE_CLIENT_ID: String
|
|
|
|
APPLE_CLIENT_SECRET: String
|
2021-12-31 11:33:37 +00:00
|
|
|
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!]
|
2022-03-09 06:23:34 +00:00
|
|
|
scope: [String!]
|
2022-03-16 16:14:57 +00:00
|
|
|
redirect_uri: 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!]
|
2022-03-02 12:12:31 +00:00
|
|
|
scope: [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!
|
2022-03-08 07:06:26 +00:00
|
|
|
state: String
|
|
|
|
redirect_uri: 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-03-02 12:12:31 +00:00
|
|
|
scope: [String!]
|
2022-03-08 07:06:26 +00:00
|
|
|
state: String
|
|
|
|
redirect_uri: String
|
2021-11-11 23:52:03 +00:00
|
|
|
}
|
|
|
|
|
2022-01-23 19:02:06 +00:00
|
|
|
input SessionQueryInput {
|
|
|
|
roles: [String!]
|
2022-03-02 12:12:31 +00:00
|
|
|
scope: [String!]
|
2022-01-23 19:02:06 +00:00
|
|
|
}
|
|
|
|
|
2022-01-25 05:27:40 +00:00
|
|
|
input PaginationInput {
|
|
|
|
limit: Int64
|
|
|
|
page: Int64
|
|
|
|
}
|
|
|
|
|
|
|
|
input PaginatedInput {
|
|
|
|
pagination: PaginationInput
|
|
|
|
}
|
|
|
|
|
2022-03-08 13:19:42 +00:00
|
|
|
input OAuthRevokeInput {
|
|
|
|
refresh_token: String!
|
|
|
|
}
|
|
|
|
|
2022-03-15 03:23:48 +00:00
|
|
|
input InviteMemberInput {
|
|
|
|
emails: [String!]!
|
|
|
|
redirect_uri: String
|
|
|
|
}
|
|
|
|
|
2022-03-24 08:43:55 +00:00
|
|
|
input UpdateAccessInput {
|
|
|
|
user_id: String!
|
|
|
|
}
|
|
|
|
|
2022-03-24 08:01:56 +00:00
|
|
|
input ValidateJWTTokenInput {
|
|
|
|
token_type: String!
|
|
|
|
token: String!
|
|
|
|
roles: [String!]
|
|
|
|
}
|
|
|
|
|
2022-03-24 13:51:52 +00:00
|
|
|
input GenerateJWTKeysInput {
|
|
|
|
type: 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!
|
2022-03-08 13:19:42 +00:00
|
|
|
revoke(params: OAuthRevokeInput!): Response!
|
2021-12-22 05:21:12 +00:00
|
|
|
# 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!
|
2022-03-15 03:23:48 +00:00
|
|
|
_invite_members(params: InviteMemberInput!): Response!
|
2022-03-24 08:43:55 +00:00
|
|
|
_revoke_access(param: UpdateAccessInput!): Response!
|
|
|
|
_enable_access(param: UpdateAccessInput!): Response!
|
2022-03-24 13:51:52 +00:00
|
|
|
_generate_jwt_keys(params: GenerateJWTKeysInput!): GenerateJWTKeysResponse!
|
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!
|
2021-08-06 13:47:52 +00:00
|
|
|
profile: User!
|
2022-03-24 08:01:56 +00:00
|
|
|
validate_jwt_token(params: ValidateJWTTokenInput!): ValidateJWTTokenResponse!
|
2021-12-22 05:21:12 +00:00
|
|
|
# admin only apis
|
2022-01-25 05:27:40 +00:00
|
|
|
_users(params: PaginatedInput): Users!
|
|
|
|
_verification_requests(params: PaginatedInput): VerificationRequests!
|
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
|
|
|
}
|