From c32026b6d6ce26e71218d1bc0febc1b15c220ff6 Mon Sep 17 00:00:00 2001 From: Alessandro Magionami Date: Thu, 9 Jan 2025 11:21:46 +0100 Subject: [PATCH] feat(workspaces): dismiss workspace mutation --- .../typedefs/workspaces.graphql | 5 ++ .../modules/core/graph/generated/graphql.ts | 13 ++++ .../graph/generated/graphql.ts | 10 +++ .../modules/workspaces/domain/operations.ts | 8 +++ .../modules/workspaces/errors/workspace.ts | 6 ++ .../workspaces/graph/resolvers/workspaces.ts | 11 ++- .../repositories/workspaceJoinRequests.ts | 19 ++++++ .../services/workspaceJoinRequests.ts | 20 ++++++ .../workspaces/tests/helpers/graphql.ts | 8 +++ .../workspaceJoinReqquests.spec.ts | 67 +++++++++++++++++++ .../integration/workspaces.graph.spec.ts | 44 +++++++++++- .../server/test/graphql/generated/graphql.ts | 18 +++++ 12 files changed, 227 insertions(+), 2 deletions(-) create mode 100644 packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts create mode 100644 packages/server/modules/workspaces/services/workspaceJoinRequests.ts create mode 100644 packages/server/modules/workspaces/tests/integration/workspaceJoinReqquests.spec.ts diff --git a/packages/server/assets/workspacesCore/typedefs/workspaces.graphql b/packages/server/assets/workspacesCore/typedefs/workspaces.graphql index 37a84b4af..1687d60e7 100644 --- a/packages/server/assets/workspacesCore/typedefs/workspaces.graphql +++ b/packages/server/assets/workspacesCore/typedefs/workspaces.graphql @@ -151,6 +151,11 @@ type WorkspaceMutations { invites: WorkspaceInviteMutations! projects: WorkspaceProjectMutations! @hasServerRole(role: SERVER_USER) updateCreationState(input: WorkspaceCreationStateInput!): Boolean! + dismiss(input: WorkspaceDismissInput!): Boolean! @hasServerRole(role: SERVER_USER) +} + +input WorkspaceDismissInput { + workspaceId: ID! } input WorkspaceCreationStateInput { diff --git a/packages/server/modules/core/graph/generated/graphql.ts b/packages/server/modules/core/graph/generated/graphql.ts index 224150016..e48622f6b 100644 --- a/packages/server/modules/core/graph/generated/graphql.ts +++ b/packages/server/modules/core/graph/generated/graphql.ts @@ -4297,6 +4297,10 @@ export type WorkspaceCreationStateInput = { workspaceId: Scalars['ID']['input']; }; +export type WorkspaceDismissInput = { + workspaceId: Scalars['ID']['input']; +}; + export type WorkspaceDomain = { __typename?: 'WorkspaceDomain'; domain: Scalars['String']['output']; @@ -4390,6 +4394,7 @@ export type WorkspaceMutations = { delete: Scalars['Boolean']['output']; deleteDomain: Workspace; deleteSsoProvider: Scalars['Boolean']['output']; + dismiss: Scalars['Boolean']['output']; invites: WorkspaceInviteMutations; join: Workspace; leave: Scalars['Boolean']['output']; @@ -4427,6 +4432,11 @@ export type WorkspaceMutationsDeleteSsoProviderArgs = { }; +export type WorkspaceMutationsDismissArgs = { + input: WorkspaceDismissInput; +}; + + export type WorkspaceMutationsJoinArgs = { input: JoinWorkspaceInput; }; @@ -4962,6 +4972,7 @@ export type ResolversTypes = { WorkspaceCreateInput: WorkspaceCreateInput; WorkspaceCreationState: ResolverTypeWrapper; WorkspaceCreationStateInput: WorkspaceCreationStateInput; + WorkspaceDismissInput: WorkspaceDismissInput; WorkspaceDomain: ResolverTypeWrapper; WorkspaceDomainDeleteInput: WorkspaceDomainDeleteInput; WorkspaceFeatureName: WorkspaceFeatureName; @@ -5234,6 +5245,7 @@ export type ResolversParentTypes = { WorkspaceCreateInput: WorkspaceCreateInput; WorkspaceCreationState: WorkspaceCreationState; WorkspaceCreationStateInput: WorkspaceCreationStateInput; + WorkspaceDismissInput: WorkspaceDismissInput; WorkspaceDomain: WorkspaceDomain; WorkspaceDomainDeleteInput: WorkspaceDomainDeleteInput; WorkspaceInviteCreateInput: WorkspaceInviteCreateInput; @@ -6768,6 +6780,7 @@ export type WorkspaceMutationsResolvers>; deleteDomain?: Resolver>; deleteSsoProvider?: Resolver>; + dismiss?: Resolver>; invites?: Resolver; join?: Resolver>; leave?: Resolver>; diff --git a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts index 807a1944f..a139d0574 100644 --- a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts +++ b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts @@ -4278,6 +4278,10 @@ export type WorkspaceCreationStateInput = { workspaceId: Scalars['ID']['input']; }; +export type WorkspaceDismissInput = { + workspaceId: Scalars['ID']['input']; +}; + export type WorkspaceDomain = { __typename?: 'WorkspaceDomain'; domain: Scalars['String']['output']; @@ -4371,6 +4375,7 @@ export type WorkspaceMutations = { delete: Scalars['Boolean']['output']; deleteDomain: Workspace; deleteSsoProvider: Scalars['Boolean']['output']; + dismiss: Scalars['Boolean']['output']; invites: WorkspaceInviteMutations; join: Workspace; leave: Scalars['Boolean']['output']; @@ -4408,6 +4413,11 @@ export type WorkspaceMutationsDeleteSsoProviderArgs = { }; +export type WorkspaceMutationsDismissArgs = { + input: WorkspaceDismissInput; +}; + + export type WorkspaceMutationsJoinArgs = { input: JoinWorkspaceInput; }; diff --git a/packages/server/modules/workspaces/domain/operations.ts b/packages/server/modules/workspaces/domain/operations.ts index 66e39b30f..8ce7e2c21 100644 --- a/packages/server/modules/workspaces/domain/operations.ts +++ b/packages/server/modules/workspaces/domain/operations.ts @@ -4,6 +4,8 @@ import { Workspace, WorkspaceAcl, WorkspaceDomain, + WorkspaceJoinRequest, + WorkspaceJoinRequestStatus, WorkspaceRegionAssignment, WorkspaceWithDomains, WorkspaceWithOptionalRole @@ -308,3 +310,9 @@ export type GetWorkspaceCreationState = (params: { export type UpsertWorkspaceCreationState = (params: { workspaceCreationState: WorkspaceCreationState }) => Promise + +export type UpdateWorkspaceJoinRequestStatus = (params: { + workspaceId: string + userId: string + status: WorkspaceJoinRequestStatus +}) => Promise | undefined> diff --git a/packages/server/modules/workspaces/errors/workspace.ts b/packages/server/modules/workspaces/errors/workspace.ts index 5a81b76b1..19d2b012b 100644 --- a/packages/server/modules/workspaces/errors/workspace.ts +++ b/packages/server/modules/workspaces/errors/workspace.ts @@ -119,3 +119,9 @@ export class WorkspacePaidPlanActiveError extends BaseError { static code = 'WORKSPACE_PAID_PLAN_ACTIVE' static statusCode = 400 } + +export class WorkspaceJoinRequestNotFoundError extends BaseError { + static defaultMessage = 'Joinable workspace not found' + static code = 'WORKSPACE_JOIN_REQUEST_NOT_FOUND_ERROR' + static statusCode = 404 +} diff --git a/packages/server/modules/workspaces/graph/resolvers/workspaces.ts b/packages/server/modules/workspaces/graph/resolvers/workspaces.ts index a0ab38e23..da269a6f4 100644 --- a/packages/server/modules/workspaces/graph/resolvers/workspaces.ts +++ b/packages/server/modules/workspaces/graph/resolvers/workspaces.ts @@ -203,6 +203,8 @@ import { Knex } from 'knex' import { getPaginatedItemsFactory } from '@/modules/shared/services/paginatedItems' import { InvalidWorkspacePlanStatus } from '@/modules/gatekeeper/errors/billing' import { BadRequestError } from '@/modules/shared/errors' +import { dismissWorkspaceJoinRequestFactory } from '@/modules/workspaces/services/workspaceJoinRequests' +import { updateWorkspaceJoinRequestStatusFactory } from '@/modules/workspaces/repositories/workspaceJoinRequests' const eventBus = getEventBus() const getServerInfo = getServerInfoFactory({ db }) @@ -774,7 +776,14 @@ export = FF_WORKSPACES_MODULE_ENABLED return true }, invites: () => ({}), - projects: () => ({}) + projects: () => ({}), + dismiss: async (_parent, args, ctx) => { + return await dismissWorkspaceJoinRequestFactory({ + updateWorkspaceJoinRequestStatus: updateWorkspaceJoinRequestStatusFactory({ + db + }) + })({ userId: ctx.userId!, workspaceId: args.input.workspaceId }) + } }, WorkspaceInviteMutations: { resend: async (_parent, args, ctx) => { diff --git a/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts b/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts new file mode 100644 index 000000000..a8a178231 --- /dev/null +++ b/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts @@ -0,0 +1,19 @@ +import { UpdateWorkspaceJoinRequestStatus } from '@/modules/workspaces/domain/operations' +import { WorkspaceJoinRequest } from '@/modules/workspacesCore/domain/types' +import { WorkspaceJoinRequests } from '@/modules/workspacesCore/helpers/db' +import { Knex } from 'knex' + +const tables = { + workspaceJoinRequests: (db: Knex) => + db(WorkspaceJoinRequests.name) +} + +export const updateWorkspaceJoinRequestStatusFactory = + ({ db }: { db: Knex }): UpdateWorkspaceJoinRequestStatus => + async ({ workspaceId, userId, status }) => { + const [request] = await tables + .workspaceJoinRequests(db) + .update({ status }, ['workspaceId', 'userId']) + .where({ workspaceId, userId }) + return request + } diff --git a/packages/server/modules/workspaces/services/workspaceJoinRequests.ts b/packages/server/modules/workspaces/services/workspaceJoinRequests.ts new file mode 100644 index 000000000..a94fa5bf7 --- /dev/null +++ b/packages/server/modules/workspaces/services/workspaceJoinRequests.ts @@ -0,0 +1,20 @@ +import { UpdateWorkspaceJoinRequestStatus } from '@/modules/workspaces/domain/operations' +import { WorkspaceJoinRequestNotFoundError } from '@/modules/workspaces/errors/workspace' + +export const dismissWorkspaceJoinRequestFactory = + ({ + updateWorkspaceJoinRequestStatus + }: { + updateWorkspaceJoinRequestStatus: UpdateWorkspaceJoinRequestStatus + }) => + async ({ userId, workspaceId }: { userId: string; workspaceId: string }) => { + const updated = await updateWorkspaceJoinRequestStatus({ + userId, + workspaceId, + status: 'dismissed' + }) + if (!updated) { + throw new WorkspaceJoinRequestNotFoundError() + } + return true + } diff --git a/packages/server/modules/workspaces/tests/helpers/graphql.ts b/packages/server/modules/workspaces/tests/helpers/graphql.ts index adb9f9558..f6a626677 100644 --- a/packages/server/modules/workspaces/tests/helpers/graphql.ts +++ b/packages/server/modules/workspaces/tests/helpers/graphql.ts @@ -315,3 +315,11 @@ export const onWorkspaceUpdatedSubscription = gql` ${basicWorkspaceFragment} ` + +export const dismissWorkspaceMutation = gql` + mutation dismissWorkspace($input: WorkspaceDismissInput!) { + workspaceMutations { + dismiss(input: $input) + } + } +` diff --git a/packages/server/modules/workspaces/tests/integration/workspaceJoinReqquests.spec.ts b/packages/server/modules/workspaces/tests/integration/workspaceJoinReqquests.spec.ts new file mode 100644 index 000000000..ac2335486 --- /dev/null +++ b/packages/server/modules/workspaces/tests/integration/workspaceJoinReqquests.spec.ts @@ -0,0 +1,67 @@ +import { db } from '@/db/knex' +import { createRandomString } from '@/modules/core/helpers/testHelpers' +import { getFeatureFlags } from '@/modules/shared/helpers/envHelper' +import { updateWorkspaceJoinRequestStatusFactory } from '@/modules/workspaces/repositories/workspaceJoinRequests' +import { dismissWorkspaceJoinRequestFactory } from '@/modules/workspaces/services/workspaceJoinRequests' +import { + BasicTestWorkspace, + createTestWorkspace +} from '@/modules/workspaces/tests/helpers/creation' +import { WorkspaceJoinRequests } from '@/modules/workspacesCore/helpers/db' +import { expectToThrow } from '@/test/assertionHelper' +import { BasicTestUser, createTestUser } from '@/test/authHelper' +import { Roles } from '@speckle/shared' +import { expect } from 'chai' +import cryptoRandomString from 'crypto-random-string' + +const { FF_WORKSPACES_MODULE_ENABLED } = getFeatureFlags() + +;(FF_WORKSPACES_MODULE_ENABLED ? describe : describe.skip)( + 'workspaceJoinRequests services', + () => { + describe('dismissWorkspaceJoinRequestFactory, returns a function that ', () => { + it('throws a WorkspaceJoinRequestNotFoundError if the updateWorkspaceJoinRequestStatus does not exists', async () => { + expectToThrow(() => + dismissWorkspaceJoinRequestFactory({ + updateWorkspaceJoinRequestStatus: updateWorkspaceJoinRequestStatusFactory({ + db + }) + })({ workspaceId: createRandomString(), userId: createRandomString() }) + ) + }) + it('marks the request as dismissed', async () => { + const user: BasicTestUser = { + id: '', + name: 'John Speckle', + email: 'john-speckle@example.org', + role: Roles.Server.Admin, + verified: true + } + + await createTestUser(user) + + const workspace: BasicTestWorkspace = { + id: '', + slug: '', + ownerId: '', + name: cryptoRandomString({ length: 6 }), + description: cryptoRandomString({ length: 12 }) + } + await createTestWorkspace(workspace, user) + + await db(WorkspaceJoinRequests.name).insert({ + workspaceId: workspace.id, + userId: user.id, + status: 'pending' + }) + expect( + await dismissWorkspaceJoinRequestFactory({ + updateWorkspaceJoinRequestStatus: updateWorkspaceJoinRequestStatusFactory({ + db + }) + })({ workspaceId: workspace.id, userId: user.id }) + ).to.equal(true) + }) + }) + } +) diff --git a/packages/server/modules/workspaces/tests/integration/workspaces.graph.spec.ts b/packages/server/modules/workspaces/tests/integration/workspaces.graph.spec.ts index d13008f38..38cd06d30 100644 --- a/packages/server/modules/workspaces/tests/integration/workspaces.graph.spec.ts +++ b/packages/server/modules/workspaces/tests/integration/workspaces.graph.spec.ts @@ -26,7 +26,8 @@ import { GetWorkspaceWithProjectsDocument, AddWorkspaceDomainDocument, DeleteWorkspaceDomainDocument, - CreateWorkspaceProjectDocument + CreateWorkspaceProjectDocument, + DismissWorkspaceDocument } from '@/test/graphql/generated/graphql' import { beforeEachContext } from '@/test/hooks' import { AllScopes } from '@/modules/core/helpers/mainConstants' @@ -47,6 +48,8 @@ import { } from '@/modules/core/helpers/testHelpers' import { getWorkspaceFactory } from '@/modules/workspaces/repositories/workspaces' import { grantStreamPermissionsFactory } from '@/modules/core/repositories/streams' +import { WorkspaceJoinRequestNotFoundError } from '@/modules/workspaces/errors/workspace' +import { WorkspaceJoinRequests } from '@/modules/workspacesCore/helpers/db' const grantStreamPermissions = grantStreamPermissionsFactory({ db }) @@ -834,6 +837,45 @@ describe('Workspaces GQL CRUD', () => { expect(resC).to.haveGraphQLErrors('Provided default project role is invalid') }) }) + + describe('mutation workspaceMutations.dismiss', () => { + it('should return an error if workspace does not exists', async () => { + const res = await apollo.execute(DismissWorkspaceDocument, { + input: { + workspaceId: cryptoRandomString({ length: 6 }) + } + }) + expect(res).to.haveGraphQLErrors( + WorkspaceJoinRequestNotFoundError.defaultMessage + ) + }) + it('should dismiss a workspace', async () => { + const workspace: BasicTestWorkspace = { + id: '', + slug: '', + ownerId: '', + name: cryptoRandomString({ length: 6 }), + description: cryptoRandomString({ length: 12 }) + } + await createTestWorkspace(workspace, testAdminUser) + + await db(WorkspaceJoinRequests.name).insert({ + workspaceId: workspace.id, + userId: testAdminUser.id, + status: 'pending' + }) + + const dismissRes = await apollo.execute(DismissWorkspaceDocument, { + input: { + workspaceId: workspace.id + } + }) + + expect(dismissRes).to.not.haveGraphQLErrors() + expect(dismissRes?.data?.workspaceMutations.dismiss).to.equal(true) + }) + }) + describe('mutation activeUserMutations.userWorkspaceMutations', () => { describe('leave', () => { it('allows the active user to leave a workspace', async () => { diff --git a/packages/server/test/graphql/generated/graphql.ts b/packages/server/test/graphql/generated/graphql.ts index 4d3c4b2bd..8b418fe54 100644 --- a/packages/server/test/graphql/generated/graphql.ts +++ b/packages/server/test/graphql/generated/graphql.ts @@ -4279,6 +4279,10 @@ export type WorkspaceCreationStateInput = { workspaceId: Scalars['ID']['input']; }; +export type WorkspaceDismissInput = { + workspaceId: Scalars['ID']['input']; +}; + export type WorkspaceDomain = { __typename?: 'WorkspaceDomain'; domain: Scalars['String']['output']; @@ -4372,6 +4376,7 @@ export type WorkspaceMutations = { delete: Scalars['Boolean']['output']; deleteDomain: Workspace; deleteSsoProvider: Scalars['Boolean']['output']; + dismiss: Scalars['Boolean']['output']; invites: WorkspaceInviteMutations; join: Workspace; leave: Scalars['Boolean']['output']; @@ -4409,6 +4414,11 @@ export type WorkspaceMutationsDeleteSsoProviderArgs = { }; +export type WorkspaceMutationsDismissArgs = { + input: WorkspaceDismissInput; +}; + + export type WorkspaceMutationsJoinArgs = { input: JoinWorkspaceInput; }; @@ -4861,6 +4871,13 @@ export type OnWorkspaceUpdatedSubscriptionVariables = Exact<{ export type OnWorkspaceUpdatedSubscription = { __typename?: 'Subscription', workspaceUpdated: { __typename?: 'WorkspaceUpdatedMessage', id: string, workspace: { __typename?: 'Workspace', id: string, name: string, slug: string, updatedAt: string, createdAt: string, role?: string | null, readOnly: boolean, team: { __typename?: 'WorkspaceCollaboratorCollection', totalCount: number, items: Array<{ __typename?: 'WorkspaceCollaborator', id: string, role: string, user: { __typename?: 'LimitedUser', id: string, name: string } }> }, invitedTeam?: Array<{ __typename?: 'PendingWorkspaceCollaborator', id: string, inviteId: string, workspaceId: string, workspaceName: string, title: string, role: string, token?: string | null, invitedBy: { __typename?: 'LimitedUser', id: string, name: string }, user?: { __typename?: 'LimitedUser', id: string, name: string } | null }> | null } } }; +export type DismissWorkspaceMutationVariables = Exact<{ + input: WorkspaceDismissInput; +}>; + + +export type DismissWorkspaceMutation = { __typename?: 'Mutation', workspaceMutations: { __typename?: 'WorkspaceMutations', dismiss: boolean } }; + export type BasicStreamAccessRequestFieldsFragment = { __typename?: 'StreamAccessRequest', id: string, requesterId: string, streamId: string, createdAt: string, requester: { __typename?: 'LimitedUser', id: string, name: string } }; export type CreateStreamAccessRequestMutationVariables = Exact<{ @@ -5564,6 +5581,7 @@ export const GetWorkspaceDefaultRegionDocument = {"kind":"Document","definitions export const SetWorkspaceDefaultRegionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetWorkspaceDefaultRegion"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"regionKey"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setDefaultRegion"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"regionKey"},"value":{"kind":"Variable","name":{"kind":"Name","value":"regionKey"}}},{"kind":"Argument","name":{"kind":"Name","value":"workspaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRegion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const OnWorkspaceProjectsUpdatedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"OnWorkspaceProjectsUpdated"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceSlug"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceProjectsUpdated"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"workspaceSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"project"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]} as unknown as DocumentNode; export const OnWorkspaceUpdatedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"OnWorkspaceUpdated"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceSlug"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceUpdated"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"workspaceSlug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceSlug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicWorkspace"}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"invitedTeam"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicPendingWorkspaceCollaborator"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicWorkspace"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicPendingWorkspaceCollaborator"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PendingWorkspaceCollaborator"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inviteId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceName"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"invitedBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"token"}}]}}]} as unknown as DocumentNode; +export const DismissWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"dismissWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceDismissInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"dismiss"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]} as unknown as DocumentNode; export const CreateStreamAccessRequestDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateStreamAccessRequest"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamAccessRequestCreate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StreamAccessRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"requester"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"requesterId"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode; export const GetStreamAccessRequestDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetStreamAccessRequest"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamAccessRequest"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StreamAccessRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"requester"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"requesterId"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode; export const GetFullStreamAccessRequestDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetFullStreamAccessRequest"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamAccessRequest"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"streamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"streamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"}},{"kind":"Field","name":{"kind":"Name","value":"stream"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BasicStreamAccessRequestFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"StreamAccessRequest"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"requester"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"requesterId"}},{"kind":"Field","name":{"kind":"Name","value":"streamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode;