Introduce basic user and profile management

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-06-11 19:13:21 +02:00
parent da4ea84baf
commit beb35a09c6
51 changed files with 1808 additions and 254 deletions

View File

@@ -32,7 +32,13 @@ export const FETCH_PERSON = gql`
`;
export const GET_PERSON = gql`
query($actorId: ID!) {
query(
$actorId: ID!
$organizedEventsPage: Int
$organizedEventsLimit: Int
$participationPage: Int
$participationLimit: Int
) {
person(id: $actorId) {
id
url
@@ -51,10 +57,63 @@ export const GET_PERSON = gql`
feedTokens {
token
}
organizedEvents {
uuid
title
beginsOn
organizedEvents(page: $organizedEventsPage, limit: $organizedEventsLimit) {
total
elements {
id
uuid
title
beginsOn
}
}
participations(page: $participationPage, limit: $participationLimit) {
total
elements {
id
event {
id
uuid
title
beginsOn
}
}
}
user {
id
email
}
}
}
`;
export const LIST_PROFILES = gql`
query ListProfiles(
$preferredUsername: String
$name: String
$domain: String
$local: Boolean
$suspended: Boolean
$page: Int
$limit: Int
) {
persons(
preferredUsername: $preferredUsername
name: $name
domain: $domain
local: $local
suspended: $suspended
page: $page
limit: $limit
) {
total
elements {
id
preferredUsername
domain
name
avatar {
url
}
}
}
}
@@ -505,3 +564,19 @@ export const CREATE_GROUP = gql`
}
}
`;
export const SUSPEND_PROFILE = gql`
mutation SuspendProfile($id: ID!) {
suspendProfile(id: $id) {
id
}
}
`;
export const UNSUSPEND_PROFILE = gql`
mutation UnSuspendProfile($id: ID!) {
unsuspendProfile(id: $id) {
id
}
}
`;

View File

@@ -485,13 +485,16 @@ export const EVENT_PERSON_PARTICIPATION = gql`
person(id: $actorId) {
id
participations(eventId: $eventId) {
id
role
actor {
id
}
event {
total
elements {
id
role
actor {
id
}
event {
id
}
}
}
}
@@ -503,13 +506,16 @@ export const EVENT_PERSON_PARTICIPATION_SUBSCRIPTION_CHANGED = gql`
eventPersonParticipationChanged(personId: $actorId) {
id
participations(eventId: $eventId) {
id
role
actor {
id
}
event {
total
elements {
id
role
actor {
id
}
event {
id
}
}
}
}

View File

@@ -178,6 +178,12 @@ export const LOGS = gql`
id
title
}
... on Person {
id
preferredUsername
domain
name
}
}
insertedAt
}

View File

@@ -64,8 +64,8 @@ export const VALIDATE_EMAIL = gql`
`;
export const DELETE_ACCOUNT = gql`
mutation DeleteAccount($password: String!) {
deleteAccount(password: $password) {
mutation DeleteAccount($password: String, $userId: ID!) {
deleteAccount(password: $password, userId: $userId) {
id
}
}
@@ -134,3 +134,58 @@ export const SET_USER_SETTINGS = gql`
}
${USER_SETTINGS_FRAGMENT}
`;
export const LIST_USERS = gql`
query ListUsers($email: String, $page: Int, $limit: Int) {
users(email: $email, page: $page, limit: $limit) {
total
elements {
id
email
locale
confirmedAt
disabled
actors {
id
preferredUsername
avatar {
url
}
name
summary
}
settings {
timezone
}
}
}
}
`;
export const GET_USER = gql`
query GetUser($id: ID!) {
user(id: $id) {
id
email
confirmedAt
confirmationSentAt
locale
disabled
defaultActor {
id
}
actors {
id
preferredUsername
name
avatar {
url
}
}
participations {
total
}
role
}
}
`;