Files
speckle-server/packages/server/modules/serverinvites/graph/schemas/serverInvites.graphql
T
Kristaps Fabians Geikins da9224a069 feat: server & stream invites rework
feat: server & stream invites rework

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-19 13:01:19 +03:00

84 lines
2.1 KiB
GraphQL

extend type Mutation {
"""
Invite a new user to the speckle server and return the invite ID
"""
serverInviteCreate(input: ServerInviteCreateInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "users:invite")
"""
Invite a new or registered user to the specified stream
"""
streamInviteCreate(input: StreamInviteCreateInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "users:invite")
serverInviteBatchCreate(input: [ServerInviteCreateInput!]!): Boolean!
@hasRole(role: "server:admin")
@hasScope(scope: "users:invite")
streamInviteBatchCreate(input: [StreamInviteCreateInput!]!): Boolean!
@hasRole(role: "server:admin")
@hasScope(scope: "users:invite")
"""
Accept or decline a stream invite
"""
streamInviteUse(accept: Boolean!, streamId: String!, inviteId: String!): Boolean!
@hasRole(role: "server:user")
"""
Cancel a pending stream invite. Can only be invoked by a stream owner.
"""
streamInviteCancel(streamId: String!, inviteId: String!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "users:invite")
"""
Re-send a pending invite
"""
inviteResend(inviteId: String!): Boolean!
@hasRole(role: "server:admin")
@hasScope(scope: "users:invite")
"""
Delete a pending invite
"""
inviteDelete(inviteId: String!): Boolean!
@hasRole(role: "server:admin")
@hasScope(scope: "users:invite")
}
extend type Query {
"""
Look for an invitation to a stream, for the current user (authed or not). If inviteId
isn't specified, the server will look for any valid invite.
"""
streamInvite(streamId: String!, inviteId: String): PendingStreamCollaborator
"""
Get all invitations to streams that the active user has
"""
streamInvites: [PendingStreamCollaborator!]!
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
}
type ServerInvite {
id: String!
invitedBy: LimitedUser!
email: String!
}
input ServerInviteCreateInput {
email: String!
message: String
}
input StreamInviteCreateInput {
email: String
userId: String
streamId: String!
message: String
}