Compare commits
2 Commits
1885ba5477
...
67f2a6b9c5
Author | SHA1 | Date | |
---|---|---|---|
67f2a6b9c5 | |||
845c969c46 |
@ -1,8 +1,10 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id("com.apollographql.apollo3").version("3.0.0")
|
||||
}
|
||||
|
||||
|
||||
android {
|
||||
compileSdk 31
|
||||
|
||||
@ -34,6 +36,12 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
apollo {
|
||||
packageName.set("org.ddnss.sfs.git.wdg.noise")
|
||||
}
|
||||
|
||||
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.core:core-ktx:1.7.0'
|
||||
@ -72,12 +80,9 @@ dependencies {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
def apollo_version = "2.5.11"
|
||||
|
||||
// The core runtime dependencies
|
||||
implementation("com.apollographql.apollo:apollo-runtime:$apollo_version")
|
||||
// Coroutines extensions for easier asynchronicity handling
|
||||
implementation("com.apollographql.apollo:apollo-coroutines-support:$apollo_version")
|
||||
// ...
|
||||
implementation("com.apollographql.apollo3:apollo-runtime:3.0.0")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
166
app/src/main/graphql/org/ddnss/sfs/schema.graphqls
Normal file
166
app/src/main/graphql/org/ddnss/sfs/schema.graphqls
Normal file
@ -0,0 +1,166 @@
|
||||
type Message {
|
||||
id: ID!
|
||||
|
||||
timestamp: String!
|
||||
|
||||
sender: ID!
|
||||
|
||||
msgType: MsgType!
|
||||
|
||||
content: String
|
||||
|
||||
hideFor: [ID!]
|
||||
|
||||
seenBy: [ID!]!
|
||||
}
|
||||
|
||||
type ExternalServersPreferences {
|
||||
privacyPreferences: PrivacyPreferences!
|
||||
|
||||
externalServers: RestrictionPolicy!
|
||||
|
||||
externalServersLimit: [Url!]!
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
newUser(newUser: NewUser!): ID!
|
||||
|
||||
newChat(user: ID!, passwordHash: String!, with: ID!): ID!
|
||||
|
||||
newGroupChat(user: ID!, passwordHash: String!, title: String!, description: String, with: [ID!]!): ID!
|
||||
|
||||
sendMessage(user: ID!, passwordHash: String!, chat: ID!, msg: MessageInput!): ID!
|
||||
}
|
||||
|
||||
enum RestrictionPolicy {
|
||||
EVERYONE
|
||||
|
||||
EXCLUDING
|
||||
|
||||
INCLUDING
|
||||
|
||||
NONE
|
||||
}
|
||||
|
||||
type NotificationPreferences {
|
||||
lockDetails: Boolean!
|
||||
|
||||
doNotDisturb: Boolean!
|
||||
}
|
||||
|
||||
"""
|
||||
DateTime
|
||||
"""
|
||||
scalar DateTimeUtc
|
||||
|
||||
"""
|
||||
Url
|
||||
"""
|
||||
scalar Url
|
||||
|
||||
type Query {
|
||||
getUserID(username: String!): ID!
|
||||
|
||||
isUsernameUsed(username: String!): Boolean!
|
||||
|
||||
users: [User!]!
|
||||
|
||||
userPreferences(id: ID!, passwordHash: String!): UserPreferences!
|
||||
|
||||
chats(user: ID!, passwordHash: String!): [Chat!]!
|
||||
|
||||
groupChats(user: ID!, passwordHash: String!): [GroupChat!]!
|
||||
|
||||
getMessages(user: ID!, passwordHash: String!, chat: ID!, lastMsg: ID, limit: Int): [Message!]!
|
||||
}
|
||||
|
||||
type SecurityPreferences {
|
||||
accountTokens: [ID!]!
|
||||
|
||||
passwordHash: String!
|
||||
}
|
||||
|
||||
type PrivacyPreferences {
|
||||
discovery: RestrictionPolicy!
|
||||
|
||||
discoveryUserLimit: [String!]!
|
||||
|
||||
discoveryServerLimit: [Url!]!
|
||||
|
||||
lastSeen: RestrictionPolicy!
|
||||
|
||||
lastSeenUserLimit: [String!]!
|
||||
|
||||
lastSeenServerLimit: [Url!]!
|
||||
|
||||
lastSeenCourse: Boolean!
|
||||
|
||||
info: RestrictionPolicy!
|
||||
|
||||
infoUserLimit: [String!]!
|
||||
|
||||
infoServerLimit: [Url!]!
|
||||
}
|
||||
|
||||
type UserPreferences {
|
||||
privacyPreferences: PrivacyPreferences!
|
||||
|
||||
notificationPreferences: NotificationPreferences!
|
||||
|
||||
securityPreferences: SecurityPreferences!
|
||||
|
||||
externalServersPreferences: ExternalServersPreferences!
|
||||
}
|
||||
|
||||
input NewUser {
|
||||
userName: String!
|
||||
|
||||
displayName: String
|
||||
|
||||
passwordHash: String!
|
||||
}
|
||||
|
||||
input MessageInput {
|
||||
msgType: MsgType!
|
||||
|
||||
content: String
|
||||
}
|
||||
|
||||
type User {
|
||||
id: ID!
|
||||
|
||||
userName: String!
|
||||
|
||||
displayName: String
|
||||
|
||||
activated: Boolean!
|
||||
|
||||
created: DateTimeUtc!
|
||||
|
||||
lastOnline: DateTimeUtc
|
||||
}
|
||||
|
||||
enum MsgType {
|
||||
TEXT
|
||||
}
|
||||
|
||||
type Chat {
|
||||
id: ID!
|
||||
|
||||
users: [ID!]!
|
||||
}
|
||||
|
||||
type GroupChat {
|
||||
id: ID!
|
||||
|
||||
title: String!
|
||||
|
||||
description: String
|
||||
|
||||
users: [ID!]!
|
||||
}
|
||||
|
||||
schema {
|
||||
query: Query
|
||||
mutation: Mutation
|
||||
}
|
Loading…
Reference in New Issue
Block a user