180 lines
4.1 KiB
GraphQL
180 lines
4.1 KiB
GraphQL
type Organization {
|
|
id: ID!
|
|
name: String!
|
|
description: String
|
|
customData: JSON
|
|
isMfaRequired: Boolean
|
|
createdAt: String!
|
|
}
|
|
|
|
type OrganizationRole {
|
|
id: ID!
|
|
name: String!
|
|
description: String
|
|
type: String!
|
|
}
|
|
|
|
type OrganizationPermission {
|
|
id: ID!
|
|
name: String!
|
|
description: String
|
|
resourceId: String!
|
|
}
|
|
|
|
type OrganizationUser {
|
|
id: ID!
|
|
username: String
|
|
primaryEmail: String
|
|
primaryPhone: String
|
|
name: String
|
|
avatar: String
|
|
organizationRoles: [OrganizationRole!]!
|
|
}
|
|
|
|
type OrganizationInvitation {
|
|
id: ID!
|
|
inviterId: String!
|
|
invitee: String!
|
|
organizationId: String!
|
|
status: String!
|
|
organizationRoleIds: [String!]!
|
|
expiresAt: String!
|
|
createdAt: String!
|
|
acceptedAt: String
|
|
}
|
|
|
|
# Input types for mutations
|
|
input CreateOrganizationInput {
|
|
name: String!
|
|
description: String
|
|
customData: JSON
|
|
isMfaRequired: Boolean
|
|
}
|
|
|
|
input UpdateOrganizationInput {
|
|
id: ID!
|
|
name: String
|
|
description: String
|
|
customData: JSON
|
|
isMfaRequired: Boolean
|
|
}
|
|
|
|
input AddUserToOrganizationInput {
|
|
organizationId: ID!
|
|
userId: ID!
|
|
organizationRoleIds: [ID!]
|
|
}
|
|
|
|
input RemoveUserFromOrganizationInput {
|
|
organizationId: ID!
|
|
userId: ID!
|
|
}
|
|
|
|
input UpdateUserOrganizationRolesInput {
|
|
organizationId: ID!
|
|
userId: ID!
|
|
organizationRoleIds: [ID!]!
|
|
}
|
|
|
|
input CreateOrganizationInvitationInput {
|
|
organizationId: ID!
|
|
invitee: String!
|
|
organizationRoleIds: [ID!]
|
|
messagePayload: JSON
|
|
}
|
|
|
|
# Response types
|
|
type OrganizationResponse {
|
|
success: Boolean!
|
|
message: String
|
|
organization: Organization
|
|
}
|
|
|
|
type OrganizationsListResponse {
|
|
success: Boolean!
|
|
message: String
|
|
organizations: [Organization!]
|
|
totalCount: Int
|
|
}
|
|
|
|
type OrganizationUsersResponse {
|
|
success: Boolean!
|
|
message: String
|
|
users: [OrganizationUser!]
|
|
totalCount: Int
|
|
}
|
|
|
|
type OrganizationRolesResponse {
|
|
success: Boolean!
|
|
message: String
|
|
roles: [OrganizationRole!]
|
|
totalCount: Int
|
|
}
|
|
|
|
type OrganizationPermissionsResponse {
|
|
success: Boolean!
|
|
message: String
|
|
permissions: [OrganizationPermission!]
|
|
totalCount: Int
|
|
}
|
|
|
|
type OrganizationInvitationsResponse {
|
|
success: Boolean!
|
|
message: String
|
|
invitations: [OrganizationInvitation!]
|
|
totalCount: Int
|
|
}
|
|
|
|
type OrganizationInvitationResponse {
|
|
success: Boolean!
|
|
message: String
|
|
invitation: OrganizationInvitation
|
|
}
|
|
|
|
type OrganizationAPITestResponse {
|
|
available: Boolean!
|
|
message: String!
|
|
}
|
|
|
|
extend type Query {
|
|
# Test API availability
|
|
testOrganizationsAPI: OrganizationAPITestResponse!
|
|
|
|
# Organizations
|
|
organizations(page: Int, pageSize: Int): OrganizationsListResponse!
|
|
organization(id: ID!): OrganizationResponse!
|
|
|
|
# Organization Users
|
|
organizationUsers(organizationId: ID!, page: Int, pageSize: Int): OrganizationUsersResponse!
|
|
|
|
# Organization Roles
|
|
organizationRoles(organizationId: ID!, page: Int, pageSize: Int): OrganizationRolesResponse!
|
|
|
|
# Organization Permissions
|
|
organizationPermissions(organizationId: ID!, page: Int, pageSize: Int): OrganizationPermissionsResponse!
|
|
|
|
# Organization Invitations
|
|
organizationInvitations(organizationId: ID!, page: Int, pageSize: Int): OrganizationInvitationsResponse!
|
|
|
|
# User Organizations (organizations where the current user is a member)
|
|
myOrganizations(page: Int, pageSize: Int): OrganizationsListResponse!
|
|
}
|
|
|
|
extend type Mutation {
|
|
# Organization management
|
|
createOrganization(input: CreateOrganizationInput!): OrganizationResponse!
|
|
updateOrganization(input: UpdateOrganizationInput!): OrganizationResponse!
|
|
deleteOrganization(id: ID!): OrganizationResponse!
|
|
|
|
# Organization membership
|
|
addUserToOrganization(input: AddUserToOrganizationInput!): OrganizationResponse!
|
|
removeUserFromOrganization(input: RemoveUserFromOrganizationInput!): OrganizationResponse!
|
|
updateUserOrganizationRoles(input: UpdateUserOrganizationRolesInput!): OrganizationResponse!
|
|
|
|
# Organization invitations
|
|
createOrganizationInvitation(input: CreateOrganizationInvitationInput!): OrganizationInvitationResponse!
|
|
resendOrganizationInvitation(invitationId: ID!): OrganizationInvitationResponse!
|
|
revokeOrganizationInvitation(invitationId: ID!): OrganizationInvitationResponse!
|
|
acceptOrganizationInvitation(invitationId: ID!): OrganizationInvitationResponse!
|
|
}
|