diff --git a/packages/server/assets/workspacesCore/typedefs/workspaces.graphql b/packages/server/assets/workspacesCore/typedefs/workspaces.graphql index 226b28a18..8114359be 100644 --- a/packages/server/assets/workspacesCore/typedefs/workspaces.graphql +++ b/packages/server/assets/workspacesCore/typedefs/workspaces.graphql @@ -151,6 +151,14 @@ type WorkspaceMutations { invites: WorkspaceInviteMutations! projects: WorkspaceProjectMutations! @hasServerRole(role: SERVER_USER) updateCreationState(input: WorkspaceCreationStateInput!): Boolean! + """ + Dismiss a workspace from the discoverable list, behind the scene a join request is created with the status "dismissed" + """ + 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 c6b5b2735..2019d21b1 100644 --- a/packages/server/modules/core/graph/generated/graphql.ts +++ b/packages/server/modules/core/graph/generated/graphql.ts @@ -4307,6 +4307,10 @@ export type WorkspaceCreationStateInput = { workspaceId: Scalars['ID']['input']; }; +export type WorkspaceDismissInput = { + workspaceId: Scalars['ID']['input']; +}; + export type WorkspaceDomain = { __typename?: 'WorkspaceDomain'; domain: Scalars['String']['output']; @@ -4400,6 +4404,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']; @@ -4437,6 +4442,11 @@ export type WorkspaceMutationsDeleteSsoProviderArgs = { }; +export type WorkspaceMutationsDismissArgs = { + input: WorkspaceDismissInput; +}; + + export type WorkspaceMutationsJoinArgs = { input: JoinWorkspaceInput; }; @@ -4972,6 +4982,7 @@ export type ResolversTypes = { WorkspaceCreateInput: WorkspaceCreateInput; WorkspaceCreationState: ResolverTypeWrapper; WorkspaceCreationStateInput: WorkspaceCreationStateInput; + WorkspaceDismissInput: WorkspaceDismissInput; WorkspaceDomain: ResolverTypeWrapper; WorkspaceDomainDeleteInput: WorkspaceDomainDeleteInput; WorkspaceFeatureName: WorkspaceFeatureName; @@ -5244,6 +5255,7 @@ export type ResolversParentTypes = { WorkspaceCreateInput: WorkspaceCreateInput; WorkspaceCreationState: WorkspaceCreationState; WorkspaceCreationStateInput: WorkspaceCreationStateInput; + WorkspaceDismissInput: WorkspaceDismissInput; WorkspaceDomain: WorkspaceDomain; WorkspaceDomainDeleteInput: WorkspaceDomainDeleteInput; WorkspaceInviteCreateInput: WorkspaceInviteCreateInput; @@ -6779,6 +6791,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 b2c96a2a6..eb11728b8 100644 --- a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts +++ b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts @@ -4288,6 +4288,10 @@ export type WorkspaceCreationStateInput = { workspaceId: Scalars['ID']['input']; }; +export type WorkspaceDismissInput = { + workspaceId: Scalars['ID']['input']; +}; + export type WorkspaceDomain = { __typename?: 'WorkspaceDomain'; domain: Scalars['String']['output']; @@ -4381,6 +4385,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']; @@ -4418,6 +4423,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/graph/resolvers/workspaces.ts b/packages/server/modules/workspaces/graph/resolvers/workspaces.ts index 6e461da93..64825bbe4 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,15 @@ export = FF_WORKSPACES_MODULE_ENABLED return true }, invites: () => ({}), - projects: () => ({}) + projects: () => ({}), + dismiss: async (_parent, args, ctx) => { + return await dismissWorkspaceJoinRequestFactory({ + getWorkspace: getWorkspaceFactory({ db }), + 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..a9ab04ca5 --- /dev/null +++ b/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts @@ -0,0 +1,21 @@ +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) + .insert({ workspaceId, userId, status }) + .onConflict(['workspaceId', 'userId']) + .merge(['status']) + .returning('*') + 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..f758bc091 --- /dev/null +++ b/packages/server/modules/workspaces/services/workspaceJoinRequests.ts @@ -0,0 +1,26 @@ +import { + GetWorkspace, + UpdateWorkspaceJoinRequestStatus +} from '@/modules/workspaces/domain/operations' +import { WorkspaceNotFoundError } from '@/modules/workspaces/errors/workspace' + +export const dismissWorkspaceJoinRequestFactory = + ({ + getWorkspace, + updateWorkspaceJoinRequestStatus + }: { + getWorkspace: GetWorkspace + updateWorkspaceJoinRequestStatus: UpdateWorkspaceJoinRequestStatus + }) => + async ({ userId, workspaceId }: { userId: string; workspaceId: string }) => { + const workspace = await getWorkspace({ workspaceId }) + if (!workspace) { + throw new WorkspaceNotFoundError() + } + await updateWorkspaceJoinRequestStatus({ + userId, + workspaceId, + status: 'dismissed' + }) + 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/workspaceJoinRequests.spec.ts b/packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.spec.ts new file mode 100644 index 000000000..2f8b3c598 --- /dev/null +++ b/packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.spec.ts @@ -0,0 +1,74 @@ +import { db } from '@/db/knex' +import { createRandomString } from '@/modules/core/helpers/testHelpers' +import { getFeatureFlags } from '@/modules/shared/helpers/envHelper' +import { WorkspaceNotFoundError } from '@/modules/workspaces/errors/workspace' +import { updateWorkspaceJoinRequestStatusFactory } from '@/modules/workspaces/repositories/workspaceJoinRequests' +import { getWorkspaceFactory } from '@/modules/workspaces/repositories/workspaces' +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 an error if the workspace does not exists', async () => { + const err = await expectToThrow(() => + dismissWorkspaceJoinRequestFactory({ + getWorkspace: getWorkspaceFactory({ db }), + updateWorkspaceJoinRequestStatus: updateWorkspaceJoinRequestStatusFactory({ + db + }) + })({ workspaceId: createRandomString(), userId: createRandomString() }) + ) + expect(err.message).to.equal(WorkspaceNotFoundError.defaultMessage) + }) + it('creates the request with the dismissed status', 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) + + expect( + await dismissWorkspaceJoinRequestFactory({ + getWorkspace: getWorkspaceFactory({ db }), + updateWorkspaceJoinRequestStatus: updateWorkspaceJoinRequestStatusFactory({ + db + }) + })({ workspaceId: workspace.id, userId: user.id }) + ).to.equal(true) + + expect( + await db(WorkspaceJoinRequests.name) + .where({ workspaceId: workspace.id, userId: user.id }) + .select('status') + .first() + ).to.deep.equal({ status: 'dismissed' }) + }) + }) + } +) 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..261665f2c 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,7 @@ import { } from '@/modules/core/helpers/testHelpers' import { getWorkspaceFactory } from '@/modules/workspaces/repositories/workspaces' import { grantStreamPermissionsFactory } from '@/modules/core/repositories/streams' +import { WorkspaceNotFoundError } from '@/modules/workspaces/errors/workspace' const grantStreamPermissions = grantStreamPermissionsFactory({ db }) @@ -834,6 +836,37 @@ 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(WorkspaceNotFoundError.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) + + 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 cabbd586e..1e328b432 100644 --- a/packages/server/test/graphql/generated/graphql.ts +++ b/packages/server/test/graphql/generated/graphql.ts @@ -4289,6 +4289,10 @@ export type WorkspaceCreationStateInput = { workspaceId: Scalars['ID']['input']; }; +export type WorkspaceDismissInput = { + workspaceId: Scalars['ID']['input']; +}; + export type WorkspaceDomain = { __typename?: 'WorkspaceDomain'; domain: Scalars['String']['output']; @@ -4382,6 +4386,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']; @@ -4419,6 +4424,11 @@ export type WorkspaceMutationsDeleteSsoProviderArgs = { }; +export type WorkspaceMutationsDismissArgs = { + input: WorkspaceDismissInput; +}; + + export type WorkspaceMutationsJoinArgs = { input: JoinWorkspaceInput; }; @@ -4871,6 +4881,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<{ @@ -5574,6 +5591,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;