From 17af66543db8f4d79d1e8ef5b72e4ee422fbc41c Mon Sep 17 00:00:00 2001 From: Alessandro Magionami Date: Mon, 13 Jan 2025 18:52:33 +0100 Subject: [PATCH] feat(workspaces): list workspace join requests for admin --- .../typedefs/workspaces.graphql | 34 ++ packages/server/codegen.yml | 4 + .../modules/core/graph/generated/graphql.ts | 366 ++++++++++-------- .../graph/generated/graphql.ts | 31 ++ .../modules/shared/services/paginatedItems.ts | 2 +- .../graph/resolvers/workspaceJoinRequests.ts | 47 +++ .../repositories/workspaceJoinRequests.ts | 62 ++- .../workspaces/tests/helpers/graphql.ts | 33 ++ .../workspaceJoinRequests.graph.spec.ts | 126 ++++++ .../workspacesCore/helpers/graphTypes.ts | 13 +- .../server/test/graphql/generated/graphql.ts | 49 +++ 11 files changed, 609 insertions(+), 158 deletions(-) create mode 100644 packages/server/modules/workspaces/graph/resolvers/workspaceJoinRequests.ts create mode 100644 packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.graph.spec.ts diff --git a/packages/server/assets/workspacesCore/typedefs/workspaces.graphql b/packages/server/assets/workspacesCore/typedefs/workspaces.graphql index 97d360cb60..4eb4cc89c8 100644 --- a/packages/server/assets/workspacesCore/typedefs/workspaces.graphql +++ b/packages/server/assets/workspacesCore/typedefs/workspaces.graphql @@ -28,6 +28,17 @@ extend type Query { Validates the slug, to make sure it contains only valid characters and its not taken. """ validateWorkspaceSlug(slug: String!): Boolean! + + """ + Get all join requests for all the workspaces the user is an admin of + """ + adminWorkspacesJoinRequests( + filter: AdminWorkspaceJoinRequestFilter + cursor: String + limit: Int! = 25 + ): WorkspaceJoinRequestCollection! + @hasServerRole(role: SERVER_USER) + @hasScope(scope: "workspace:read") } input WorkspaceInviteLookupOptions { @@ -450,6 +461,29 @@ type WorkspaceCollection { items: [Workspace!]! } +type WorkspaceJoinRequestCollection { + totalCount: Int! + cursor: String + items: [WorkspaceJoinRequest!]! +} + +type WorkspaceJoinRequest { + workspace: Workspace! + user: LimitedUser! + status: WorkspaceJoinRequestStatus! + createdAt: DateTime! +} + +enum WorkspaceJoinRequestStatus { + pending + accepted + denied +} + +input AdminWorkspaceJoinRequestFilter { + status: WorkspaceJoinRequestStatus +} + extend type User { """ Get discoverable workspaces with verified domains that match the active user's diff --git a/packages/server/codegen.yml b/packages/server/codegen.yml index 24a7a59011..06cf776eb2 100644 --- a/packages/server/codegen.yml +++ b/packages/server/codegen.yml @@ -9,6 +9,7 @@ generates: - 'typescript-resolvers' config: contextType: '@/modules/shared/helpers/typeHelper#GraphQLContext' + allowParentTypeOverride: true mappers: Stream: '@/modules/core/helpers/graphTypes#StreamGraphQLReturn' Commit: '@/modules/core/helpers/graphTypes#CommitGraphQLReturn' @@ -64,6 +65,7 @@ generates: WorkspaceBillingMutations: '@/modules/gatekeeper/helpers/graphTypes#WorkspaceBillingMutationsGraphQLReturn' PendingWorkspaceCollaborator: '@/modules/workspacesCore/helpers/graphTypes#PendingWorkspaceCollaboratorGraphQLReturn' WorkspaceCollaborator: '@/modules/workspacesCore/helpers/graphTypes#WorkspaceCollaboratorGraphQLReturn' + WorkspaceJoinRequest: '@/modules/workspacesCore/helpers/graphTypes#WorkspaceJoinRequestGraphQLReturn' Webhook: '@/modules/webhooks/helpers/graphTypes#WebhookGraphQLReturn' SmartTextEditorValue: '@/modules/core/services/richTextEditorService#SmartTextEditorValueGraphQLReturn' BlobMetadata: '@/modules/blobstorage/domain/types#BlobStorageItem' @@ -105,6 +107,8 @@ config: scalars: JSONObject: Record DateTime: Date + enumValues: + WorkspaceJoinRequestStatus: '@/modules/workspacesCore/helpers/graphTypes#WorkspaceJoinRequestStatusGraphQLReturn' require: - ts-node/register - tsconfig-paths/register diff --git a/packages/server/modules/core/graph/generated/graphql.ts b/packages/server/modules/core/graph/generated/graphql.ts index 6be1bcac43..c8b24a4ca5 100644 --- a/packages/server/modules/core/graph/generated/graphql.ts +++ b/packages/server/modules/core/graph/generated/graphql.ts @@ -1,3 +1,4 @@ +import { WorkspaceJoinRequestStatusGraphQLReturn as WorkspaceJoinRequestStatus } from '@/modules/workspacesCore/helpers/graphTypes'; import { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; import { StreamGraphQLReturn, CommitGraphQLReturn, ProjectGraphQLReturn, ObjectGraphQLReturn, VersionGraphQLReturn, ServerInviteGraphQLReturnType, ModelGraphQLReturn, ModelsTreeItemGraphQLReturn, MutationsObjectGraphQLReturn, LimitedUserGraphQLReturn, UserGraphQLReturn, GraphQLEmptyReturn, StreamCollaboratorGraphQLReturn, ServerInfoGraphQLReturn, BranchGraphQLReturn } from '@/modules/core/helpers/graphTypes'; import { StreamAccessRequestGraphQLReturn, ProjectAccessRequestGraphQLReturn } from '@/modules/accessrequests/helpers/graphTypes'; @@ -5,7 +6,7 @@ import { CommentReplyAuthorCollectionGraphQLReturn, CommentGraphQLReturn } from import { PendingStreamCollaboratorGraphQLReturn } from '@/modules/serverinvites/helpers/graphTypes'; import { FileUploadGraphQLReturn } from '@/modules/fileuploads/helpers/types'; import { AutomateFunctionGraphQLReturn, AutomateFunctionReleaseGraphQLReturn, AutomationGraphQLReturn, AutomationRevisionGraphQLReturn, AutomationRevisionFunctionGraphQLReturn, AutomateRunGraphQLReturn, AutomationRunTriggerGraphQLReturn, AutomationRevisionTriggerDefinitionGraphQLReturn, AutomateFunctionRunGraphQLReturn, TriggeredAutomationsStatusGraphQLReturn, ProjectAutomationMutationsGraphQLReturn, ProjectTriggeredAutomationsStatusUpdatedMessageGraphQLReturn, ProjectAutomationsUpdatedMessageGraphQLReturn, UserAutomateInfoGraphQLReturn } from '@/modules/automate/helpers/graphTypes'; -import { WorkspaceGraphQLReturn, WorkspaceSsoGraphQLReturn, WorkspaceMutationsGraphQLReturn, WorkspaceInviteMutationsGraphQLReturn, WorkspaceProjectMutationsGraphQLReturn, PendingWorkspaceCollaboratorGraphQLReturn, WorkspaceCollaboratorGraphQLReturn, ProjectRoleGraphQLReturn } from '@/modules/workspacesCore/helpers/graphTypes'; +import { WorkspaceGraphQLReturn, WorkspaceSsoGraphQLReturn, WorkspaceMutationsGraphQLReturn, WorkspaceInviteMutationsGraphQLReturn, WorkspaceProjectMutationsGraphQLReturn, PendingWorkspaceCollaboratorGraphQLReturn, WorkspaceCollaboratorGraphQLReturn, WorkspaceJoinRequestGraphQLReturn, ProjectRoleGraphQLReturn } from '@/modules/workspacesCore/helpers/graphTypes'; import { WorkspaceBillingMutationsGraphQLReturn } from '@/modules/gatekeeper/helpers/graphTypes'; import { WebhookGraphQLReturn } from '@/modules/webhooks/helpers/graphTypes'; import { SmartTextEditorValueGraphQLReturn } from '@/modules/core/services/richTextEditorService'; @@ -24,6 +25,7 @@ export type MakeEmpty = export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; export type Omit = Pick>; export type RequireFields = Omit & { [P in K]-?: NonNullable }; +export type EnumResolverSignature = { [key in keyof T]?: AllowedValues }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: { input: string; output: string; } @@ -176,6 +178,10 @@ export type AdminUsersListItem = { registeredUser?: Maybe; }; +export type AdminWorkspaceJoinRequestFilter = { + status?: InputMaybe; +}; + export type ApiToken = { __typename?: 'ApiToken'; createdAt: Scalars['DateTime']['output']; @@ -2525,6 +2531,8 @@ export type Query = { * @deprecated use admin.UserList instead */ adminUsers?: Maybe; + /** Get all join requests for all the workspaces the user is an admin of */ + adminWorkspacesJoinRequests: WorkspaceJoinRequestCollection; /** Gets a specific app from the server. */ app?: Maybe; /** @@ -2652,6 +2660,13 @@ export type QueryAdminUsersArgs = { }; +export type QueryAdminWorkspacesJoinRequestsArgs = { + cursor?: InputMaybe; + filter?: InputMaybe; + limit?: Scalars['Int']['input']; +}; + + export type QueryAppArgs = { id: Scalars['String']['input']; }; @@ -4396,6 +4411,23 @@ export type WorkspaceInviteUseInput = { token: Scalars['String']['input']; }; +export type WorkspaceJoinRequest = { + __typename?: 'WorkspaceJoinRequest'; + createdAt: Scalars['DateTime']['output']; + status: WorkspaceJoinRequestStatus; + user: LimitedUser; + workspace: Workspace; +}; + +export type WorkspaceJoinRequestCollection = { + __typename?: 'WorkspaceJoinRequestCollection'; + cursor?: Maybe; + items: Array; + totalCount: Scalars['Int']['output']; +}; + +export { WorkspaceJoinRequestStatus }; + export type WorkspaceMutations = { __typename?: 'WorkspaceMutations'; addDomain: Workspace; @@ -4741,6 +4773,7 @@ export type ResolversTypes = { AdminUserListItem: ResolverTypeWrapper; AdminUsersListCollection: ResolverTypeWrapper & { items: Array }>; AdminUsersListItem: ResolverTypeWrapper & { invitedUser?: Maybe, registeredUser?: Maybe }>; + AdminWorkspaceJoinRequestFilter: AdminWorkspaceJoinRequestFilter; ApiToken: ResolverTypeWrapper; ApiTokenCreateInput: ApiTokenCreateInput; AppAuthor: ResolverTypeWrapper; @@ -5001,6 +5034,9 @@ export type ResolversTypes = { WorkspaceInviteMutations: ResolverTypeWrapper; WorkspaceInviteResendInput: WorkspaceInviteResendInput; WorkspaceInviteUseInput: WorkspaceInviteUseInput; + WorkspaceJoinRequest: ResolverTypeWrapper; + WorkspaceJoinRequestCollection: ResolverTypeWrapper & { items: Array }>; + WorkspaceJoinRequestStatus: WorkspaceJoinRequestStatusGraphQLReturn; WorkspaceMutations: ResolverTypeWrapper; WorkspacePlan: ResolverTypeWrapper; WorkspacePlanStatuses: WorkspacePlanStatuses; @@ -5039,6 +5075,7 @@ export type ResolversParentTypes = { AdminUserListItem: AdminUserListItem; AdminUsersListCollection: Omit & { items: Array }; AdminUsersListItem: Omit & { invitedUser?: Maybe, registeredUser?: Maybe }; + AdminWorkspaceJoinRequestFilter: AdminWorkspaceJoinRequestFilter; ApiToken: ApiToken; ApiTokenCreateInput: ApiTokenCreateInput; AppAuthor: AppAuthor; @@ -5274,6 +5311,8 @@ export type ResolversParentTypes = { WorkspaceInviteMutations: WorkspaceInviteMutationsGraphQLReturn; WorkspaceInviteResendInput: WorkspaceInviteResendInput; WorkspaceInviteUseInput: WorkspaceInviteUseInput; + WorkspaceJoinRequest: WorkspaceJoinRequestGraphQLReturn; + WorkspaceJoinRequestCollection: Omit & { items: Array }; WorkspaceMutations: WorkspaceMutationsGraphQLReturn; WorkspacePlan: WorkspacePlan; WorkspaceProjectCreateInput: WorkspaceProjectCreateInput; @@ -5328,14 +5367,14 @@ export type IsOwnerDirectiveArgs = { }; export type IsOwnerDirectiveResolver = DirectiveResolverFn; -export type ActiveUserMutationsResolvers = { +export type ActiveUserMutationsResolvers = { emailMutations?: Resolver; finishOnboarding?: Resolver; update?: Resolver>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ActivityResolvers = { +export type ActivityResolvers = { actionType?: Resolver; id?: Resolver; info?: Resolver; @@ -5348,26 +5387,26 @@ export type ActivityResolvers; }; -export type ActivityCollectionResolvers = { +export type ActivityCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AdminInviteListResolvers = { +export type AdminInviteListResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AdminMutationsResolvers = { +export type AdminMutationsResolvers = { updateWorkspacePlan?: Resolver>; __isTypeOf?: IsTypeOfResolverFn; }; -export type AdminQueriesResolvers = { +export type AdminQueriesResolvers = { inviteList?: Resolver>; projectList?: Resolver>; serverStatistics?: Resolver; @@ -5376,14 +5415,14 @@ export type AdminQueriesResolvers; }; -export type AdminUserListResolvers = { +export type AdminUserListResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AdminUserListItemResolvers = { +export type AdminUserListItemResolvers = { avatar?: Resolver, ParentType, ContextType>; company?: Resolver, ParentType, ContextType>; email?: Resolver, ParentType, ContextType>; @@ -5394,20 +5433,20 @@ export type AdminUserListItemResolvers; }; -export type AdminUsersListCollectionResolvers = { +export type AdminUsersListCollectionResolvers = { items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AdminUsersListItemResolvers = { +export type AdminUsersListItemResolvers = { id?: Resolver; invitedUser?: Resolver, ParentType, ContextType>; registeredUser?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ApiTokenResolvers = { +export type ApiTokenResolvers = { createdAt?: Resolver; id?: Resolver; lastChars?: Resolver; @@ -5418,14 +5457,14 @@ export type ApiTokenResolvers; }; -export type AppAuthorResolvers = { +export type AppAuthorResolvers = { avatar?: Resolver, ParentType, ContextType>; id?: Resolver; name?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AuthStrategyResolvers = { +export type AuthStrategyResolvers = { color?: Resolver, ParentType, ContextType>; icon?: Resolver; id?: Resolver; @@ -5434,7 +5473,7 @@ export type AuthStrategyResolvers; }; -export type AutomateFunctionResolvers = { +export type AutomateFunctionResolvers = { creator?: Resolver, ParentType, ContextType>; description?: Resolver; id?: Resolver; @@ -5449,14 +5488,14 @@ export type AutomateFunctionResolvers; }; -export type AutomateFunctionCollectionResolvers = { +export type AutomateFunctionCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AutomateFunctionReleaseResolvers = { +export type AutomateFunctionReleaseResolvers = { commitId?: Resolver; createdAt?: Resolver; function?: Resolver; @@ -5467,14 +5506,14 @@ export type AutomateFunctionReleaseResolvers; }; -export type AutomateFunctionReleaseCollectionResolvers = { +export type AutomateFunctionReleaseCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AutomateFunctionRunResolvers = { +export type AutomateFunctionRunResolvers = { contextView?: Resolver, ParentType, ContextType>; createdAt?: Resolver; elapsed?: Resolver; @@ -5489,7 +5528,7 @@ export type AutomateFunctionRunResolvers; }; -export type AutomateFunctionTemplateResolvers = { +export type AutomateFunctionTemplateResolvers = { id?: Resolver; logo?: Resolver; title?: Resolver; @@ -5497,20 +5536,20 @@ export type AutomateFunctionTemplateResolvers; }; -export type AutomateFunctionTokenResolvers = { +export type AutomateFunctionTokenResolvers = { functionId?: Resolver; functionToken?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AutomateMutationsResolvers = { +export type AutomateMutationsResolvers = { createFunction?: Resolver>; createFunctionWithoutVersion?: Resolver>; updateFunction?: Resolver>; __isTypeOf?: IsTypeOfResolverFn; }; -export type AutomateRunResolvers = { +export type AutomateRunResolvers = { automation?: Resolver; automationId?: Resolver; createdAt?: Resolver; @@ -5522,14 +5561,14 @@ export type AutomateRunResolvers; }; -export type AutomateRunCollectionResolvers = { +export type AutomateRunCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AutomationResolvers = { +export type AutomationResolvers = { createdAt?: Resolver; creationPublicKeys?: Resolver, ParentType, ContextType>; currentRevision?: Resolver, ParentType, ContextType>; @@ -5542,35 +5581,35 @@ export type AutomationResolvers; }; -export type AutomationCollectionResolvers = { +export type AutomationCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AutomationRevisionResolvers = { +export type AutomationRevisionResolvers = { functions?: Resolver, ParentType, ContextType>; id?: Resolver; triggerDefinitions?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type AutomationRevisionFunctionResolvers = { +export type AutomationRevisionFunctionResolvers = { parameters?: Resolver, ParentType, ContextType>; release?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type AutomationRevisionTriggerDefinitionResolvers = { +export type AutomationRevisionTriggerDefinitionResolvers = { __resolveType: TypeResolveFn<'VersionCreatedTriggerDefinition', ParentType, ContextType>; }; -export type AutomationRunTriggerResolvers = { +export type AutomationRunTriggerResolvers = { __resolveType: TypeResolveFn<'VersionCreatedTrigger', ParentType, ContextType>; }; -export type BasicGitRepositoryMetadataResolvers = { +export type BasicGitRepositoryMetadataResolvers = { id?: Resolver; name?: Resolver; owner?: Resolver; @@ -5582,7 +5621,7 @@ export interface BigIntScalarConfig extends GraphQLScalarTypeConfig = { +export type BlobMetadataResolvers = { createdAt?: Resolver; fileHash?: Resolver, ParentType, ContextType>; fileName?: Resolver; @@ -5596,7 +5635,7 @@ export type BlobMetadataResolvers; }; -export type BlobMetadataCollectionResolvers = { +export type BlobMetadataCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver>, ParentType, ContextType>; totalCount?: Resolver; @@ -5604,7 +5643,7 @@ export type BlobMetadataCollectionResolvers; }; -export type BranchResolvers = { +export type BranchResolvers = { activity?: Resolver, ParentType, ContextType, RequireFields>; author?: Resolver, ParentType, ContextType>; commits?: Resolver, ParentType, ContextType, RequireFields>; @@ -5615,14 +5654,14 @@ export type BranchResolvers; }; -export type BranchCollectionResolvers = { +export type BranchCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver>, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type CheckoutSessionResolvers = { +export type CheckoutSessionResolvers = { billingInterval?: Resolver; createdAt?: Resolver; id?: Resolver; @@ -5633,7 +5672,7 @@ export type CheckoutSessionResolvers; }; -export type CommentResolvers = { +export type CommentResolvers = { archived?: Resolver; author?: Resolver; authorId?: Resolver; @@ -5656,20 +5695,20 @@ export type CommentResolvers; }; -export type CommentActivityMessageResolvers = { +export type CommentActivityMessageResolvers = { comment?: Resolver; type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type CommentCollectionResolvers = { +export type CommentCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type CommentDataFiltersResolvers = { +export type CommentDataFiltersResolvers = { hiddenIds?: Resolver>, ParentType, ContextType>; isolatedIds?: Resolver>, ParentType, ContextType>; passMax?: Resolver, ParentType, ContextType>; @@ -5679,7 +5718,7 @@ export type CommentDataFiltersResolvers; }; -export type CommentMutationsResolvers = { +export type CommentMutationsResolvers = { archive?: Resolver>; create?: Resolver>; edit?: Resolver>; @@ -5688,20 +5727,20 @@ export type CommentMutationsResolvers; }; -export type CommentReplyAuthorCollectionResolvers = { +export type CommentReplyAuthorCollectionResolvers = { items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type CommentThreadActivityMessageResolvers = { +export type CommentThreadActivityMessageResolvers = { data?: Resolver, ParentType, ContextType>; reply?: Resolver, ParentType, ContextType>; type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type CommitResolvers = { +export type CommitResolvers = { activity?: Resolver, ParentType, ContextType, RequireFields>; authorAvatar?: Resolver, ParentType, ContextType>; authorId?: Resolver, ParentType, ContextType>; @@ -5722,14 +5761,14 @@ export type CommitResolvers; }; -export type CommitCollectionResolvers = { +export type CommitCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver>, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type CountOnlyCollectionResolvers = { +export type CountOnlyCollectionResolvers = { totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; @@ -5738,7 +5777,7 @@ export interface DateTimeScalarConfig extends GraphQLScalarTypeConfig = { +export type FileUploadResolvers = { branchName?: Resolver; convertedCommitId?: Resolver, ParentType, ContextType>; convertedLastUpdate?: Resolver; @@ -5759,7 +5798,7 @@ export type FileUploadResolvers; }; -export type GendoAiRenderResolvers = { +export type GendoAiRenderResolvers = { camera?: Resolver, ParentType, ContextType>; createdAt?: Resolver; gendoGenerationId?: Resolver, ParentType, ContextType>; @@ -5776,7 +5815,7 @@ export type GendoAiRenderResolvers; }; -export type GendoAiRenderCollectionResolvers = { +export type GendoAiRenderCollectionResolvers = { items?: Resolver>, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; @@ -5786,7 +5825,7 @@ export interface JsonObjectScalarConfig extends GraphQLScalarTypeConfig = { +export type LegacyCommentViewerDataResolvers = { camPos?: Resolver, ParentType, ContextType>; filters?: Resolver; location?: Resolver; @@ -5795,7 +5834,7 @@ export type LegacyCommentViewerDataResolvers; }; -export type LimitedUserResolvers = { +export type LimitedUserResolvers = { activity?: Resolver, ParentType, ContextType, RequireFields>; avatar?: Resolver, ParentType, ContextType>; bio?: Resolver, ParentType, ContextType>; @@ -5813,7 +5852,7 @@ export type LimitedUserResolvers; }; -export type LimitedWorkspaceResolvers = { +export type LimitedWorkspaceResolvers = { defaultLogoIndex?: Resolver; description?: Resolver, ParentType, ContextType>; id?: Resolver; @@ -5823,7 +5862,7 @@ export type LimitedWorkspaceResolvers; }; -export type ModelResolvers = { +export type ModelResolvers = { author?: Resolver; automationsStatus?: Resolver, ParentType, ContextType>; childrenTree?: Resolver, ParentType, ContextType>; @@ -5841,21 +5880,21 @@ export type ModelResolvers; }; -export type ModelCollectionResolvers = { +export type ModelCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ModelMutationsResolvers = { +export type ModelMutationsResolvers = { create?: Resolver>; delete?: Resolver>; update?: Resolver>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ModelsTreeItemResolvers = { +export type ModelsTreeItemResolvers = { children?: Resolver, ParentType, ContextType>; fullName?: Resolver; hasChildren?: Resolver; @@ -5866,14 +5905,14 @@ export type ModelsTreeItemResolvers; }; -export type ModelsTreeItemCollectionResolvers = { +export type ModelsTreeItemCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type MutationResolvers = { +export type MutationResolvers = { _?: Resolver, ParentType, ContextType>; activeUserMutations?: Resolver; admin?: Resolver; @@ -5941,7 +5980,7 @@ export type MutationResolvers; }; -export type ObjectResolvers = { +export type ObjectResolvers = { applicationId?: Resolver, ParentType, ContextType>; children?: Resolver>; commentCount?: Resolver; @@ -5953,26 +5992,26 @@ export type ObjectResolvers; }; -export type ObjectCollectionResolvers = { +export type ObjectCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; objects?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type PasswordStrengthCheckFeedbackResolvers = { +export type PasswordStrengthCheckFeedbackResolvers = { suggestions?: Resolver, ParentType, ContextType>; warning?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type PasswordStrengthCheckResultsResolvers = { +export type PasswordStrengthCheckResultsResolvers = { feedback?: Resolver; score?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type PendingStreamCollaboratorResolvers = { +export type PendingStreamCollaboratorResolvers = { id?: Resolver; inviteId?: Resolver; invitedBy?: Resolver; @@ -5987,7 +6026,7 @@ export type PendingStreamCollaboratorResolvers; }; -export type PendingWorkspaceCollaboratorResolvers = { +export type PendingWorkspaceCollaboratorResolvers = { email?: Resolver, ParentType, ContextType>; id?: Resolver; inviteId?: Resolver; @@ -6003,7 +6042,7 @@ export type PendingWorkspaceCollaboratorResolvers; }; -export type ProjectResolvers = { +export type ProjectResolvers = { allowPublicComments?: Resolver; automation?: Resolver>; automations?: Resolver>; @@ -6038,7 +6077,7 @@ export type ProjectResolvers; }; -export type ProjectAccessRequestResolvers = { +export type ProjectAccessRequestResolvers = { createdAt?: Resolver; id?: Resolver; project?: Resolver; @@ -6048,13 +6087,13 @@ export type ProjectAccessRequestResolvers; }; -export type ProjectAccessRequestMutationsResolvers = { +export type ProjectAccessRequestMutationsResolvers = { create?: Resolver>; use?: Resolver>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectAutomationMutationsResolvers = { +export type ProjectAutomationMutationsResolvers = { create?: Resolver>; createRevision?: Resolver>; createTestAutomation?: Resolver>; @@ -6064,7 +6103,7 @@ export type ProjectAutomationMutationsResolvers; }; -export type ProjectAutomationsUpdatedMessageResolvers = { +export type ProjectAutomationsUpdatedMessageResolvers = { automation?: Resolver, ParentType, ContextType>; automationId?: Resolver; revision?: Resolver, ParentType, ContextType>; @@ -6072,21 +6111,21 @@ export type ProjectAutomationsUpdatedMessageResolvers; }; -export type ProjectCollaboratorResolvers = { +export type ProjectCollaboratorResolvers = { id?: Resolver; role?: Resolver; user?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectCollectionResolvers = { +export type ProjectCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectCommentCollectionResolvers = { +export type ProjectCommentCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalArchivedCount?: Resolver; @@ -6094,21 +6133,21 @@ export type ProjectCommentCollectionResolvers; }; -export type ProjectCommentsUpdatedMessageResolvers = { +export type ProjectCommentsUpdatedMessageResolvers = { comment?: Resolver, ParentType, ContextType>; id?: Resolver; type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectFileImportUpdatedMessageResolvers = { +export type ProjectFileImportUpdatedMessageResolvers = { id?: Resolver; type?: Resolver; upload?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectInviteMutationsResolvers = { +export type ProjectInviteMutationsResolvers = { batchCreate?: Resolver>; cancel?: Resolver>; create?: Resolver>; @@ -6117,14 +6156,14 @@ export type ProjectInviteMutationsResolvers; }; -export type ProjectModelsUpdatedMessageResolvers = { +export type ProjectModelsUpdatedMessageResolvers = { id?: Resolver; model?: Resolver, ParentType, ContextType>; type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectMutationsResolvers = { +export type ProjectMutationsResolvers = { accessRequestMutations?: Resolver; automationMutations?: Resolver>; batchDelete?: Resolver>; @@ -6138,27 +6177,27 @@ export type ProjectMutationsResolvers; }; -export type ProjectPendingModelsUpdatedMessageResolvers = { +export type ProjectPendingModelsUpdatedMessageResolvers = { id?: Resolver; model?: Resolver; type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectPendingVersionsUpdatedMessageResolvers = { +export type ProjectPendingVersionsUpdatedMessageResolvers = { id?: Resolver; type?: Resolver; version?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectRoleResolvers = { +export type ProjectRoleResolvers = { project?: Resolver; role?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectTriggeredAutomationsStatusUpdatedMessageResolvers = { +export type ProjectTriggeredAutomationsStatusUpdatedMessageResolvers = { model?: Resolver; project?: Resolver; run?: Resolver; @@ -6167,21 +6206,21 @@ export type ProjectTriggeredAutomationsStatusUpdatedMessageResolvers; }; -export type ProjectUpdatedMessageResolvers = { +export type ProjectUpdatedMessageResolvers = { id?: Resolver; project?: Resolver, ParentType, ContextType>; type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectVersionsPreviewGeneratedMessageResolvers = { +export type ProjectVersionsPreviewGeneratedMessageResolvers = { objectId?: Resolver; projectId?: Resolver; versionId?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ProjectVersionsUpdatedMessageResolvers = { +export type ProjectVersionsUpdatedMessageResolvers = { id?: Resolver; modelId?: Resolver; type?: Resolver; @@ -6189,12 +6228,13 @@ export type ProjectVersionsUpdatedMessageResolvers; }; -export type QueryResolvers = { +export type QueryResolvers = { _?: Resolver, ParentType, ContextType>; activeUser?: Resolver, ParentType, ContextType>; admin?: Resolver; adminStreams?: Resolver, ParentType, ContextType, RequireFields>; adminUsers?: Resolver, ParentType, ContextType, RequireFields>; + adminWorkspacesJoinRequests?: Resolver>; app?: Resolver, ParentType, ContextType, RequireFields>; apps?: Resolver>>, ParentType, ContextType>; authenticatedAsApp?: Resolver, ParentType, ContextType>; @@ -6228,26 +6268,26 @@ export type QueryResolvers, ParentType, ContextType, RequireFields>; }; -export type ResourceIdentifierResolvers = { +export type ResourceIdentifierResolvers = { resourceId?: Resolver; resourceType?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type RoleResolvers = { +export type RoleResolvers = { description?: Resolver; name?: Resolver; resourceTarget?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ScopeResolvers = { +export type ScopeResolvers = { description?: Resolver; name?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerAppResolvers = { +export type ServerAppResolvers = { author?: Resolver, ParentType, ContextType>; createdAt?: Resolver; description?: Resolver, ParentType, ContextType>; @@ -6263,7 +6303,7 @@ export type ServerAppResolvers; }; -export type ServerAppListItemResolvers = { +export type ServerAppListItemResolvers = { author?: Resolver, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; id?: Resolver; @@ -6275,19 +6315,19 @@ export type ServerAppListItemResolvers; }; -export type ServerAutomateInfoResolvers = { +export type ServerAutomateInfoResolvers = { availableFunctionTemplates?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerConfigurationResolvers = { +export type ServerConfigurationResolvers = { blobSizeLimitBytes?: Resolver; objectMultipartUploadSizeLimitBytes?: Resolver; objectSizeLimitBytes?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerInfoResolvers = { +export type ServerInfoResolvers = { adminContact?: Resolver, ParentType, ContextType>; authStrategies?: Resolver, ParentType, ContextType>; automate?: Resolver; @@ -6312,31 +6352,31 @@ export type ServerInfoResolvers; }; -export type ServerInfoMutationsResolvers = { +export type ServerInfoMutationsResolvers = { multiRegion?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerInviteResolvers = { +export type ServerInviteResolvers = { email?: Resolver; id?: Resolver; invitedBy?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerMigrationResolvers = { +export type ServerMigrationResolvers = { movedFrom?: Resolver, ParentType, ContextType>; movedTo?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerMultiRegionConfigurationResolvers = { +export type ServerMultiRegionConfigurationResolvers = { availableKeys?: Resolver, ParentType, ContextType>; regions?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerRegionItemResolvers = { +export type ServerRegionItemResolvers = { description?: Resolver, ParentType, ContextType>; id?: Resolver; key?: Resolver; @@ -6344,26 +6384,26 @@ export type ServerRegionItemResolvers; }; -export type ServerRegionMutationsResolvers = { +export type ServerRegionMutationsResolvers = { create?: Resolver>; update?: Resolver>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerRoleItemResolvers = { +export type ServerRoleItemResolvers = { id?: Resolver; title?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerStatisticsResolvers = { +export type ServerStatisticsResolvers = { totalPendingInvites?: Resolver; totalProjectCount?: Resolver; totalUserCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type ServerStatsResolvers = { +export type ServerStatsResolvers = { commitHistory?: Resolver>>, ParentType, ContextType>; objectHistory?: Resolver>>, ParentType, ContextType>; streamHistory?: Resolver>>, ParentType, ContextType>; @@ -6375,12 +6415,12 @@ export type ServerStatsResolvers; }; -export type ServerWorkspacesInfoResolvers = { +export type ServerWorkspacesInfoResolvers = { workspacesEnabled?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type SmartTextEditorValueResolvers = { +export type SmartTextEditorValueResolvers = { attachments?: Resolver>, ParentType, ContextType>; doc?: Resolver, ParentType, ContextType>; type?: Resolver; @@ -6388,7 +6428,7 @@ export type SmartTextEditorValueResolvers; }; -export type StreamResolvers = { +export type StreamResolvers = { activity?: Resolver, ParentType, ContextType, RequireFields>; allowPublicComments?: Resolver; blob?: Resolver, ParentType, ContextType, RequireFields>; @@ -6419,7 +6459,7 @@ export type StreamResolvers; }; -export type StreamAccessRequestResolvers = { +export type StreamAccessRequestResolvers = { createdAt?: Resolver; id?: Resolver; requester?: Resolver; @@ -6429,7 +6469,7 @@ export type StreamAccessRequestResolvers; }; -export type StreamCollaboratorResolvers = { +export type StreamCollaboratorResolvers = { avatar?: Resolver, ParentType, ContextType>; company?: Resolver, ParentType, ContextType>; id?: Resolver; @@ -6439,14 +6479,14 @@ export type StreamCollaboratorResolvers; }; -export type StreamCollectionResolvers = { +export type StreamCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver>, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type SubscriptionResolvers = { +export type SubscriptionResolvers = { _?: SubscriptionResolver, "_", ParentType, ContextType>; branchCreated?: SubscriptionResolver, "branchCreated", ParentType, ContextType, RequireFields>; branchDeleted?: SubscriptionResolver, "branchDeleted", ParentType, ContextType, RequireFields>; @@ -6480,32 +6520,32 @@ export type SubscriptionResolvers>; }; -export type TestAutomationRunResolvers = { +export type TestAutomationRunResolvers = { automationRunId?: Resolver; functionRunId?: Resolver; triggers?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type TestAutomationRunTriggerResolvers = { +export type TestAutomationRunTriggerResolvers = { payload?: Resolver; triggerType?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type TestAutomationRunTriggerPayloadResolvers = { +export type TestAutomationRunTriggerPayloadResolvers = { modelId?: Resolver; versionId?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type TokenResourceIdentifierResolvers = { +export type TokenResourceIdentifierResolvers = { id?: Resolver; type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type TriggeredAutomationsStatusResolvers = { +export type TriggeredAutomationsStatusResolvers = { automationRuns?: Resolver, ParentType, ContextType>; id?: Resolver; status?: Resolver; @@ -6513,7 +6553,7 @@ export type TriggeredAutomationsStatusResolvers; }; -export type UserResolvers = { +export type UserResolvers = { activity?: Resolver, ParentType, ContextType, RequireFields>; apiTokens?: Resolver, ParentType, ContextType>; authorizedApps?: Resolver>, ParentType, ContextType>; @@ -6551,13 +6591,13 @@ export type UserResolvers; }; -export type UserAutomateInfoResolvers = { +export type UserAutomateInfoResolvers = { availableGithubOrgs?: Resolver, ParentType, ContextType>; hasAutomateGithubApp?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type UserEmailResolvers = { +export type UserEmailResolvers = { email?: Resolver; id?: Resolver; primary?: Resolver; @@ -6566,7 +6606,7 @@ export type UserEmailResolvers; }; -export type UserEmailMutationsResolvers = { +export type UserEmailMutationsResolvers = { create?: Resolver>; delete?: Resolver>; requestNewEmailVerification?: Resolver, ParentType, ContextType, RequireFields>; @@ -6574,14 +6614,14 @@ export type UserEmailMutationsResolvers; }; -export type UserGendoAiCreditsResolvers = { +export type UserGendoAiCreditsResolvers = { limit?: Resolver; resetDate?: Resolver; used?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type UserProjectCollectionResolvers = { +export type UserProjectCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; numberOfHidden?: Resolver; @@ -6589,20 +6629,20 @@ export type UserProjectCollectionResolvers; }; -export type UserProjectsUpdatedMessageResolvers = { +export type UserProjectsUpdatedMessageResolvers = { id?: Resolver; project?: Resolver, ParentType, ContextType>; type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type UserSearchResultCollectionResolvers = { +export type UserSearchResultCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type UserStreamCollectionResolvers = { +export type UserStreamCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver>, ParentType, ContextType>; numberOfHidden?: Resolver; @@ -6610,7 +6650,7 @@ export type UserStreamCollectionResolvers; }; -export type VersionResolvers = { +export type VersionResolvers = { authorUser?: Resolver, ParentType, ContextType>; automationsStatus?: Resolver, ParentType, ContextType>; commentThreads?: Resolver>; @@ -6628,27 +6668,27 @@ export type VersionResolvers; }; -export type VersionCollectionResolvers = { +export type VersionCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type VersionCreatedTriggerResolvers = { +export type VersionCreatedTriggerResolvers = { model?: Resolver, ParentType, ContextType>; type?: Resolver; version?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type VersionCreatedTriggerDefinitionResolvers = { +export type VersionCreatedTriggerDefinitionResolvers = { model?: Resolver, ParentType, ContextType>; type?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type VersionMutationsResolvers = { +export type VersionMutationsResolvers = { create?: Resolver>; delete?: Resolver>; markReceived?: Resolver>; @@ -6658,20 +6698,20 @@ export type VersionMutationsResolvers; }; -export type ViewerResourceGroupResolvers = { +export type ViewerResourceGroupResolvers = { identifier?: Resolver; items?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ViewerResourceItemResolvers = { +export type ViewerResourceItemResolvers = { modelId?: Resolver, ParentType, ContextType>; objectId?: Resolver; versionId?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type ViewerUserActivityMessageResolvers = { +export type ViewerUserActivityMessageResolvers = { sessionId?: Resolver; state?: Resolver, ParentType, ContextType>; status?: Resolver; @@ -6681,7 +6721,7 @@ export type ViewerUserActivityMessageResolvers; }; -export type WebhookResolvers = { +export type WebhookResolvers = { description?: Resolver, ParentType, ContextType>; enabled?: Resolver, ParentType, ContextType>; hasSecret?: Resolver; @@ -6694,13 +6734,13 @@ export type WebhookResolvers; }; -export type WebhookCollectionResolvers = { +export type WebhookCollectionResolvers = { items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type WebhookEventResolvers = { +export type WebhookEventResolvers = { id?: Resolver; lastUpdate?: Resolver; payload?: Resolver; @@ -6711,13 +6751,13 @@ export type WebhookEventResolvers; }; -export type WebhookEventCollectionResolvers = { +export type WebhookEventCollectionResolvers = { items?: Resolver>>, ParentType, ContextType>; totalCount?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceResolvers = { +export type WorkspaceResolvers = { automateFunctions?: Resolver>; createdAt?: Resolver; creationState?: Resolver, ParentType, ContextType>; @@ -6746,14 +6786,14 @@ export type WorkspaceResolvers; }; -export type WorkspaceBillingMutationsResolvers = { +export type WorkspaceBillingMutationsResolvers = { cancelCheckoutSession?: Resolver>; createCheckoutSession?: Resolver>; upgradePlan?: Resolver>; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceCollaboratorResolvers = { +export type WorkspaceCollaboratorResolvers = { id?: Resolver; projectRoles?: Resolver, ParentType, ContextType>; role?: Resolver; @@ -6761,33 +6801,33 @@ export type WorkspaceCollaboratorResolvers; }; -export type WorkspaceCollaboratorCollectionResolvers = { +export type WorkspaceCollaboratorCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceCollectionResolvers = { +export type WorkspaceCollectionResolvers = { cursor?: Resolver, ParentType, ContextType>; items?: Resolver, ParentType, ContextType>; totalCount?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceCreationStateResolvers = { +export type WorkspaceCreationStateResolvers = { completed?: Resolver; state?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceDomainResolvers = { +export type WorkspaceDomainResolvers = { domain?: Resolver; id?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceInviteMutationsResolvers = { +export type WorkspaceInviteMutationsResolvers = { batchCreate?: Resolver>; cancel?: Resolver>; create?: Resolver>; @@ -6796,7 +6836,24 @@ export type WorkspaceInviteMutationsResolvers; }; -export type WorkspaceMutationsResolvers = { +export type WorkspaceJoinRequestResolvers = { + createdAt?: Resolver; + status?: Resolver; + user?: Resolver; + workspace?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}; + +export type WorkspaceJoinRequestCollectionResolvers = { + cursor?: Resolver, ParentType, ContextType>; + items?: Resolver, ParentType, ContextType>; + totalCount?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}; + +export type WorkspaceJoinRequestStatusResolvers = EnumResolverSignature<{ accepted?: any, denied?: any, pending?: any }, ResolversTypes['WorkspaceJoinRequestStatus']>; + +export type WorkspaceMutationsResolvers = { addDomain?: Resolver>; billing?: Resolver; create?: Resolver>; @@ -6816,21 +6873,21 @@ export type WorkspaceMutationsResolvers; }; -export type WorkspacePlanResolvers = { +export type WorkspacePlanResolvers = { createdAt?: Resolver; name?: Resolver; status?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceProjectMutationsResolvers = { +export type WorkspaceProjectMutationsResolvers = { create?: Resolver>; moveToWorkspace?: Resolver>; updateRole?: Resolver>; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceProjectsUpdatedMessageResolvers = { +export type WorkspaceProjectsUpdatedMessageResolvers = { project?: Resolver, ParentType, ContextType>; projectId?: Resolver; type?: Resolver; @@ -6838,13 +6895,13 @@ export type WorkspaceProjectsUpdatedMessageResolvers; }; -export type WorkspaceSsoResolvers = { +export type WorkspaceSsoResolvers = { provider?: Resolver, ParentType, ContextType>; session?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceSsoProviderResolvers = { +export type WorkspaceSsoProviderResolvers = { clientId?: Resolver; id?: Resolver; issuerUrl?: Resolver; @@ -6852,13 +6909,13 @@ export type WorkspaceSsoProviderResolvers; }; -export type WorkspaceSsoSessionResolvers = { +export type WorkspaceSsoSessionResolvers = { createdAt?: Resolver; validUntil?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceSubscriptionResolvers = { +export type WorkspaceSubscriptionResolvers = { billingInterval?: Resolver; createdAt?: Resolver; currentBillingCycleEnd?: Resolver; @@ -6867,13 +6924,13 @@ export type WorkspaceSubscriptionResolvers; }; -export type WorkspaceSubscriptionSeatsResolvers = { +export type WorkspaceSubscriptionSeatsResolvers = { guest?: Resolver; plan?: Resolver; __isTypeOf?: IsTypeOfResolverFn; }; -export type WorkspaceUpdatedMessageResolvers = { +export type WorkspaceUpdatedMessageResolvers = { id?: Resolver; workspace?: Resolver; __isTypeOf?: IsTypeOfResolverFn; @@ -7025,6 +7082,9 @@ export type Resolvers = { WorkspaceCreationState?: WorkspaceCreationStateResolvers; WorkspaceDomain?: WorkspaceDomainResolvers; WorkspaceInviteMutations?: WorkspaceInviteMutationsResolvers; + WorkspaceJoinRequest?: WorkspaceJoinRequestResolvers; + WorkspaceJoinRequestCollection?: WorkspaceJoinRequestCollectionResolvers; + WorkspaceJoinRequestStatus?: WorkspaceJoinRequestStatusResolvers; WorkspaceMutations?: WorkspaceMutationsResolvers; WorkspacePlan?: WorkspacePlanResolvers; WorkspaceProjectMutations?: WorkspaceProjectMutationsResolvers; 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 766e3f94d4..f06fab3b0c 100644 --- a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts +++ b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts @@ -1,3 +1,4 @@ +import { WorkspaceJoinRequestStatusGraphQLReturn as WorkspaceJoinRequestStatus } from '@/modules/workspacesCore/helpers/graphTypes'; export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { [K in keyof T]: T[K] }; @@ -157,6 +158,10 @@ export type AdminUsersListItem = { registeredUser?: Maybe; }; +export type AdminWorkspaceJoinRequestFilter = { + status?: InputMaybe; +}; + export type ApiToken = { __typename?: 'ApiToken'; createdAt: Scalars['DateTime']['output']; @@ -2506,6 +2511,8 @@ export type Query = { * @deprecated use admin.UserList instead */ adminUsers?: Maybe; + /** Get all join requests for all the workspaces the user is an admin of */ + adminWorkspacesJoinRequests: WorkspaceJoinRequestCollection; /** Gets a specific app from the server. */ app?: Maybe; /** @@ -2633,6 +2640,13 @@ export type QueryAdminUsersArgs = { }; +export type QueryAdminWorkspacesJoinRequestsArgs = { + cursor?: InputMaybe; + filter?: InputMaybe; + limit?: Scalars['Int']['input']; +}; + + export type QueryAppArgs = { id: Scalars['String']['input']; }; @@ -4377,6 +4391,23 @@ export type WorkspaceInviteUseInput = { token: Scalars['String']['input']; }; +export type WorkspaceJoinRequest = { + __typename?: 'WorkspaceJoinRequest'; + createdAt: Scalars['DateTime']['output']; + status: WorkspaceJoinRequestStatus; + user: LimitedUser; + workspace: Workspace; +}; + +export type WorkspaceJoinRequestCollection = { + __typename?: 'WorkspaceJoinRequestCollection'; + cursor?: Maybe; + items: Array; + totalCount: Scalars['Int']['output']; +}; + +export { WorkspaceJoinRequestStatus }; + export type WorkspaceMutations = { __typename?: 'WorkspaceMutations'; addDomain: Workspace; diff --git a/packages/server/modules/shared/services/paginatedItems.ts b/packages/server/modules/shared/services/paginatedItems.ts index 7a0f902758..4960b46d53 100644 --- a/packages/server/modules/shared/services/paginatedItems.ts +++ b/packages/server/modules/shared/services/paginatedItems.ts @@ -20,7 +20,7 @@ export const getPaginatedItemsFactory = getTotalCount }: { getItems: (args: TArgs) => Promise - getTotalCount: (args: TArgs) => Promise + getTotalCount: (args: Omit) => Promise }) => async (args: TArgs): Promise> => { const maybeDecodedCursor = args.cursor ? decodeIsoDateCursor(args.cursor) : null diff --git a/packages/server/modules/workspaces/graph/resolvers/workspaceJoinRequests.ts b/packages/server/modules/workspaces/graph/resolvers/workspaceJoinRequests.ts new file mode 100644 index 0000000000..8f51b0edea --- /dev/null +++ b/packages/server/modules/workspaces/graph/resolvers/workspaceJoinRequests.ts @@ -0,0 +1,47 @@ +import { db } from '@/db/knex' +import { Resolvers } from '@/modules/core/graph/generated/graphql' +import { getPaginatedItemsFactory } from '@/modules/shared/services/paginatedItems' +import { + countAdminWorkspaceJoinRequestsFactory, + getAdminWorkspaceJoinRequestsFactory +} from '@/modules/workspaces/repositories/workspaceJoinRequests' +import { WorkspaceJoinRequestStatus } from '@/modules/workspacesCore/domain/types' +import { WorkspaceJoinRequestGraphQLReturn } from '@/modules/workspacesCore/helpers/graphTypes' + +export default { + Query: { + adminWorkspacesJoinRequests: async (_parent, args, ctx) => { + const { filter, cursor, limit } = args + + return await getPaginatedItemsFactory< + { + limit: number + cursor?: string + filter: { + userId: string + status?: WorkspaceJoinRequestStatus | null + } + }, + WorkspaceJoinRequestGraphQLReturn + >({ + getItems: getAdminWorkspaceJoinRequestsFactory({ db }), + getTotalCount: countAdminWorkspaceJoinRequestsFactory({ db }) + })({ + filter: { + status: filter?.status ?? undefined, + userId: ctx.userId! + }, + cursor: cursor ?? undefined, + limit + }) + } + }, + WorkspaceJoinRequest: { + user: async (parent, _args, ctx) => { + return await ctx.loaders.users.getUser.load(parent.userId) + }, + workspace: async (parent, _args, ctx) => { + return await ctx.loaders.workspaces!.getWorkspace.load(parent.workspaceId) + } + } +} as Resolvers diff --git a/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts b/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts index 57ab83103a..54886e1a0c 100644 --- a/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts +++ b/packages/server/modules/workspaces/repositories/workspaceJoinRequests.ts @@ -2,8 +2,15 @@ import { CreateWorkspaceJoinRequest, UpdateWorkspaceJoinRequestStatus } from '@/modules/workspaces/domain/operations' -import { WorkspaceJoinRequest } from '@/modules/workspacesCore/domain/types' -import { WorkspaceJoinRequests } from '@/modules/workspacesCore/helpers/db' +import { + WorkspaceJoinRequest, + WorkspaceJoinRequestStatus +} from '@/modules/workspacesCore/domain/types' +import { + WorkspaceAcl, + WorkspaceJoinRequests +} from '@/modules/workspacesCore/helpers/db' +import { Roles } from '@speckle/shared' import { Knex } from 'knex' const tables = { @@ -31,3 +38,54 @@ export const updateWorkspaceJoinRequestStatusFactory = .returning('*') return request } + +type WorkspaceJoinRequestFilter = { + status?: WorkspaceJoinRequestStatus | null + userId: string +} + +const adminWorkspaceJoinRequestsBaseQueryFactory = + (db: Knex) => (filter: WorkspaceJoinRequestFilter) => { + const query = tables + .workspaceJoinRequests(db) + .innerJoin( + WorkspaceAcl.name, + WorkspaceAcl.col.workspaceId, + WorkspaceJoinRequests.col.workspaceId + ) + .where(WorkspaceAcl.col.role, Roles.Workspace.Admin) + .where(WorkspaceAcl.col.userId, filter.userId) + if (filter.status) query.andWhere(WorkspaceJoinRequests.col.status, filter.status) + return query + } + +export const getAdminWorkspaceJoinRequestsFactory = + ({ db }: { db: Knex }) => + async ({ + filter, + cursor, + limit + }: { + filter: WorkspaceJoinRequestFilter + cursor?: string + limit: number + }) => { + const query = adminWorkspaceJoinRequestsBaseQueryFactory(db)(filter) + + if (cursor) { + query.andWhere(WorkspaceJoinRequests.col.createdAt, '<', cursor) + } + return await query + .select(WorkspaceJoinRequests.cols) + .orderBy(WorkspaceJoinRequests.col.createdAt, 'desc') + .limit(limit) + } + +export const countAdminWorkspaceJoinRequestsFactory = + ({ db }: { db: Knex }) => + async ({ filter }: { filter: WorkspaceJoinRequestFilter }) => { + const query = adminWorkspaceJoinRequestsBaseQueryFactory(db)(filter) + + const [res] = await query.count() + return parseInt(res.count.toString()) + } diff --git a/packages/server/modules/workspaces/tests/helpers/graphql.ts b/packages/server/modules/workspaces/tests/helpers/graphql.ts index f6a6266775..653a45b9f3 100644 --- a/packages/server/modules/workspaces/tests/helpers/graphql.ts +++ b/packages/server/modules/workspaces/tests/helpers/graphql.ts @@ -323,3 +323,36 @@ export const dismissWorkspaceMutation = gql` } } ` + +export const requestToJoinWorkspaceMutation = gql` + mutation requestToJoinWorkspace($input: WorkspaceRequestToJoinInput!) { + workspaceMutations { + requestToJoin(input: $input) + } + } +` + +export const adminWorkspaceJoinRequestsQuery = gql` + query adminWorkspaceJoinRequests( + $filter: AdminWorkspaceJoinRequestFilter + $cursor: String + $limit: Int + ) { + adminWorkspacesJoinRequests(filter: $filter, cursor: $cursor, limit: $limit) { + items { + status + user { + id + name + } + workspace { + id + name + } + createdAt + } + cursor + totalCount + } + } +` diff --git a/packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.graph.spec.ts b/packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.graph.spec.ts new file mode 100644 index 0000000000..adab67f49f --- /dev/null +++ b/packages/server/modules/workspaces/tests/integration/workspaceJoinRequests.graph.spec.ts @@ -0,0 +1,126 @@ +import { db } from '@/db/knex' +import { createRandomString } from '@/modules/core/helpers/testHelpers' +import { createTestWorkspace } from '@/modules/workspaces/tests/helpers/creation' +import { + BasicTestUser, + createAuthTokenForUser, + createTestUser +} from '@/test/authHelper' +import { + AdminWorkspaceJoinRequestsDocument, + RequestToJoinWorkspaceDocument +} from '@/test/graphql/generated/graphql' +import { createTestContext, testApolloServer } from '@/test/graphqlHelper' +import { beforeEachContext } from '@/test/hooks' +import { AllScopes, Roles } from '@speckle/shared' +import { assert, expect } from 'chai' +import { upsertWorkspaceRoleFactory } from '@/modules/workspaces/repositories/workspaces' + +async function login(user: BasicTestUser) { + const token = await createAuthTokenForUser(user.id, AllScopes) + return await testApolloServer({ + context: await createTestContext({ + auth: true, + userId: user.id, + token, + role: user.role, + scopes: AllScopes + }) + }) +} + +before(async () => { + await beforeEachContext() +}) + +describe('WorkspaceJoinRequests GQL', () => { + describe('User.adminWorkspacesJoinRequests', () => { + it('should return the workspace join requests for the admin', async () => { + const admin = await createTestUser({ + name: 'admin user', + role: Roles.Server.User + }) + + const user1 = await createTestUser({ name: 'user 1', role: Roles.Server.User }) + const user2 = await createTestUser({ name: 'user 2', role: Roles.Server.User }) + + const workspace1 = { + id: createRandomString(), + name: 'Workspace 1', + ownerId: admin.id, + description: '' + } + await createTestWorkspace(workspace1, admin) + + const workspace2 = { + id: createRandomString(), + name: 'Workspace 2', + ownerId: admin.id, + description: '' + } + await createTestWorkspace(workspace2, admin) + + const nobodyWorkspace = { + id: createRandomString(), + name: 'nobody', + ownerId: admin.id, + description: '' + } + await createTestWorkspace(nobodyWorkspace, admin) + + const nonAdminWorkspace = { + id: createRandomString(), + name: 'nonadmin', + ownerId: admin.id, + description: '' + } + await createTestWorkspace(nonAdminWorkspace, admin) + await upsertWorkspaceRoleFactory({ db })({ + userId: admin.id, + workspaceId: nonAdminWorkspace.id, + role: Roles.Workspace.Member, + createdAt: new Date() + }) + + // User1 requests to join workspace1 + const sessionUser1 = await login(user1) + const joinReq1 = await sessionUser1.execute(RequestToJoinWorkspaceDocument, { + input: { + workspaceId: workspace1.id + } + }) + expect(joinReq1).to.not.haveGraphQLErrors() + + // User2 requests to join workspace2 + const sessionUser2 = await login(user2) + const joinReq2 = await sessionUser2.execute(RequestToJoinWorkspaceDocument, { + input: { + workspaceId: workspace2.id + } + }) + expect(joinReq2).to.not.haveGraphQLErrors() + + const sessionAdmin = await login(admin) + const res = await sessionAdmin.execute(AdminWorkspaceJoinRequestsDocument, {}) + expect(res).to.not.haveGraphQLErrors() + + const { items, totalCount } = res.data?.adminWorkspacesJoinRequests + + expect(totalCount).to.equal(2) + + expect(items).to.have.length(2) + assert.deepEqual(items[1], { + status: 'pending', + user: { id: user1.id, name: user1.name }, + workspace: { id: workspace1.id, name: workspace1.name }, + createdAt: items[1].createdAt + }) + assert.deepEqual(items[0], { + status: 'pending', + user: { id: user2.id, name: user2.name }, + workspace: { id: workspace2.id, name: workspace2.name }, + createdAt: items[0].createdAt + }) + }) + }) +}) diff --git a/packages/server/modules/workspacesCore/helpers/graphTypes.ts b/packages/server/modules/workspacesCore/helpers/graphTypes.ts index 34cc0f81d3..0fab0f1644 100644 --- a/packages/server/modules/workspacesCore/helpers/graphTypes.ts +++ b/packages/server/modules/workspacesCore/helpers/graphTypes.ts @@ -1,11 +1,20 @@ import { MutationsObjectGraphQLReturn } from '@/modules/core/helpers/graphTypes' -import { LimitedUserRecord } from '@/modules/core/helpers/types' +import { LimitedUserRecord, UserRecord } from '@/modules/core/helpers/types' import { WorkspaceSsoProviderRecord } from '@/modules/workspaces/domain/sso/types' import { WorkspaceTeamMember } from '@/modules/workspaces/domain/types' -import { Workspace } from '@/modules/workspacesCore/domain/types' +import { + Workspace, + WorkspaceJoinRequest, + WorkspaceJoinRequestStatus +} from '@/modules/workspacesCore/domain/types' import { WorkspaceRoles } from '@speckle/shared' export type WorkspaceGraphQLReturn = Workspace +export type WorkspaceJoinRequestGraphQLReturn = WorkspaceJoinRequest & { + user: UserRecord + workspace: Workspace +} +export type WorkspaceJoinRequestStatusGraphQLReturn = WorkspaceJoinRequestStatus export type WorkspaceBillingGraphQLReturn = { parent: Workspace } export type WorkspaceSsoGraphQLReturn = WorkspaceSsoProviderRecord export type WorkspaceMutationsGraphQLReturn = MutationsObjectGraphQLReturn diff --git a/packages/server/test/graphql/generated/graphql.ts b/packages/server/test/graphql/generated/graphql.ts index e6b38b400d..7a162bef28 100644 --- a/packages/server/test/graphql/generated/graphql.ts +++ b/packages/server/test/graphql/generated/graphql.ts @@ -1,3 +1,4 @@ +import { WorkspaceJoinRequestStatusGraphQLReturn as WorkspaceJoinRequestStatus } from '@/modules/workspacesCore/helpers/graphTypes'; import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; @@ -158,6 +159,10 @@ export type AdminUsersListItem = { registeredUser?: Maybe; }; +export type AdminWorkspaceJoinRequestFilter = { + status?: InputMaybe; +}; + export type ApiToken = { __typename?: 'ApiToken'; createdAt: Scalars['DateTime']['output']; @@ -2507,6 +2512,8 @@ export type Query = { * @deprecated use admin.UserList instead */ adminUsers?: Maybe; + /** Get all join requests for all the workspaces the user is an admin of */ + adminWorkspacesJoinRequests: WorkspaceJoinRequestCollection; /** Gets a specific app from the server. */ app?: Maybe; /** @@ -2634,6 +2641,13 @@ export type QueryAdminUsersArgs = { }; +export type QueryAdminWorkspacesJoinRequestsArgs = { + cursor?: InputMaybe; + filter?: InputMaybe; + limit?: Scalars['Int']['input']; +}; + + export type QueryAppArgs = { id: Scalars['String']['input']; }; @@ -4378,6 +4392,23 @@ export type WorkspaceInviteUseInput = { token: Scalars['String']['input']; }; +export type WorkspaceJoinRequest = { + __typename?: 'WorkspaceJoinRequest'; + createdAt: Scalars['DateTime']['output']; + status: WorkspaceJoinRequestStatus; + user: LimitedUser; + workspace: Workspace; +}; + +export type WorkspaceJoinRequestCollection = { + __typename?: 'WorkspaceJoinRequestCollection'; + cursor?: Maybe; + items: Array; + totalCount: Scalars['Int']['output']; +}; + +export { WorkspaceJoinRequestStatus }; + export type WorkspaceMutations = { __typename?: 'WorkspaceMutations'; addDomain: Workspace; @@ -4898,6 +4929,22 @@ export type DismissWorkspaceMutationVariables = Exact<{ export type DismissWorkspaceMutation = { __typename?: 'Mutation', workspaceMutations: { __typename?: 'WorkspaceMutations', dismiss: boolean } }; +export type RequestToJoinWorkspaceMutationVariables = Exact<{ + input: WorkspaceRequestToJoinInput; +}>; + + +export type RequestToJoinWorkspaceMutation = { __typename?: 'Mutation', workspaceMutations: { __typename?: 'WorkspaceMutations', requestToJoin: boolean } }; + +export type AdminWorkspaceJoinRequestsQueryVariables = Exact<{ + filter?: InputMaybe; + cursor?: InputMaybe; + limit?: InputMaybe; +}>; + + +export type AdminWorkspaceJoinRequestsQuery = { __typename?: 'Query', adminWorkspacesJoinRequests: { __typename?: 'WorkspaceJoinRequestCollection', cursor?: string | null, totalCount: number, items: Array<{ __typename?: 'WorkspaceJoinRequest', status: WorkspaceJoinRequestStatus, createdAt: string, user: { __typename?: 'LimitedUser', id: string, name: string }, workspace: { __typename?: 'Workspace', id: string, name: string } }> } }; + export type BasicStreamAccessRequestFieldsFragment = { __typename?: 'StreamAccessRequest', id: string, requesterId: string, streamId: string, createdAt: string, requester: { __typename?: 'LimitedUser', id: string, name: string } }; export type CreateStreamAccessRequestMutationVariables = Exact<{ @@ -5602,6 +5649,8 @@ export const SetWorkspaceDefaultRegionDocument = {"kind":"Document","definitions 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 RequestToJoinWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"requestToJoinWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceRequestToJoinInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"requestToJoin"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]} as unknown as DocumentNode; +export const AdminWorkspaceJoinRequestsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"adminWorkspaceJoinRequests"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"AdminWorkspaceJoinRequestFilter"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminWorkspacesJoinRequests"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"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":"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":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]} 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;