2020-02-18 07:57:00 +00:00
|
|
|
import gql from "graphql-tag";
|
|
|
|
import { CONVERSATION_BASIC_FIELDS_FRAGMENT } from "@/graphql/conversation";
|
|
|
|
import { RESOURCE_METADATA_BASIC_FIELDS_FRAGMENT } from "@/graphql/resources";
|
2018-11-06 09:30:27 +00:00
|
|
|
|
2019-01-21 14:08:22 +00:00
|
|
|
export const FETCH_PERSON = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
query($username: String!) {
|
|
|
|
fetchPerson(preferredUsername: $username) {
|
|
|
|
id
|
2019-05-22 12:12:11 +00:00
|
|
|
url
|
2020-02-18 07:57:00 +00:00
|
|
|
name
|
|
|
|
domain
|
|
|
|
summary
|
|
|
|
preferredUsername
|
|
|
|
suspended
|
|
|
|
avatar {
|
|
|
|
name
|
|
|
|
url
|
|
|
|
}
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
feedTokens {
|
2019-03-21 19:23:42 +00:00
|
|
|
token
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
organizedEvents {
|
2020-06-15 16:12:49 +00:00
|
|
|
total
|
|
|
|
elements {
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
beginsOn
|
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
}
|
2018-11-06 09:30:27 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-10-04 16:28:25 +00:00
|
|
|
export const GET_PERSON = gql`
|
2020-06-11 17:13:21 +00:00
|
|
|
query(
|
|
|
|
$actorId: ID!
|
|
|
|
$organizedEventsPage: Int
|
|
|
|
$organizedEventsLimit: Int
|
|
|
|
$participationPage: Int
|
|
|
|
$participationLimit: Int
|
|
|
|
) {
|
2020-02-18 07:57:00 +00:00
|
|
|
person(id: $actorId) {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
summary
|
|
|
|
preferredUsername
|
|
|
|
suspended
|
|
|
|
avatar {
|
|
|
|
name
|
|
|
|
url
|
|
|
|
}
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
feedTokens {
|
|
|
|
token
|
|
|
|
}
|
2020-06-11 17:13:21 +00:00
|
|
|
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
|
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
2019-10-04 16:28:25 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
2019-10-04 16:28:25 +00:00
|
|
|
`;
|
|
|
|
|
2019-01-21 14:08:22 +00:00
|
|
|
export const LOGGED_PERSON = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
query {
|
|
|
|
loggedPerson {
|
|
|
|
id
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
preferredUsername
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_DEFAULT_ACTOR = gql`
|
|
|
|
mutation ChangeDefaultActor($preferredUsername: String!) {
|
|
|
|
changeDefaultActor(preferredUsername: $preferredUsername) {
|
|
|
|
id
|
|
|
|
defaultActor {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
2018-11-06 09:30:27 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
`;
|
2019-01-21 14:08:22 +00:00
|
|
|
|
2019-09-11 07:59:01 +00:00
|
|
|
export const CURRENT_ACTOR_CLIENT = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
query currentActor {
|
|
|
|
currentActor @client {
|
|
|
|
id
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
preferredUsername
|
|
|
|
name
|
2019-09-11 07:59:01 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
2019-09-11 07:59:01 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_CURRENT_ACTOR_CLIENT = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
mutation UpdateCurrentActor(
|
|
|
|
$id: String!
|
|
|
|
$avatar: String
|
|
|
|
$preferredUsername: String!
|
|
|
|
$name: String!
|
|
|
|
) {
|
|
|
|
updateCurrentActor(
|
|
|
|
id: $id
|
|
|
|
avatar: $avatar
|
|
|
|
preferredUsername: $preferredUsername
|
|
|
|
name: $name
|
|
|
|
) @client
|
|
|
|
}
|
2019-09-11 07:59:01 +00:00
|
|
|
`;
|
|
|
|
|
2019-09-18 15:32:37 +00:00
|
|
|
export const LOGGED_USER_PARTICIPATIONS = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
query LoggedUserParticipations(
|
|
|
|
$afterDateTime: DateTime
|
|
|
|
$beforeDateTime: DateTime
|
|
|
|
$page: Int
|
|
|
|
$limit: Int
|
|
|
|
) {
|
|
|
|
loggedUser {
|
|
|
|
participations(
|
|
|
|
afterDatetime: $afterDateTime
|
|
|
|
beforeDatetime: $beforeDateTime
|
|
|
|
page: $page
|
|
|
|
limit: $limit
|
|
|
|
) {
|
|
|
|
total
|
|
|
|
elements {
|
2019-09-18 15:32:37 +00:00
|
|
|
event {
|
2020-02-18 07:57:00 +00:00
|
|
|
id
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
alt
|
|
|
|
}
|
|
|
|
beginsOn
|
|
|
|
visibility
|
|
|
|
organizerActor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
domain
|
2020-06-15 17:41:11 +00:00
|
|
|
summary
|
2019-09-18 15:32:37 +00:00
|
|
|
avatar {
|
2020-02-18 07:57:00 +00:00
|
|
|
url
|
2019-09-18 15:32:37 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
participantStats {
|
|
|
|
notApproved
|
|
|
|
participant
|
|
|
|
}
|
|
|
|
options {
|
|
|
|
maximumAttendeeCapacity
|
|
|
|
remainingAttendeeCapacity
|
|
|
|
}
|
2019-09-18 15:32:37 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
id
|
|
|
|
role
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
domain
|
2020-06-15 17:41:11 +00:00
|
|
|
summary
|
2020-02-18 07:57:00 +00:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-18 15:32:37 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
2019-03-21 19:23:42 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
`;
|
2019-03-21 19:23:42 +00:00
|
|
|
|
2019-10-02 15:59:07 +00:00
|
|
|
export const LOGGED_USER_DRAFTS = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
query LoggedUserDrafts($page: Int, $limit: Int) {
|
|
|
|
loggedUser {
|
|
|
|
drafts(page: $page, limit: $limit) {
|
|
|
|
id
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
alt
|
|
|
|
}
|
|
|
|
beginsOn
|
|
|
|
visibility
|
|
|
|
organizerActor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
participantStats {
|
|
|
|
going
|
|
|
|
notApproved
|
|
|
|
}
|
|
|
|
options {
|
|
|
|
maximumAttendeeCapacity
|
|
|
|
remainingAttendeeCapacity
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const LOGGED_USER_MEMBERSHIPS = gql`
|
|
|
|
query LoggedUserMemberships($page: Int, $limit: Int) {
|
|
|
|
loggedUser {
|
|
|
|
memberships(page: $page, limit: $limit) {
|
|
|
|
total
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
role
|
|
|
|
parent {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
organizedEvents {
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
title
|
2019-10-02 15:59:07 +00:00
|
|
|
picture {
|
2020-02-18 07:57:00 +00:00
|
|
|
url
|
2019-10-02 15:59:07 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
total
|
2019-10-02 15:59:07 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
invitedBy {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
2019-10-02 15:59:07 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2019-10-02 15:59:07 +00:00
|
|
|
|
2019-01-21 14:08:22 +00:00
|
|
|
export const IDENTITIES = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
query {
|
|
|
|
identities {
|
|
|
|
id
|
|
|
|
avatar {
|
2019-05-22 12:12:11 +00:00
|
|
|
url
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
}
|
2019-01-21 14:08:22 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const PERSON_MEMBERSHIPS = gql`
|
|
|
|
query PersonMemberships($id: ID!) {
|
|
|
|
person(id: $id) {
|
|
|
|
id
|
|
|
|
memberships {
|
|
|
|
total
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
role
|
|
|
|
parent {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2019-01-21 14:08:22 +00:00
|
|
|
|
|
|
|
export const CREATE_PERSON = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
mutation CreatePerson(
|
|
|
|
$preferredUsername: String!
|
|
|
|
$name: String!
|
|
|
|
$summary: String
|
|
|
|
$avatar: PictureInput
|
|
|
|
) {
|
|
|
|
createPerson(
|
|
|
|
preferredUsername: $preferredUsername
|
|
|
|
name: $name
|
|
|
|
summary: $summary
|
2019-06-17 15:15:27 +00:00
|
|
|
avatar: $avatar
|
2019-01-29 10:02:32 +00:00
|
|
|
) {
|
2020-02-18 07:57:00 +00:00
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
summary
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
2019-06-17 15:15:27 +00:00
|
|
|
}
|
2019-01-21 14:08:22 +00:00
|
|
|
}
|
2019-01-29 10:02:32 +00:00
|
|
|
`;
|
|
|
|
|
2019-06-17 15:15:27 +00:00
|
|
|
export const UPDATE_PERSON = gql`
|
2019-10-04 16:28:25 +00:00
|
|
|
mutation UpdatePerson($id: ID!, $name: String, $summary: String, $avatar: PictureInput) {
|
2020-02-18 07:57:00 +00:00
|
|
|
updatePerson(id: $id, name: $name, summary: $summary, avatar: $avatar) {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
summary
|
2019-06-17 15:15:27 +00:00
|
|
|
avatar {
|
|
|
|
url
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
2019-06-17 15:15:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const DELETE_PERSON = gql`
|
2019-10-04 16:28:25 +00:00
|
|
|
mutation DeletePerson($id: ID!) {
|
|
|
|
deletePerson(id: $id) {
|
2020-02-18 07:57:00 +00:00
|
|
|
preferredUsername
|
2019-06-17 15:15:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-01-29 10:02:32 +00:00
|
|
|
/**
|
2020-02-18 07:57:00 +00:00
|
|
|
* This one is used only to register the first account.
|
|
|
|
* Prefer CREATE_PERSON when creating another identity
|
2019-01-29 10:02:32 +00:00
|
|
|
*/
|
|
|
|
export const REGISTER_PERSON = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
mutation($preferredUsername: String!, $name: String!, $summary: String!, $email: String!) {
|
|
|
|
registerPerson(
|
|
|
|
preferredUsername: $preferredUsername
|
|
|
|
name: $name
|
|
|
|
summary: $summary
|
2019-01-29 10:02:32 +00:00
|
|
|
email: $email
|
|
|
|
) {
|
2020-02-18 07:57:00 +00:00
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
summary
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const LIST_GROUPS = gql`
|
|
|
|
query {
|
|
|
|
groups {
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
summary
|
|
|
|
preferredUsername
|
|
|
|
suspended
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
organizedEvents {
|
|
|
|
elements {
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
beginsOn
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
2019-01-29 10:02:32 +00:00
|
|
|
}
|
|
|
|
`;
|
2019-04-03 15:29:03 +00:00
|
|
|
|
|
|
|
export const FETCH_GROUP = gql`
|
2020-02-18 07:57:00 +00:00
|
|
|
query($name: String!) {
|
|
|
|
group(preferredUsername: $name) {
|
|
|
|
id
|
2019-05-22 12:12:11 +00:00
|
|
|
url
|
2020-02-18 07:57:00 +00:00
|
|
|
name
|
|
|
|
domain
|
|
|
|
summary
|
|
|
|
preferredUsername
|
|
|
|
suspended
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
organizedEvents {
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
beginsOn
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
conversations {
|
|
|
|
total
|
|
|
|
elements {
|
|
|
|
...ConversationBasicFields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
members {
|
|
|
|
elements {
|
|
|
|
role
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
name
|
|
|
|
domain
|
2019-04-03 15:29:03 +00:00
|
|
|
preferredUsername
|
2020-02-18 07:57:00 +00:00
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
resources(page: 1, limit: 3) {
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
resourceUrl
|
|
|
|
summary
|
|
|
|
updatedAt
|
|
|
|
type
|
|
|
|
path
|
|
|
|
metadata {
|
|
|
|
...ResourceMetadataBasicFields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
todoLists {
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
todos {
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
status
|
|
|
|
dueDate
|
|
|
|
assignedTo {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
}
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
2019-04-03 15:29:03 +00:00
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
total
|
|
|
|
}
|
2019-04-03 15:29:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-02-18 07:57:00 +00:00
|
|
|
${CONVERSATION_BASIC_FIELDS_FRAGMENT}
|
|
|
|
${RESOURCE_METADATA_BASIC_FIELDS_FRAGMENT}
|
2019-04-03 15:29:03 +00:00
|
|
|
`;
|
2019-09-02 08:50:00 +00:00
|
|
|
export const CREATE_GROUP = gql`
|
|
|
|
mutation CreateGroup(
|
2020-02-18 07:57:00 +00:00
|
|
|
$creatorActorId: ID!
|
|
|
|
$preferredUsername: String!
|
|
|
|
$name: String!
|
|
|
|
$summary: String
|
|
|
|
$avatar: PictureInput
|
2019-09-02 08:50:00 +00:00
|
|
|
$banner: PictureInput
|
|
|
|
) {
|
|
|
|
createGroup(
|
2020-02-18 07:57:00 +00:00
|
|
|
creatorActorId: $creatorActorId
|
|
|
|
preferredUsername: $preferredUsername
|
|
|
|
name: $name
|
|
|
|
summary: $summary
|
|
|
|
banner: $banner
|
2019-09-02 08:50:00 +00:00
|
|
|
avatar: $avatar
|
|
|
|
) {
|
2020-02-18 07:57:00 +00:00
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
summary
|
2019-09-02 08:50:00 +00:00
|
|
|
avatar {
|
|
|
|
url
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
2019-09-02 08:50:00 +00:00
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2020-06-11 17:13:21 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|