diff --git a/packages/frontend-2/components/automate/function/Logo.vue b/packages/frontend-2/components/automate/function/Logo.vue index 9d0673ddf..7b314bcb7 100644 --- a/packages/frontend-2/components/automate/function/Logo.vue +++ b/packages/frontend-2/components/automate/function/Logo.vue @@ -8,7 +8,7 @@ import type { MaybeNullOrUndefined } from '@speckle/shared' import { cleanFunctionLogo } from '~/lib/automate/helpers/functions' -type Size = 'base' | 'xs' +type Size = 'base' | 'md' | 'xs' const props = withDefaults( defineProps<{ @@ -30,6 +30,9 @@ const classes = computed(() => { case 'xs': classParts.push('h-4 w-4') break + case 'md': + classParts.push('h-8 w-8') + break case 'base': default: classParts.push('h-10 w-10') diff --git a/packages/frontend-2/components/settings/SectionHeader.vue b/packages/frontend-2/components/settings/SectionHeader.vue index 12abeef93..f17d92d33 100644 --- a/packages/frontend-2/components/settings/SectionHeader.vue +++ b/packages/frontend-2/components/settings/SectionHeader.vue @@ -33,21 +33,13 @@ diff --git a/packages/frontend-2/components/settings/workspaces/automation/Functions/RegenerateTokenDialog.vue b/packages/frontend-2/components/settings/workspaces/automation/Functions/RegenerateTokenDialog.vue new file mode 100644 index 000000000..fe631998a --- /dev/null +++ b/packages/frontend-2/components/settings/workspaces/automation/Functions/RegenerateTokenDialog.vue @@ -0,0 +1,109 @@ + + + diff --git a/packages/frontend-2/components/settings/workspaces/automation/Functions/TableRowActions.vue b/packages/frontend-2/components/settings/workspaces/automation/Functions/TableRowActions.vue new file mode 100644 index 000000000..3df2fbfd5 --- /dev/null +++ b/packages/frontend-2/components/settings/workspaces/automation/Functions/TableRowActions.vue @@ -0,0 +1,80 @@ + + + diff --git a/packages/frontend-2/lib/automate/graphql/mutations.ts b/packages/frontend-2/lib/automate/graphql/mutations.ts index 11c7ede27..84ecacd51 100644 --- a/packages/frontend-2/lib/automate/graphql/mutations.ts +++ b/packages/frontend-2/lib/automate/graphql/mutations.ts @@ -22,3 +22,11 @@ export const updateAutomateFunctionMutation = graphql(` } } `) + +export const regenerateFunctionTokenMutation = graphql(` + mutation RegenerateFunctionToken($functionId: String!) { + automateMutations { + regenerateFunctionToken(functionId: $functionId) + } + } +`) diff --git a/packages/frontend-2/lib/common/generated/gql/gql.ts b/packages/frontend-2/lib/common/generated/gql/gql.ts index c205708e1..c627ee6e8 100644 --- a/packages/frontend-2/lib/common/generated/gql/gql.ts +++ b/packages/frontend-2/lib/common/generated/gql/gql.ts @@ -129,6 +129,10 @@ type Documents = { "\n fragment SettingsWorkspaceGeneralDeleteDialog_Workspace on Workspace {\n id\n name\n }\n": typeof types.SettingsWorkspaceGeneralDeleteDialog_WorkspaceFragmentDoc, "\n fragment SettingsWorkspacesGeneralEditAvatar_Workspace on Workspace {\n id\n logo\n name\n }\n": typeof types.SettingsWorkspacesGeneralEditAvatar_WorkspaceFragmentDoc, "\n fragment SettingsWorkspacesGeneralEditSlugDialog_Workspace on Workspace {\n id\n name\n slug\n }\n": typeof types.SettingsWorkspacesGeneralEditSlugDialog_WorkspaceFragmentDoc, + "\n fragment SettingsWorkspacesAutomationFunctions_AutomateFunction on AutomateFunction {\n id\n name\n logo\n creator {\n id\n name\n avatar\n }\n ...SettingsWorkspacesAutomationTableRowActions_AutomateFunction\n }\n": typeof types.SettingsWorkspacesAutomationFunctions_AutomateFunctionFragmentDoc, + "\n fragment SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction on AutomateFunction {\n id\n name\n }\n": typeof types.SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunctionFragmentDoc, + "\n fragment SettingsWorkspacesAutomationTableRowActions_AutomateFunction on AutomateFunction {\n id\n permissions {\n ...SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks\n }\n ...SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction\n }\n": typeof types.SettingsWorkspacesAutomationTableRowActions_AutomateFunctionFragmentDoc, + "\n fragment SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks on AutomateFunctionPermissionChecks {\n canRegenerateToken {\n ...FullPermissionCheckResult\n }\n }\n": typeof types.SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecksFragmentDoc, "\n fragment WorkspaceBillingPage_Workspace on Workspace {\n id\n role\n subscription {\n currency\n billingInterval\n }\n plan {\n name\n usage {\n projectCount\n modelCount\n }\n }\n ...BillingAlert_Workspace\n }\n": typeof types.WorkspaceBillingPage_WorkspaceFragmentDoc, "\n fragment SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaborator on PendingWorkspaceCollaborator {\n id\n inviteId\n role\n title\n updatedAt\n email\n user {\n id\n ...LimitedUserAvatar\n }\n invitedBy {\n id\n ...LimitedUserAvatar\n }\n }\n": typeof types.SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaboratorFragmentDoc, "\n fragment SettingsWorkspacesMembersInvitesTable_Workspace on Workspace {\n id\n ...SettingsWorkspacesMembersTableHeader_Workspace\n invitedTeam {\n ...SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaborator\n }\n }\n": typeof types.SettingsWorkspacesMembersInvitesTable_WorkspaceFragmentDoc, @@ -200,6 +204,7 @@ type Documents = { "\n fragment SearchAutomateFunctionReleaseItem on AutomateFunctionRelease {\n id\n versionTag\n createdAt\n inputSchema\n }\n": typeof types.SearchAutomateFunctionReleaseItemFragmentDoc, "\n mutation CreateAutomateFunction($input: CreateAutomateFunctionInput!) {\n automateMutations {\n createFunction(input: $input) {\n id\n ...AutomationsFunctionsCard_AutomateFunction\n ...AutomateFunctionCreateDialogDoneStep_AutomateFunction\n }\n }\n }\n": typeof types.CreateAutomateFunctionDocument, "\n mutation UpdateAutomateFunction($input: UpdateAutomateFunctionInput!) {\n automateMutations {\n updateFunction(input: $input) {\n id\n ...AutomateFunctionPage_AutomateFunction\n }\n }\n }\n": typeof types.UpdateAutomateFunctionDocument, + "\n mutation RegenerateFunctionToken($functionId: String!) {\n automateMutations {\n regenerateFunctionToken(functionId: $functionId)\n }\n }\n": typeof types.RegenerateFunctionTokenDocument, "\n query SearchAutomateFunctionReleases(\n $functionId: ID!\n $cursor: String\n $limit: Int\n $filter: AutomateFunctionReleasesFilter\n ) {\n automateFunction(id: $functionId) {\n id\n releases(cursor: $cursor, limit: $limit, filter: $filter) {\n cursor\n totalCount\n items {\n ...SearchAutomateFunctionReleaseItem\n }\n }\n }\n }\n": typeof types.SearchAutomateFunctionReleasesDocument, "\n query FunctionAccessCheck($id: ID!) {\n automateFunction(id: $id) {\n id\n }\n }\n": typeof types.FunctionAccessCheckDocument, "\n query ProjectAutomationCreationPublicKeys(\n $projectId: String!\n $automationId: String!\n ) {\n project(id: $projectId) {\n id\n automation(id: $automationId) {\n id\n creationPublicKeys\n }\n }\n }\n": typeof types.ProjectAutomationCreationPublicKeysDocument, @@ -367,6 +372,7 @@ type Documents = { "\n query SettingsWorkspacesInvitesSearch(\n $slug: String!\n $invitesFilter: PendingWorkspaceCollaboratorsFilter\n ) {\n workspaceBySlug(slug: $slug) {\n id\n ...SettingsWorkspacesMembersTableHeader_Workspace\n invitedTeam(filter: $invitesFilter) {\n ...SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaborator\n }\n }\n }\n": typeof types.SettingsWorkspacesInvitesSearchDocument, "\n query SettingsWorkspacesProjects(\n $slug: String!\n $limit: Int!\n $cursor: String\n $filter: WorkspaceProjectsFilter\n ) {\n workspaceBySlug(slug: $slug) {\n ...SettingsWorkspacesProjects_Workspace\n projects(limit: $limit, cursor: $cursor, filter: $filter) {\n cursor\n ...SettingsWorkspacesProjects_ProjectCollection\n }\n }\n }\n": typeof types.SettingsWorkspacesProjectsDocument, "\n query SettingsWorkspaceSecurity($slug: String!) {\n workspaceBySlug(slug: $slug) {\n ...SettingsWorkspacesSecurity_Workspace\n }\n }\n": typeof types.SettingsWorkspaceSecurityDocument, + "\n query SettingsWorkspaceAutomation($slug: String!, $cursor: String = null) {\n workspaceBySlug(slug: $slug) {\n id\n automateFunctions(\n limit: 10\n cursor: $cursor\n filter: { includeFeatured: false }\n ) {\n items {\n ...SettingsWorkspacesAutomationFunctions_AutomateFunction\n }\n totalCount\n }\n }\n }\n": typeof types.SettingsWorkspaceAutomationDocument, "\n fragment AppAuthorAvatar on AppAuthor {\n id\n name\n avatar\n }\n": typeof types.AppAuthorAvatarFragmentDoc, "\n fragment LimitedUserAvatar on LimitedUser {\n id\n name\n avatar\n }\n": typeof types.LimitedUserAvatarFragmentDoc, "\n fragment ActiveUserAvatar on User {\n id\n name\n avatar\n }\n": typeof types.ActiveUserAvatarFragmentDoc, @@ -594,6 +600,10 @@ const documents: Documents = { "\n fragment SettingsWorkspaceGeneralDeleteDialog_Workspace on Workspace {\n id\n name\n }\n": types.SettingsWorkspaceGeneralDeleteDialog_WorkspaceFragmentDoc, "\n fragment SettingsWorkspacesGeneralEditAvatar_Workspace on Workspace {\n id\n logo\n name\n }\n": types.SettingsWorkspacesGeneralEditAvatar_WorkspaceFragmentDoc, "\n fragment SettingsWorkspacesGeneralEditSlugDialog_Workspace on Workspace {\n id\n name\n slug\n }\n": types.SettingsWorkspacesGeneralEditSlugDialog_WorkspaceFragmentDoc, + "\n fragment SettingsWorkspacesAutomationFunctions_AutomateFunction on AutomateFunction {\n id\n name\n logo\n creator {\n id\n name\n avatar\n }\n ...SettingsWorkspacesAutomationTableRowActions_AutomateFunction\n }\n": types.SettingsWorkspacesAutomationFunctions_AutomateFunctionFragmentDoc, + "\n fragment SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction on AutomateFunction {\n id\n name\n }\n": types.SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunctionFragmentDoc, + "\n fragment SettingsWorkspacesAutomationTableRowActions_AutomateFunction on AutomateFunction {\n id\n permissions {\n ...SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks\n }\n ...SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction\n }\n": types.SettingsWorkspacesAutomationTableRowActions_AutomateFunctionFragmentDoc, + "\n fragment SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks on AutomateFunctionPermissionChecks {\n canRegenerateToken {\n ...FullPermissionCheckResult\n }\n }\n": types.SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecksFragmentDoc, "\n fragment WorkspaceBillingPage_Workspace on Workspace {\n id\n role\n subscription {\n currency\n billingInterval\n }\n plan {\n name\n usage {\n projectCount\n modelCount\n }\n }\n ...BillingAlert_Workspace\n }\n": types.WorkspaceBillingPage_WorkspaceFragmentDoc, "\n fragment SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaborator on PendingWorkspaceCollaborator {\n id\n inviteId\n role\n title\n updatedAt\n email\n user {\n id\n ...LimitedUserAvatar\n }\n invitedBy {\n id\n ...LimitedUserAvatar\n }\n }\n": types.SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaboratorFragmentDoc, "\n fragment SettingsWorkspacesMembersInvitesTable_Workspace on Workspace {\n id\n ...SettingsWorkspacesMembersTableHeader_Workspace\n invitedTeam {\n ...SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaborator\n }\n }\n": types.SettingsWorkspacesMembersInvitesTable_WorkspaceFragmentDoc, @@ -665,6 +675,7 @@ const documents: Documents = { "\n fragment SearchAutomateFunctionReleaseItem on AutomateFunctionRelease {\n id\n versionTag\n createdAt\n inputSchema\n }\n": types.SearchAutomateFunctionReleaseItemFragmentDoc, "\n mutation CreateAutomateFunction($input: CreateAutomateFunctionInput!) {\n automateMutations {\n createFunction(input: $input) {\n id\n ...AutomationsFunctionsCard_AutomateFunction\n ...AutomateFunctionCreateDialogDoneStep_AutomateFunction\n }\n }\n }\n": types.CreateAutomateFunctionDocument, "\n mutation UpdateAutomateFunction($input: UpdateAutomateFunctionInput!) {\n automateMutations {\n updateFunction(input: $input) {\n id\n ...AutomateFunctionPage_AutomateFunction\n }\n }\n }\n": types.UpdateAutomateFunctionDocument, + "\n mutation RegenerateFunctionToken($functionId: String!) {\n automateMutations {\n regenerateFunctionToken(functionId: $functionId)\n }\n }\n": types.RegenerateFunctionTokenDocument, "\n query SearchAutomateFunctionReleases(\n $functionId: ID!\n $cursor: String\n $limit: Int\n $filter: AutomateFunctionReleasesFilter\n ) {\n automateFunction(id: $functionId) {\n id\n releases(cursor: $cursor, limit: $limit, filter: $filter) {\n cursor\n totalCount\n items {\n ...SearchAutomateFunctionReleaseItem\n }\n }\n }\n }\n": types.SearchAutomateFunctionReleasesDocument, "\n query FunctionAccessCheck($id: ID!) {\n automateFunction(id: $id) {\n id\n }\n }\n": types.FunctionAccessCheckDocument, "\n query ProjectAutomationCreationPublicKeys(\n $projectId: String!\n $automationId: String!\n ) {\n project(id: $projectId) {\n id\n automation(id: $automationId) {\n id\n creationPublicKeys\n }\n }\n }\n": types.ProjectAutomationCreationPublicKeysDocument, @@ -832,6 +843,7 @@ const documents: Documents = { "\n query SettingsWorkspacesInvitesSearch(\n $slug: String!\n $invitesFilter: PendingWorkspaceCollaboratorsFilter\n ) {\n workspaceBySlug(slug: $slug) {\n id\n ...SettingsWorkspacesMembersTableHeader_Workspace\n invitedTeam(filter: $invitesFilter) {\n ...SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaborator\n }\n }\n }\n": types.SettingsWorkspacesInvitesSearchDocument, "\n query SettingsWorkspacesProjects(\n $slug: String!\n $limit: Int!\n $cursor: String\n $filter: WorkspaceProjectsFilter\n ) {\n workspaceBySlug(slug: $slug) {\n ...SettingsWorkspacesProjects_Workspace\n projects(limit: $limit, cursor: $cursor, filter: $filter) {\n cursor\n ...SettingsWorkspacesProjects_ProjectCollection\n }\n }\n }\n": types.SettingsWorkspacesProjectsDocument, "\n query SettingsWorkspaceSecurity($slug: String!) {\n workspaceBySlug(slug: $slug) {\n ...SettingsWorkspacesSecurity_Workspace\n }\n }\n": types.SettingsWorkspaceSecurityDocument, + "\n query SettingsWorkspaceAutomation($slug: String!, $cursor: String = null) {\n workspaceBySlug(slug: $slug) {\n id\n automateFunctions(\n limit: 10\n cursor: $cursor\n filter: { includeFeatured: false }\n ) {\n items {\n ...SettingsWorkspacesAutomationFunctions_AutomateFunction\n }\n totalCount\n }\n }\n }\n": types.SettingsWorkspaceAutomationDocument, "\n fragment AppAuthorAvatar on AppAuthor {\n id\n name\n avatar\n }\n": types.AppAuthorAvatarFragmentDoc, "\n fragment LimitedUserAvatar on LimitedUser {\n id\n name\n avatar\n }\n": types.LimitedUserAvatarFragmentDoc, "\n fragment ActiveUserAvatar on User {\n id\n name\n avatar\n }\n": types.ActiveUserAvatarFragmentDoc, @@ -1418,6 +1430,22 @@ export function graphql(source: "\n fragment SettingsWorkspacesGeneralEditAvata * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql(source: "\n fragment SettingsWorkspacesGeneralEditSlugDialog_Workspace on Workspace {\n id\n name\n slug\n }\n"): (typeof documents)["\n fragment SettingsWorkspacesGeneralEditSlugDialog_Workspace on Workspace {\n id\n name\n slug\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n fragment SettingsWorkspacesAutomationFunctions_AutomateFunction on AutomateFunction {\n id\n name\n logo\n creator {\n id\n name\n avatar\n }\n ...SettingsWorkspacesAutomationTableRowActions_AutomateFunction\n }\n"): (typeof documents)["\n fragment SettingsWorkspacesAutomationFunctions_AutomateFunction on AutomateFunction {\n id\n name\n logo\n creator {\n id\n name\n avatar\n }\n ...SettingsWorkspacesAutomationTableRowActions_AutomateFunction\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n fragment SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction on AutomateFunction {\n id\n name\n }\n"): (typeof documents)["\n fragment SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction on AutomateFunction {\n id\n name\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n fragment SettingsWorkspacesAutomationTableRowActions_AutomateFunction on AutomateFunction {\n id\n permissions {\n ...SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks\n }\n ...SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction\n }\n"): (typeof documents)["\n fragment SettingsWorkspacesAutomationTableRowActions_AutomateFunction on AutomateFunction {\n id\n permissions {\n ...SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks\n }\n ...SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n fragment SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks on AutomateFunctionPermissionChecks {\n canRegenerateToken {\n ...FullPermissionCheckResult\n }\n }\n"): (typeof documents)["\n fragment SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks on AutomateFunctionPermissionChecks {\n canRegenerateToken {\n ...FullPermissionCheckResult\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -1702,6 +1730,10 @@ export function graphql(source: "\n mutation CreateAutomateFunction($input: Cre * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql(source: "\n mutation UpdateAutomateFunction($input: UpdateAutomateFunctionInput!) {\n automateMutations {\n updateFunction(input: $input) {\n id\n ...AutomateFunctionPage_AutomateFunction\n }\n }\n }\n"): (typeof documents)["\n mutation UpdateAutomateFunction($input: UpdateAutomateFunctionInput!) {\n automateMutations {\n updateFunction(input: $input) {\n id\n ...AutomateFunctionPage_AutomateFunction\n }\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n mutation RegenerateFunctionToken($functionId: String!) {\n automateMutations {\n regenerateFunctionToken(functionId: $functionId)\n }\n }\n"): (typeof documents)["\n mutation RegenerateFunctionToken($functionId: String!) {\n automateMutations {\n regenerateFunctionToken(functionId: $functionId)\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -2370,6 +2402,10 @@ export function graphql(source: "\n query SettingsWorkspacesProjects(\n $slu * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql(source: "\n query SettingsWorkspaceSecurity($slug: String!) {\n workspaceBySlug(slug: $slug) {\n ...SettingsWorkspacesSecurity_Workspace\n }\n }\n"): (typeof documents)["\n query SettingsWorkspaceSecurity($slug: String!) {\n workspaceBySlug(slug: $slug) {\n ...SettingsWorkspacesSecurity_Workspace\n }\n }\n"]; +/** + * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function graphql(source: "\n query SettingsWorkspaceAutomation($slug: String!, $cursor: String = null) {\n workspaceBySlug(slug: $slug) {\n id\n automateFunctions(\n limit: 10\n cursor: $cursor\n filter: { includeFeatured: false }\n ) {\n items {\n ...SettingsWorkspacesAutomationFunctions_AutomateFunction\n }\n totalCount\n }\n }\n }\n"): (typeof documents)["\n query SettingsWorkspaceAutomation($slug: String!, $cursor: String = null) {\n workspaceBySlug(slug: $slug) {\n id\n automateFunctions(\n limit: 10\n cursor: $cursor\n filter: { includeFeatured: false }\n ) {\n items {\n ...SettingsWorkspacesAutomationFunctions_AutomateFunction\n }\n totalCount\n }\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/frontend-2/lib/common/generated/gql/graphql.ts b/packages/frontend-2/lib/common/generated/gql/graphql.ts index b1ec01042..26fff3440 100644 --- a/packages/frontend-2/lib/common/generated/gql/graphql.ts +++ b/packages/frontend-2/lib/common/generated/gql/graphql.ts @@ -270,12 +270,13 @@ export type AutomateFunction = { isFeatured: Scalars['Boolean']['output']; logo?: Maybe; name: Scalars['String']['output']; + permissions: AutomateFunctionPermissionChecks; releases: AutomateFunctionReleaseCollection; repo: BasicGitRepositoryMetadata; /** SourceAppNames values from @speckle/shared. Empty array means - all of them */ supportedSourceApps: Array; tags: Array; - workspaceIds?: Maybe>; + workspaceIds: Array; }; @@ -292,6 +293,11 @@ export type AutomateFunctionCollection = { totalCount: Scalars['Int']['output']; }; +export type AutomateFunctionPermissionChecks = { + __typename?: 'AutomateFunctionPermissionChecks'; + canRegenerateToken: PermissionCheckResult; +}; + export type AutomateFunctionRelease = { __typename?: 'AutomateFunctionRelease'; commitId: Scalars['String']['output']; @@ -374,6 +380,7 @@ export type AutomateMutations = { __typename?: 'AutomateMutations'; createFunction: AutomateFunction; createFunctionWithoutVersion: AutomateFunctionToken; + regenerateFunctionToken: Scalars['String']['output']; updateFunction: AutomateFunction; }; @@ -388,6 +395,11 @@ export type AutomateMutationsCreateFunctionWithoutVersionArgs = { }; +export type AutomateMutationsRegenerateFunctionTokenArgs = { + functionId: Scalars['String']['input']; +}; + + export type AutomateMutationsUpdateFunctionArgs = { input: UpdateAutomateFunctionInput; }; @@ -5348,7 +5360,7 @@ export type AutomateFunctionCreateDialogDoneStep_AutomateFunctionFragment = { __ export type AutomateFunctionCreateDialogTemplateStep_AutomateFunctionTemplateFragment = { __typename?: 'AutomateFunctionTemplate', id: AutomateFunctionTemplateLanguage, title: string, logo: string, url: string }; -export type AutomateFunctionPageHeader_FunctionFragment = { __typename?: 'AutomateFunction', id: string, name: string, logo?: string | null, workspaceIds?: Array | null, repo: { __typename?: 'BasicGitRepositoryMetadata', id: string, url: string, owner: string, name: string }, releases: { __typename?: 'AutomateFunctionReleaseCollection', totalCount: number } }; +export type AutomateFunctionPageHeader_FunctionFragment = { __typename?: 'AutomateFunction', id: string, name: string, logo?: string | null, workspaceIds: Array, repo: { __typename?: 'BasicGitRepositoryMetadata', id: string, url: string, owner: string, name: string }, releases: { __typename?: 'AutomateFunctionReleaseCollection', totalCount: number } }; export type AutomateFunctionPageHeader_WorkspaceFragment = { __typename?: 'Workspace', id: string, name: string, slug: string }; @@ -5582,6 +5594,14 @@ export type SettingsWorkspacesGeneralEditAvatar_WorkspaceFragment = { __typename export type SettingsWorkspacesGeneralEditSlugDialog_WorkspaceFragment = { __typename?: 'Workspace', id: string, name: string, slug: string }; +export type SettingsWorkspacesAutomationFunctions_AutomateFunctionFragment = { __typename?: 'AutomateFunction', id: string, name: string, logo?: string | null, creator?: { __typename?: 'LimitedUser', id: string, name: string, avatar?: string | null } | null, permissions: { __typename?: 'AutomateFunctionPermissionChecks', canRegenerateToken: { __typename?: 'PermissionCheckResult', authorized: boolean, code: string, message: string, payload?: {} | null } } }; + +export type SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunctionFragment = { __typename?: 'AutomateFunction', id: string, name: string }; + +export type SettingsWorkspacesAutomationTableRowActions_AutomateFunctionFragment = { __typename?: 'AutomateFunction', id: string, name: string, permissions: { __typename?: 'AutomateFunctionPermissionChecks', canRegenerateToken: { __typename?: 'PermissionCheckResult', authorized: boolean, code: string, message: string, payload?: {} | null } } }; + +export type SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecksFragment = { __typename?: 'AutomateFunctionPermissionChecks', canRegenerateToken: { __typename?: 'PermissionCheckResult', authorized: boolean, code: string, message: string, payload?: {} | null } }; + export type WorkspaceBillingPage_WorkspaceFragment = { __typename?: 'Workspace', id: string, role?: string | null, slug: string, subscription?: { __typename?: 'WorkspaceSubscription', billingInterval: BillingInterval, currentBillingCycleEnd: string, currency: Currency } | null, plan?: { __typename?: 'WorkspacePlan', name: WorkspacePlans, status: WorkspacePlanStatuses, createdAt: string, usage: { __typename?: 'WorkspacePlanUsage', projectCount: number, modelCount: number } } | null }; export type SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaboratorFragment = { __typename?: 'PendingWorkspaceCollaborator', id: string, inviteId: string, role: string, title: string, updatedAt: string, email?: string | null, user?: { __typename?: 'LimitedUser', id: string, name: string, avatar?: string | null } | null, invitedBy: { __typename?: 'LimitedUser', id: string, name: string, avatar?: string | null } }; @@ -5786,7 +5806,14 @@ export type UpdateAutomateFunctionMutationVariables = Exact<{ }>; -export type UpdateAutomateFunctionMutation = { __typename?: 'Mutation', automateMutations: { __typename?: 'AutomateMutations', updateFunction: { __typename?: 'AutomateFunction', id: string, name: string, description: string, logo?: string | null, supportedSourceApps: Array, tags: Array, workspaceIds?: Array | null, isFeatured: boolean, creator?: { __typename?: 'LimitedUser', id: string } | null, repo: { __typename?: 'BasicGitRepositoryMetadata', id: string, url: string, owner: string, name: string }, releases: { __typename?: 'AutomateFunctionReleaseCollection', totalCount: number, items: Array<{ __typename?: 'AutomateFunctionRelease', id: string, inputSchema?: {} | null, createdAt: string, commitId: string }> } } } }; +export type UpdateAutomateFunctionMutation = { __typename?: 'Mutation', automateMutations: { __typename?: 'AutomateMutations', updateFunction: { __typename?: 'AutomateFunction', id: string, name: string, description: string, logo?: string | null, supportedSourceApps: Array, tags: Array, workspaceIds: Array, isFeatured: boolean, creator?: { __typename?: 'LimitedUser', id: string } | null, repo: { __typename?: 'BasicGitRepositoryMetadata', id: string, url: string, owner: string, name: string }, releases: { __typename?: 'AutomateFunctionReleaseCollection', totalCount: number, items: Array<{ __typename?: 'AutomateFunctionRelease', id: string, inputSchema?: {} | null, createdAt: string, commitId: string }> } } } }; + +export type RegenerateFunctionTokenMutationVariables = Exact<{ + functionId: Scalars['String']['input']; +}>; + + +export type RegenerateFunctionTokenMutation = { __typename?: 'Mutation', automateMutations: { __typename?: 'AutomateMutations', regenerateFunctionToken: string } }; export type SearchAutomateFunctionReleasesQueryVariables = Exact<{ functionId: Scalars['ID']['input']; @@ -6876,6 +6903,14 @@ export type SettingsWorkspaceSecurityQueryVariables = Exact<{ export type SettingsWorkspaceSecurityQuery = { __typename?: 'Query', workspaceBySlug: { __typename?: 'Workspace', id: string, slug: string, defaultSeatType: WorkspaceSeatType, discoverabilityAutoJoinEnabled: boolean, role?: string | null, discoverabilityEnabled: boolean, domainBasedMembershipProtectionEnabled: boolean, isExclusive: boolean, hasAccessToDomainBasedSecurityPolicies: boolean, hasAccessToSSO: boolean, hasAccessToExclusiveMembership: boolean, domains?: Array<{ __typename?: 'WorkspaceDomain', domain: string, id: string }> | null, sso?: { __typename?: 'WorkspaceSso', provider?: { __typename?: 'WorkspaceSsoProvider', id: string, name: string, clientId: string, issuerUrl: string } | null } | null, permissions: { __typename?: 'WorkspacePermissionChecks', canMakeWorkspaceExclusive: { __typename?: 'PermissionCheckResult', authorized: boolean, message: string } } } }; +export type SettingsWorkspaceAutomationQueryVariables = Exact<{ + slug: Scalars['String']['input']; + cursor?: InputMaybe; +}>; + + +export type SettingsWorkspaceAutomationQuery = { __typename?: 'Query', workspaceBySlug: { __typename?: 'Workspace', id: string, automateFunctions: { __typename?: 'AutomateFunctionCollection', totalCount: number, items: Array<{ __typename?: 'AutomateFunction', id: string, name: string, logo?: string | null, creator?: { __typename?: 'LimitedUser', id: string, name: string, avatar?: string | null } | null, permissions: { __typename?: 'AutomateFunctionPermissionChecks', canRegenerateToken: { __typename?: 'PermissionCheckResult', authorized: boolean, code: string, message: string, payload?: {} | null } } }> } } }; + export type AppAuthorAvatarFragment = { __typename?: 'AppAuthor', id: string, name: string, avatar?: string | null }; export type LimitedUserAvatarFragment = { __typename?: 'LimitedUser', id: string, name: string, avatar?: string | null }; @@ -7438,14 +7473,14 @@ export type ResolveCommentLinkQueryVariables = Exact<{ export type ResolveCommentLinkQuery = { __typename?: 'Query', project: { __typename?: 'Project', comment?: { __typename?: 'Comment', id: string, viewerResources: Array<{ __typename?: 'ViewerResourceItem', modelId?: string | null, versionId?: string | null, objectId: string }> } | null } }; -export type AutomateFunctionPage_AutomateFunctionFragment = { __typename?: 'AutomateFunction', id: string, name: string, description: string, logo?: string | null, supportedSourceApps: Array, tags: Array, workspaceIds?: Array | null, isFeatured: boolean, creator?: { __typename?: 'LimitedUser', id: string } | null, repo: { __typename?: 'BasicGitRepositoryMetadata', id: string, url: string, owner: string, name: string }, releases: { __typename?: 'AutomateFunctionReleaseCollection', totalCount: number, items: Array<{ __typename?: 'AutomateFunctionRelease', id: string, inputSchema?: {} | null, createdAt: string, commitId: string }> } }; +export type AutomateFunctionPage_AutomateFunctionFragment = { __typename?: 'AutomateFunction', id: string, name: string, description: string, logo?: string | null, supportedSourceApps: Array, tags: Array, workspaceIds: Array, isFeatured: boolean, creator?: { __typename?: 'LimitedUser', id: string } | null, repo: { __typename?: 'BasicGitRepositoryMetadata', id: string, url: string, owner: string, name: string }, releases: { __typename?: 'AutomateFunctionReleaseCollection', totalCount: number, items: Array<{ __typename?: 'AutomateFunctionRelease', id: string, inputSchema?: {} | null, createdAt: string, commitId: string }> } }; export type AutomateFunctionPageQueryVariables = Exact<{ functionId: Scalars['ID']['input']; }>; -export type AutomateFunctionPageQuery = { __typename?: 'Query', automateFunction: { __typename?: 'AutomateFunction', id: string, name: string, description: string, logo?: string | null, supportedSourceApps: Array, tags: Array, workspaceIds?: Array | null, isFeatured: boolean, creator?: { __typename?: 'LimitedUser', id: string } | null, repo: { __typename?: 'BasicGitRepositoryMetadata', id: string, url: string, owner: string, name: string }, releases: { __typename?: 'AutomateFunctionReleaseCollection', totalCount: number, items: Array<{ __typename?: 'AutomateFunctionRelease', id: string, inputSchema?: {} | null, createdAt: string, commitId: string }> } }, activeUser?: { __typename?: 'User', workspaces: { __typename?: 'WorkspaceCollection', items: Array<{ __typename?: 'Workspace', id: string, name: string, slug: string }> } } | null }; +export type AutomateFunctionPageQuery = { __typename?: 'Query', automateFunction: { __typename?: 'AutomateFunction', id: string, name: string, description: string, logo?: string | null, supportedSourceApps: Array, tags: Array, workspaceIds: Array, isFeatured: boolean, creator?: { __typename?: 'LimitedUser', id: string } | null, repo: { __typename?: 'BasicGitRepositoryMetadata', id: string, url: string, owner: string, name: string }, releases: { __typename?: 'AutomateFunctionReleaseCollection', totalCount: number, items: Array<{ __typename?: 'AutomateFunctionRelease', id: string, inputSchema?: {} | null, createdAt: string, commitId: string }> } }, activeUser?: { __typename?: 'User', workspaces: { __typename?: 'WorkspaceCollection', items: Array<{ __typename?: 'Workspace', id: string, name: string, slug: string }> } } | null }; export type AutomateFunctionPageWorkspaceQueryVariables = Exact<{ workspaceId: Scalars['String']['input']; @@ -7598,6 +7633,10 @@ export const SettingsUserProfileDeleteAccount_UserFragmentDoc = {"kind":"Documen export const ActiveUserAvatarFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ActiveUserAvatar"},"typeCondition":{"kind":"NamedType","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":"avatar"}}]}}]} as unknown as DocumentNode; export const UserProfileEditDialogAvatar_UserFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserProfileEditDialogAvatar_User"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ActiveUserAvatar"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ActiveUserAvatar"},"typeCondition":{"kind":"NamedType","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":"avatar"}}]}}]} as unknown as DocumentNode; export const SettingsUserProfileDetails_UserFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsUserProfileDetails_User"},"typeCondition":{"kind":"NamedType","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":"company"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserProfileEditDialogAvatar_User"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ActiveUserAvatar"},"typeCondition":{"kind":"NamedType","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":"avatar"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserProfileEditDialogAvatar_User"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ActiveUserAvatar"}}]}}]} as unknown as DocumentNode; +export const SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecksFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionPermissionChecks"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canRegenerateToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullPermissionCheckResult"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PermissionCheckResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"payload"}}]}}]} as unknown as DocumentNode; +export const SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunctionFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; +export const SettingsWorkspacesAutomationTableRowActions_AutomateFunctionFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullPermissionCheckResult"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PermissionCheckResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"payload"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionPermissionChecks"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canRegenerateToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode; +export const SettingsWorkspacesAutomationFunctions_AutomateFunctionFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationFunctions_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"creator"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunction"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullPermissionCheckResult"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PermissionCheckResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"payload"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionPermissionChecks"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canRegenerateToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction"}}]}}]} as unknown as DocumentNode; export const BillingAlert_WorkspaceFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingAlert_Workspace"},"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":"role"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"billingInterval"}},{"kind":"Field","name":{"kind":"Name","value":"currentBillingCycleEnd"}}]}}]}}]} as unknown as DocumentNode; export const WorkspaceBillingPage_WorkspaceFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceBillingPage_Workspace"},"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":"role"}},{"kind":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"billingInterval"}}]}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"usage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"projectCount"}},{"kind":"Field","name":{"kind":"Name","value":"modelCount"}}]}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingAlert_Workspace"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingAlert_Workspace"},"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":"role"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"billingInterval"}},{"kind":"Field","name":{"kind":"Name","value":"currentBillingCycleEnd"}}]}}]}}]} as unknown as DocumentNode; export const InviteDialogSharedSelectUsers_WorkspaceFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InviteDialogSharedSelectUsers_Workspace"},"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":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"defaultSeatType"}}]}}]} as unknown as DocumentNode; @@ -7731,6 +7770,7 @@ export const ActiveUserActiveWorkspaceCheckDocument = {"kind":"Document","defini export const ProjectWorkspaceAccessCheckDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"projectWorkspaceAccessCheck"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"role"}}]}}]}}]}}]} as unknown as DocumentNode; export const CreateAutomateFunctionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateAutomateFunction"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateAutomateFunctionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automateMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createFunction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionCreateDialogDoneStep_AutomateFunction"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isFeatured"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionCreateDialogDoneStep_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"}}]}}]} as unknown as DocumentNode; export const UpdateAutomateFunctionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateAutomateFunction"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateAutomateFunctionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automateMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateFunction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionPage_AutomateFunction"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionPageHeader_Function"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceIds"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionPageParametersDialog_AutomateFunctionRelease"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionRelease"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionPageInfo_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"commitId"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionPageParametersDialog_AutomateFunctionRelease"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isFeatured"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"repo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"url"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateAutomationCreateDialogFunctionParametersStep_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateAutomationCreateDialog_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationsFunctionsCard_AutomateFunction"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateAutomationCreateDialogFunctionParametersStep_AutomateFunction"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateFunctionPage_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"supportedSourceApps"}},{"kind":"Field","name":{"kind":"Name","value":"tags"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionPageHeader_Function"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateFunctionPageInfo_AutomateFunction"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateAutomationCreateDialog_AutomateFunction"}},{"kind":"Field","name":{"kind":"Name","value":"creator"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; +export const RegenerateFunctionTokenDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RegenerateFunctionToken"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"functionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automateMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"regenerateFunctionToken"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"functionId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"functionId"}}}]}]}}]}}]} as unknown as DocumentNode; export const SearchAutomateFunctionReleasesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SearchAutomateFunctionReleases"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"functionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}},{"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"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionReleasesFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automateFunction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"functionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"releases"},"arguments":[{"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"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SearchAutomateFunctionReleaseItem"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SearchAutomateFunctionReleaseItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionRelease"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"versionTag"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"inputSchema"}}]}}]} as unknown as DocumentNode; export const FunctionAccessCheckDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FunctionAccessCheck"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"automateFunction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; export const ProjectAutomationCreationPublicKeysDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ProjectAutomationCreationPublicKeys"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"automationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"project"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"projectId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"automation"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"automationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"creationPublicKeys"}}]}}]}}]}}]} as unknown as DocumentNode; @@ -7874,6 +7914,7 @@ export const SettingsWorkspacesMembersSearchDocument = {"kind":"Document","defin export const SettingsWorkspacesInvitesSearchDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SettingsWorkspacesInvitesSearch"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"invitesFilter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PendingWorkspaceCollaboratorsFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceBySlug"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesMembersTableHeader_Workspace"}},{"kind":"Field","name":{"kind":"Name","value":"invitedTeam"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"invitesFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaborator"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InviteDialogSharedSelectUsers_Workspace"},"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":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"defaultSeatType"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspacesPlan_Workspace"},"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":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"paymentMethod"}},{"kind":"Field","name":{"kind":"Name","value":"usage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"projectCount"}},{"kind":"Field","name":{"kind":"Name","value":"modelCount"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"seats"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"editors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assigned"}},{"kind":"Field","name":{"kind":"Name","value":"available"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assigned"}},{"kind":"Field","name":{"kind":"Name","value":"available"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"subscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"billingInterval"}},{"kind":"Field","name":{"kind":"Name","value":"currentBillingCycleEnd"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"InviteDialogWorkspace_Workspace"},"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":"domainBasedMembershipProtectionEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"defaultSeatType"}},{"kind":"Field","name":{"kind":"Name","value":"domains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"domain"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"seats"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"editors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"available"}}]}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"InviteDialogSharedSelectUsers_Workspace"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspacesPlan_Workspace"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullPermissionCheckResult"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PermissionCheckResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"payload"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"LimitedUserAvatar"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"LimitedUser"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesMembersTableHeader_Workspace"},"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":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"InviteDialogWorkspace_Workspace"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canInvite"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesMembersInvitesTable_PendingWorkspaceCollaborator"},"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":"role"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"LimitedUserAvatar"}}]}},{"kind":"Field","name":{"kind":"Name","value":"invitedBy"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"LimitedUserAvatar"}}]}}]}}]} as unknown as DocumentNode; export const SettingsWorkspacesProjectsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SettingsWorkspacesProjects"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"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":"filter"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceProjectsFilter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceBySlug"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesProjects_Workspace"}},{"kind":"Field","name":{"kind":"Name","value":"projects"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cursor"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesProjects_ProjectCollection"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullPermissionCheckResult"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PermissionCheckResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"payload"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectsDeleteDialog_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"versions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canDelete"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsSharedProjects_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectsDeleteDialog_Project"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"versions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canDelete"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canReadSettings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canRead"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesProjects_Workspace"},"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":"plan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateProject"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesProjects_ProjectCollection"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ProjectCollection"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsSharedProjects_Project"}}]}}]}}]} as unknown as DocumentNode; export const SettingsWorkspaceSecurityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SettingsWorkspaceSecurity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceBySlug"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesSecurity_Workspace"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesSecurityDefaultSeat_Workspace"},"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":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"defaultSeatType"}},{"kind":"Field","name":{"kind":"Name","value":"discoverabilityAutoJoinEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"role"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesSecurityDomainManagement_Workspace"},"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":"role"}},{"kind":"Field","name":{"kind":"Name","value":"discoverabilityEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"domainBasedMembershipProtectionEnabled"}},{"kind":"Field","alias":{"kind":"Name","value":"hasAccessToDomainBasedSecurityPolicies"},"name":{"kind":"Name","value":"hasAccessToFeature"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"featureName"},"value":{"kind":"EnumValue","value":"domainBasedSecurityPolicies"}}]},{"kind":"Field","alias":{"kind":"Name","value":"hasAccessToSSO"},"name":{"kind":"Name","value":"hasAccessToFeature"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"featureName"},"value":{"kind":"EnumValue","value":"oidcSso"}}]},{"kind":"Field","name":{"kind":"Name","value":"domains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"domain"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesSecurityDiscoverability_Workspace"},"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":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"domains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"domain"}}]}},{"kind":"Field","name":{"kind":"Name","value":"discoverabilityEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"discoverabilityAutoJoinEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"defaultSeatType"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesSecuritySsoWrapper_Workspace"},"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":"role"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"sso"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"provider"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"clientId"}},{"kind":"Field","name":{"kind":"Name","value":"issuerUrl"}}]}}]}},{"kind":"Field","alias":{"kind":"Name","value":"hasAccessToSSO"},"name":{"kind":"Name","value":"hasAccessToFeature"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"featureName"},"value":{"kind":"EnumValue","value":"oidcSso"}}]}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesSecurityDomainProtection_Workspace"},"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":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"domainBasedMembershipProtectionEnabled"}},{"kind":"Field","alias":{"kind":"Name","value":"hasAccessToDomainBasedSecurityPolicies"},"name":{"kind":"Name","value":"hasAccessToFeature"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"featureName"},"value":{"kind":"EnumValue","value":"domainBasedSecurityPolicies"}}]},{"kind":"Field","name":{"kind":"Name","value":"domains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesSecurityWorkspaceCreation_Workspace"},"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":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"isExclusive"}},{"kind":"Field","alias":{"kind":"Name","value":"hasAccessToExclusiveMembership"},"name":{"kind":"Name","value":"hasAccessToFeature"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"featureName"},"value":{"kind":"EnumValue","value":"exclusiveMembership"}}]},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canMakeWorkspaceExclusive"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesSecurity_Workspace"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesSecurityDefaultSeat_Workspace"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesSecurityDomainManagement_Workspace"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesSecurityDiscoverability_Workspace"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesSecuritySsoWrapper_Workspace"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesSecurityDomainProtection_Workspace"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesSecurityWorkspaceCreation_Workspace"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]} as unknown as DocumentNode; +export const SettingsWorkspaceAutomationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SettingsWorkspaceAutomation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"NullValue"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceBySlug"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"automateFunctions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"10"}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cursor"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"includeFeatured"},"value":{"kind":"BooleanValue","value":false}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesAutomationFunctions_AutomateFunction"}}]}},{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullPermissionCheckResult"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PermissionCheckResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"payload"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionPermissionChecks"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canRegenerateToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunctionPermissionChecks"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesAutomationRegenerateTokenDialog_AutomateFunction"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SettingsWorkspacesAutomationFunctions_AutomateFunction"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunction"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"creator"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SettingsWorkspacesAutomationTableRowActions_AutomateFunction"}}]}}]} as unknown as DocumentNode; export const ActiveUserMetaDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ActiveUserMeta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"legacyProjectsExplainerCollapsed"}}]}}]}}]}}]} as unknown as DocumentNode; export const UpdateLegacyProjectsExplainerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateLegacyProjectsExplainer"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"value"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUserMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setLegacyProjectsExplainerCollapsed"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"value"},"value":{"kind":"Variable","name":{"kind":"Name","value":"value"}}}]}]}}]}}]}}]} as unknown as DocumentNode; export const OnUserProjectsUpdateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"OnUserProjectsUpdate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userProjectsUpdated"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"project"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectDashboardItem"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FullPermissionCheckResult"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PermissionCheckResult"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"authorized"}},{"kind":"Field","name":{"kind":"Name","value":"code"}},{"kind":"Field","name":{"kind":"Name","value":"message"}},{"kind":"Field","name":{"kind":"Name","value":"payload"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectsModelPageEmbed_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateEmbedTokens"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"embedOptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hideSpeckleBranding"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canEditEmbedOptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectPageModelsActions_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectsModelPageEmbed_Project"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UseFileImport_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectCardImportFileArea_Project"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateModel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"UseFileImport_Project"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectPageModelsCardProject"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectPageModelsActions_Project"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectCardImportFileArea_Project"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateModel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectDashboardItemNoModels"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"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":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"team"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"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":"avatar"}}]}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectPageModelsCardProject"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PendingFileUpload"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FileUpload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"modelName"}},{"kind":"Field","name":{"kind":"Name","value":"convertedStatus"}},{"kind":"Field","name":{"kind":"Name","value":"convertedMessage"}},{"kind":"Field","name":{"kind":"Name","value":"uploadDate"}},{"kind":"Field","name":{"kind":"Name","value":"convertedLastUpdate"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"fileName"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectPageModelsCard_Model"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"lastUpload"},"name":{"kind":"Name","value":"uploads"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}},{"kind":"ObjectField","name":{"kind":"Name","value":"cursor"},"value":{"kind":"NullValue"}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"convertedStatus"}}]}}]}},{"kind":"Field","alias":{"kind":"Name","value":"lastVersion"},"name":{"kind":"Name","value":"versions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}},{"kind":"Argument","name":{"kind":"Name","value":"cursor"},"value":{"kind":"NullValue"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectPageModelsCardRenameDialog"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectPageModelsCardDeleteDialog"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectPageModelsActions"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canUpdate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canDelete"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canCreateVersion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UseFileImport_Model"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectCardImportFileArea_Model"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canCreateVersion"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"UseFileImport_Model"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FunctionRunStatusForSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionRun"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"TriggeredAutomationsStatusSummary"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TriggeredAutomationsStatus"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"automationRuns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"functionRuns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"FunctionRunStatusForSummary"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateRunsTriggerStatusDialogFunctionRun_AutomateFunctionRun"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateFunctionRun"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"results"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"statusMessage"}},{"kind":"Field","name":{"kind":"Name","value":"contextView"}},{"kind":"Field","name":{"kind":"Name","value":"function"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomationsStatusOrderedRuns_AutomationRun"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateRun"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"automation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"functionRuns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateRunsTriggerStatusDialogRunsRows_AutomateRun"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AutomateRun"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"functionRuns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateRunsTriggerStatusDialogFunctionRun_AutomateFunctionRun"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomationsStatusOrderedRuns_AutomationRun"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateRunsTriggerStatusDialog_TriggeredAutomationsStatus"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TriggeredAutomationsStatus"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"automationRuns"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateRunsTriggerStatusDialogRunsRows_AutomateRun"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AutomateRunsTriggerStatus_TriggeredAutomationsStatus"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TriggeredAutomationsStatus"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"TriggeredAutomationsStatusSummary"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateRunsTriggerStatusDialog_TriggeredAutomationsStatus"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectPageLatestItemsModelItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"versionCount"},"name":{"kind":"Name","value":"versions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"commentThreadCount"},"name":{"kind":"Name","value":"commentThreads"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"0"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pendingImportedVersions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PendingFileUpload"}}]}},{"kind":"Field","name":{"kind":"Name","value":"previewUrl"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectPageModelsCard_Model"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectPageModelsCardRenameDialog"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectPageModelsCardDeleteDialog"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectPageModelsActions"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectCardImportFileArea_Model"}},{"kind":"Field","name":{"kind":"Name","value":"automationsStatus"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AutomateRunsTriggerStatus_TriggeredAutomationsStatus"}}]}},{"kind":"Field","name":{"kind":"Name","value":"permissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"canUpdate"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canDelete"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FullPermissionCheckResult"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ProjectDashboardItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Project"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectDashboardItemNoModels"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectCardImportFileArea_Project"}},{"kind":"Field","name":{"kind":"Name","value":"models"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"4"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalCount"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ProjectPageLatestItemsModelItem"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"readOnly"}}]}},{"kind":"Field","name":{"kind":"Name","value":"pendingImportedModels"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"4"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PendingFileUpload"}}]}}]}}]} as unknown as DocumentNode; @@ -7963,6 +8004,7 @@ export type AllObjectTypes = { AuthStrategy: AuthStrategy, AutomateFunction: AutomateFunction, AutomateFunctionCollection: AutomateFunctionCollection, + AutomateFunctionPermissionChecks: AutomateFunctionPermissionChecks, AutomateFunctionRelease: AutomateFunctionRelease, AutomateFunctionReleaseCollection: AutomateFunctionReleaseCollection, AutomateFunctionRun: AutomateFunctionRun, @@ -8224,6 +8266,7 @@ export type AutomateFunctionFieldArgs = { isFeatured: {}, logo: {}, name: {}, + permissions: {}, releases: AutomateFunctionReleasesArgs, repo: {}, supportedSourceApps: {}, @@ -8235,6 +8278,9 @@ export type AutomateFunctionCollectionFieldArgs = { items: {}, totalCount: {}, } +export type AutomateFunctionPermissionChecksFieldArgs = { + canRegenerateToken: {}, +} export type AutomateFunctionReleaseFieldArgs = { commitId: {}, createdAt: {}, @@ -8275,6 +8321,7 @@ export type AutomateFunctionTokenFieldArgs = { export type AutomateMutationsFieldArgs = { createFunction: AutomateMutationsCreateFunctionArgs, createFunctionWithoutVersion: AutomateMutationsCreateFunctionWithoutVersionArgs, + regenerateFunctionToken: AutomateMutationsRegenerateFunctionTokenArgs, updateFunction: AutomateMutationsUpdateFunctionArgs, } export type AutomateRunFieldArgs = { @@ -9619,6 +9666,7 @@ export type AllObjectFieldArgTypes = { AuthStrategy: AuthStrategyFieldArgs, AutomateFunction: AutomateFunctionFieldArgs, AutomateFunctionCollection: AutomateFunctionCollectionFieldArgs, + AutomateFunctionPermissionChecks: AutomateFunctionPermissionChecksFieldArgs, AutomateFunctionRelease: AutomateFunctionReleaseFieldArgs, AutomateFunctionReleaseCollection: AutomateFunctionReleaseCollectionFieldArgs, AutomateFunctionRun: AutomateFunctionRunFieldArgs, diff --git a/packages/frontend-2/lib/common/helpers/route.ts b/packages/frontend-2/lib/common/helpers/route.ts index 7be5a9a08..87c214794 100644 --- a/packages/frontend-2/lib/common/helpers/route.ts +++ b/packages/frontend-2/lib/common/helpers/route.ts @@ -63,6 +63,10 @@ export const settingsWorkspaceRoutes = { name: 'settings-workspaces-slug-projects', route: (slug?: string) => `/settings/workspaces/${slug}/projects` }, + automation: { + name: 'settings-workspaces-slug-automation', + route: (slug?: string) => `/settings/workspaces/${slug}/automation` + }, security: { name: 'settings-workspaces-slug-security', route: (slug?: string) => `/settings/workspaces/${slug}/security` diff --git a/packages/frontend-2/lib/settings/composables/menu.ts b/packages/frontend-2/lib/settings/composables/menu.ts index 2265b8a65..723eb434d 100644 --- a/packages/frontend-2/lib/settings/composables/menu.ts +++ b/packages/frontend-2/lib/settings/composables/menu.ts @@ -33,6 +33,7 @@ graphql(` `) export const useSettingsMenu = () => { + const isAutomateEnabled = useIsAutomateModuleEnabled() const isMultipleEmailsEnabled = useIsMultipleEmailsEnabled().value const isMultiRegionEnabled = useIsMultiregionEnabled() @@ -55,6 +56,16 @@ export const useSettingsMenu = () => { route: (slug?: string) => settingsWorkspaceRoutes.projects.route(slug), permission: [Roles.Workspace.Admin, Roles.Workspace.Member] }, + ...(isAutomateEnabled.value + ? [ + { + title: 'Automation', + name: settingsWorkspaceRoutes.automation.name, + route: (slug?: string) => settingsWorkspaceRoutes.automation.route(slug), + permission: [Roles.Workspace.Admin, Roles.Workspace.Member] + } + ] + : []), { title: 'Security', name: settingsWorkspaceRoutes.security.name, diff --git a/packages/frontend-2/lib/settings/graphql/queries.ts b/packages/frontend-2/lib/settings/graphql/queries.ts index c28f3dbc1..eef9a77e1 100644 --- a/packages/frontend-2/lib/settings/graphql/queries.ts +++ b/packages/frontend-2/lib/settings/graphql/queries.ts @@ -147,3 +147,21 @@ export const settingsWorkspacesSecurityQuery = graphql(` } } `) + +export const settingsWorkspacesAutomationQuery = graphql(` + query SettingsWorkspaceAutomation($slug: String!, $cursor: String = null) { + workspaceBySlug(slug: $slug) { + id + automateFunctions( + limit: 10 + cursor: $cursor + filter: { includeFeatured: false } + ) { + items { + ...SettingsWorkspacesAutomationFunctions_AutomateFunction + } + totalCount + } + } + } +`) diff --git a/packages/frontend-2/pages/settings/workspaces/[slug]/automation.vue b/packages/frontend-2/pages/settings/workspaces/[slug]/automation.vue new file mode 100644 index 000000000..190c18334 --- /dev/null +++ b/packages/frontend-2/pages/settings/workspaces/[slug]/automation.vue @@ -0,0 +1,59 @@ + + + diff --git a/packages/server/assets/automate/typedefs/automate.graphql b/packages/server/assets/automate/typedefs/automate.graphql index c97054753..c3f1c52cc 100644 --- a/packages/server/assets/automate/typedefs/automate.graphql +++ b/packages/server/assets/automate/typedefs/automate.graphql @@ -147,7 +147,7 @@ type AutomateFunction { Only returned if user is a part of this speckle server """ creator: LimitedUser - workspaceIds: [String!] + workspaceIds: [String!]! } type AutomateFunctionToken { @@ -338,6 +338,8 @@ type AutomateMutations { @hasServerRole(role: SERVER_ADMIN) updateFunction(input: UpdateAutomateFunctionInput!): AutomateFunction! @hasScope(scope: "automate-functions:write") + regenerateFunctionToken(functionId: String!): String! + @hasScope(scope: "automate-functions:write") } extend type Project { diff --git a/packages/server/assets/automate/typedefs/permissions.graphql b/packages/server/assets/automate/typedefs/permissions.graphql index 20adf6406..566283abc 100644 --- a/packages/server/assets/automate/typedefs/permissions.graphql +++ b/packages/server/assets/automate/typedefs/permissions.graphql @@ -11,3 +11,11 @@ type AutomationPermissionChecks { extend type ProjectPermissionChecks { canCreateAutomation: PermissionCheckResult! } + +type AutomateFunctionPermissionChecks { + canRegenerateToken: PermissionCheckResult! +} + +extend type AutomateFunction { + permissions: AutomateFunctionPermissionChecks! +} diff --git a/packages/server/codegen.ts b/packages/server/codegen.ts index c994eb60f..47ebad7ba 100644 --- a/packages/server/codegen.ts +++ b/packages/server/codegen.ts @@ -60,6 +60,8 @@ const config: CodegenConfig = { '@/modules/core/helpers/graphTypes#MutationsObjectGraphQLReturn', CommentMutations: '@/modules/core/helpers/graphTypes#MutationsObjectGraphQLReturn', + AutomateFunctionPermissionChecks: + '@/modules/automate/helpers/graphTypes#AutomateFunctionPermissionChecksGraphQLReturn', AutomateMutations: '@/modules/core/helpers/graphTypes#MutationsObjectGraphQLReturn', AdminMutations: diff --git a/packages/server/modules/automate/authz/loaders/index.ts b/packages/server/modules/automate/authz/loaders/index.ts new file mode 100644 index 000000000..7f6c51187 --- /dev/null +++ b/packages/server/modules/automate/authz/loaders/index.ts @@ -0,0 +1,13 @@ +import { convertFunctionToGraphQLReturn } from '@/modules/automate/services/functionManagement' +import { defineModuleLoaders } from '@/modules/loaders' + +export default defineModuleLoaders(async () => { + return { + getAutomateFunction: async ({ functionId }, { dataLoaders }) => { + const automateFunction = await dataLoaders.automationsApi.getFunction.load( + functionId + ) + return automateFunction ? convertFunctionToGraphQLReturn(automateFunction) : null + } + } +}) diff --git a/packages/server/modules/automate/clients/executionEngine.ts b/packages/server/modules/automate/clients/executionEngine.ts index 70d1bbece..20a05a9af 100644 --- a/packages/server/modules/automate/clients/executionEngine.ts +++ b/packages/server/modules/automate/clients/executionEngine.ts @@ -397,6 +397,21 @@ export const updateFunction = async (params: { }) } +export const regenerateFunctionToken = async (params: { + functionId: string + authCode: AuthCodePayload +}): Promise<{ token: string }> => { + const { functionId, authCode } = params + const url = getApiUrl(`/api/v2/functions/${functionId}/tokens/regenerate`) + return await invokeJsonRequest<{ token: string }>({ + url, + method: 'POST', + body: { + speckleServerAuthenticationPayload: addOrigin(authCode) + } + }) +} + export type GetFunctionResponse = FunctionWithVersionsSchemaType & { versionCount: number versionCursor: Nullable diff --git a/packages/server/modules/automate/graph/mocks/automate.ts b/packages/server/modules/automate/graph/mocks/automate.ts index 5177aaeca..2d7d9d5ff 100644 --- a/packages/server/modules/automate/graph/mocks/automate.ts +++ b/packages/server/modules/automate/graph/mocks/automate.ts @@ -255,6 +255,13 @@ const mocks: SpeckleModuleMocksConfig = FF_AUTOMATE_MODULE_ENABLED }), releases: () => store.get('AutomateFunctionReleaseCollection') as any }, + AutomateFunctionPermissionChecks: { + canRegenerateToken: () => ({ + authorized: faker.datatype.boolean(), + code: faker.string.alphanumeric(10), + message: faker.lorem.words(10) + }) + }, AutomateFunctionRelease: { function: () => store.get('AutomateFunction') as any }, diff --git a/packages/server/modules/automate/graph/resolvers/automate.ts b/packages/server/modules/automate/graph/resolvers/automate.ts index 7b5bd2263..510a7d08b 100644 --- a/packages/server/modules/automate/graph/resolvers/automate.ts +++ b/packages/server/modules/automate/graph/resolvers/automate.ts @@ -8,7 +8,8 @@ import { getFunctionReleasesFactory, getUserGithubAuthState, getUserGithubOrganizations, - getUserFunctionsFactory + getUserFunctionsFactory, + regenerateFunctionToken } from '@/modules/automate/clients/executionEngine' import { GetProjectAutomationsParams, @@ -49,6 +50,7 @@ import { convertFunctionReleaseToGraphQLReturn, convertFunctionToGraphQLReturn, createFunctionFromTemplateFactory, + regenerateFunctionTokenFactory, updateFunctionFactory } from '@/modules/automate/services/functionManagement' import { @@ -630,6 +632,31 @@ export default (FF_AUTOMATE_MODULE_ENABLED operationDescription: 'Update an Automate function' } ) + }, + regenerateFunctionToken: async (_parent, args, context) => { + const { functionId } = args + + const authResult = + await context.authPolicies.automate.function.canRegenerateToken({ + functionId, + userId: context.userId + }) + throwIfAuthNotOk(authResult) + + const logger = context.log.child({ + functionId + }) + + return await regenerateFunctionTokenFactory({ + regenerateFunctionToken, + getFunction: getFunctionFactory({ logger }), + createStoredAuthCode: createStoredAuthCodeFactory({ + redis: getGenericRedis() + }) + })({ + functionId, + userId: context.userId! + }) } }, ProjectAutomationMutations: { diff --git a/packages/server/modules/automate/graph/resolvers/permissions.ts b/packages/server/modules/automate/graph/resolvers/permissions.ts index baa9faff3..261bb7c5b 100644 --- a/packages/server/modules/automate/graph/resolvers/permissions.ts +++ b/packages/server/modules/automate/graph/resolvers/permissions.ts @@ -30,6 +30,19 @@ export default { return Authz.toGraphqlResult(canDeleteAutomation) } }, + AutomateFunction: { + permissions: (parent) => ({ functionId: parent.id }) + }, + AutomateFunctionPermissionChecks: { + canRegenerateToken: async (parent, _args, context) => { + const authResult = + await context.authPolicies.automate.function.canRegenerateToken({ + functionId: parent.functionId, + userId: context.userId + }) + return Authz.toGraphqlResult(authResult) + } + }, ProjectPermissionChecks: { canCreateAutomation: async (parent, _args, context) => { const canCreateAutomation = diff --git a/packages/server/modules/automate/helpers/graphTypes.ts b/packages/server/modules/automate/helpers/graphTypes.ts index d98c54d46..ed04cf3ef 100644 --- a/packages/server/modules/automate/helpers/graphTypes.ts +++ b/packages/server/modules/automate/helpers/graphTypes.ts @@ -97,3 +97,4 @@ export type ProjectAutomationsUpdatedMessageGraphQLReturn = Merge< export type UserAutomateInfoGraphQLReturn = { userId: string } export type AutomationPermissionChecksGraphQLReturn = { projectId: string } +export type AutomateFunctionPermissionChecksGraphQLReturn = { functionId: string } diff --git a/packages/server/modules/automate/services/authCode.ts b/packages/server/modules/automate/services/authCode.ts index bdc5fb9ce..25b74440b 100644 --- a/packages/server/modules/automate/services/authCode.ts +++ b/packages/server/modules/automate/services/authCode.ts @@ -15,6 +15,7 @@ export enum AuthCodePayloadAction { ListUserFunctions = 'listUserFunctions', BecomeFunctionAuthor = 'becomeFunctionAuthor', GetAvailableGithubOrganizations = 'getAvailableGithubOrganizations', + GenerateFunctionToken = 'generateFunctionToken', UpdateFunction = 'updateFunction' } diff --git a/packages/server/modules/automate/services/functionManagement.ts b/packages/server/modules/automate/services/functionManagement.ts index 39dcace79..810559037 100644 --- a/packages/server/modules/automate/services/functionManagement.ts +++ b/packages/server/modules/automate/services/functionManagement.ts @@ -3,6 +3,7 @@ import { ExecutionEngineFunctionTemplateId, createFunction, getFunctionFactory, + regenerateFunctionToken, updateFunction as updateExecEngineFunction } from '@/modules/automate/clients/executionEngine' import { @@ -107,7 +108,7 @@ export const convertFunctionToGraphQLReturn = ( tags: fn.tags, supportedSourceApps: fn.supportedSourceApps, functionCreator, - workspaceIds: fn.workspaceIds + workspaceIds: fn.workspaceIds ?? [] } return ret @@ -185,7 +186,8 @@ export const createFunctionFromTemplateFactory = functionCreator: { speckleServerOrigin: getServerOrigin(), speckleUserId: user.id - } + }, + workspaceIds: [] } return { @@ -290,3 +292,30 @@ export const handleAutomateFunctionCreatorAuthCallbackFactory = return res.redirect(redirectUrl.toString()) } + +export const regenerateFunctionTokenFactory = + (deps: { + regenerateFunctionToken: typeof regenerateFunctionToken + getFunction: ReturnType + createStoredAuthCode: CreateStoredAuthCode + }) => + async (params: { functionId: string; userId: string }) => { + const { functionId, userId } = params + + const existingFunction = await deps.getFunction({ functionId }) + if (!existingFunction) { + throw new AutomateFunctionUpdateError('Function not found') + } + + const authCode = await deps.createStoredAuthCode({ + userId, + action: AuthCodePayloadAction.GenerateFunctionToken + }) + + const res = await deps.regenerateFunctionToken({ + functionId, + authCode + }) + + return res.token + } diff --git a/packages/server/modules/core/errors/automate.ts b/packages/server/modules/core/errors/automate.ts new file mode 100644 index 000000000..0d8817c6f --- /dev/null +++ b/packages/server/modules/core/errors/automate.ts @@ -0,0 +1,7 @@ +import { BaseError } from '@/modules/shared/errors/base' + +export class AutomateModuleDisabledError extends BaseError { + static defaultMessage = 'Automate is not enabled on this server' + static code = 'AUTOMATE_MODULE_DISABLED_ERROR' + static statusCode = 403 +} diff --git a/packages/server/modules/core/graph/generated/graphql.ts b/packages/server/modules/core/graph/generated/graphql.ts index e643ccaa8..1038a5378 100644 --- a/packages/server/modules/core/graph/generated/graphql.ts +++ b/packages/server/modules/core/graph/generated/graphql.ts @@ -1,10 +1,10 @@ import { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; import { StreamGraphQLReturn, CommitGraphQLReturn, ProjectGraphQLReturn, ObjectGraphQLReturn, VersionGraphQLReturn, ServerInviteGraphQLReturnType, ModelGraphQLReturn, ModelsTreeItemGraphQLReturn, MutationsObjectGraphQLReturn, LimitedUserGraphQLReturn, UserGraphQLReturn, EmbedTokenGraphQLReturn, GraphQLEmptyReturn, StreamCollaboratorGraphQLReturn, ProjectCollaboratorGraphQLReturn, ServerInfoGraphQLReturn, BranchGraphQLReturn, UserMetaGraphQLReturn, ProjectPermissionChecksGraphQLReturn, ModelPermissionChecksGraphQLReturn, VersionPermissionChecksGraphQLReturn, RootPermissionChecksGraphQLReturn } from '@/modules/core/helpers/graphTypes'; import { StreamAccessRequestGraphQLReturn, ProjectAccessRequestGraphQLReturn } from '@/modules/accessrequests/helpers/graphTypes'; +import { AutomateFunctionPermissionChecksGraphQLReturn, AutomateFunctionGraphQLReturn, AutomateFunctionReleaseGraphQLReturn, AutomationGraphQLReturn, AutomationPermissionChecksGraphQLReturn, AutomationRevisionGraphQLReturn, AutomationRevisionFunctionGraphQLReturn, AutomateRunGraphQLReturn, AutomationRunTriggerGraphQLReturn, AutomationRevisionTriggerDefinitionGraphQLReturn, AutomateFunctionRunGraphQLReturn, TriggeredAutomationsStatusGraphQLReturn, ProjectAutomationMutationsGraphQLReturn, ProjectTriggeredAutomationsStatusUpdatedMessageGraphQLReturn, ProjectAutomationsUpdatedMessageGraphQLReturn, UserAutomateInfoGraphQLReturn } from '@/modules/automate/helpers/graphTypes'; import { CommentReplyAuthorCollectionGraphQLReturn, CommentGraphQLReturn, CommentPermissionChecksGraphQLReturn } from '@/modules/comments/helpers/graphTypes'; import { PendingStreamCollaboratorGraphQLReturn } from '@/modules/serverinvites/helpers/graphTypes'; import { FileUploadGraphQLReturn } from '@/modules/fileuploads/helpers/types'; -import { AutomateFunctionGraphQLReturn, AutomateFunctionReleaseGraphQLReturn, AutomationGraphQLReturn, AutomationPermissionChecksGraphQLReturn, AutomationRevisionGraphQLReturn, AutomationRevisionFunctionGraphQLReturn, AutomateRunGraphQLReturn, AutomationRunTriggerGraphQLReturn, AutomationRevisionTriggerDefinitionGraphQLReturn, AutomateFunctionRunGraphQLReturn, TriggeredAutomationsStatusGraphQLReturn, ProjectAutomationMutationsGraphQLReturn, ProjectTriggeredAutomationsStatusUpdatedMessageGraphQLReturn, ProjectAutomationsUpdatedMessageGraphQLReturn, UserAutomateInfoGraphQLReturn } from '@/modules/automate/helpers/graphTypes'; import { WorkspaceGraphQLReturn, WorkspaceSsoGraphQLReturn, WorkspaceMutationsGraphQLReturn, WorkspaceJoinRequestMutationsGraphQLReturn, WorkspaceInviteMutationsGraphQLReturn, WorkspaceProjectMutationsGraphQLReturn, PendingWorkspaceCollaboratorGraphQLReturn, WorkspaceCollaboratorGraphQLReturn, LimitedWorkspaceGraphQLReturn, LimitedWorkspaceCollaboratorGraphQLReturn, WorkspaceJoinRequestGraphQLReturn, LimitedWorkspaceJoinRequestGraphQLReturn, ProjectMoveToWorkspaceDryRunGraphQLReturn, ProjectRoleGraphQLReturn, WorkspacePermissionChecksGraphQLReturn } from '@/modules/workspacesCore/helpers/graphTypes'; import { WorkspacePlanGraphQLReturn, WorkspacePlanUsageGraphQLReturn, PriceGraphQLReturn } from '@/modules/gatekeeperCore/helpers/graphTypes'; import { WorkspaceBillingMutationsGraphQLReturn, WorkspaceSubscriptionSeatsGraphQLReturn, WorkspaceSubscriptionGraphQLReturn } from '@/modules/gatekeeper/helpers/graphTypes'; @@ -289,12 +289,13 @@ export type AutomateFunction = { isFeatured: Scalars['Boolean']['output']; logo?: Maybe; name: Scalars['String']['output']; + permissions: AutomateFunctionPermissionChecks; releases: AutomateFunctionReleaseCollection; repo: BasicGitRepositoryMetadata; /** SourceAppNames values from @speckle/shared. Empty array means - all of them */ supportedSourceApps: Array; tags: Array; - workspaceIds?: Maybe>; + workspaceIds: Array; }; @@ -311,6 +312,11 @@ export type AutomateFunctionCollection = { totalCount: Scalars['Int']['output']; }; +export type AutomateFunctionPermissionChecks = { + __typename?: 'AutomateFunctionPermissionChecks'; + canRegenerateToken: PermissionCheckResult; +}; + export type AutomateFunctionRelease = { __typename?: 'AutomateFunctionRelease'; commitId: Scalars['String']['output']; @@ -393,6 +399,7 @@ export type AutomateMutations = { __typename?: 'AutomateMutations'; createFunction: AutomateFunction; createFunctionWithoutVersion: AutomateFunctionToken; + regenerateFunctionToken: Scalars['String']['output']; updateFunction: AutomateFunction; }; @@ -407,6 +414,11 @@ export type AutomateMutationsCreateFunctionWithoutVersionArgs = { }; +export type AutomateMutationsRegenerateFunctionTokenArgs = { + functionId: Scalars['String']['input']; +}; + + export type AutomateMutationsUpdateFunctionArgs = { input: UpdateAutomateFunctionInput; }; @@ -5429,6 +5441,7 @@ export type ResolversTypes = { AutomateAuthCodeResources: AutomateAuthCodeResources; AutomateFunction: ResolverTypeWrapper; AutomateFunctionCollection: ResolverTypeWrapper & { items: Array }>; + AutomateFunctionPermissionChecks: ResolverTypeWrapper; AutomateFunctionRelease: ResolverTypeWrapper; AutomateFunctionReleaseCollection: ResolverTypeWrapper & { items: Array }>; AutomateFunctionReleasesFilter: AutomateFunctionReleasesFilter; @@ -5781,6 +5794,7 @@ export type ResolversParentTypes = { AutomateAuthCodeResources: AutomateAuthCodeResources; AutomateFunction: AutomateFunctionGraphQLReturn; AutomateFunctionCollection: Omit & { items: Array }; + AutomateFunctionPermissionChecks: AutomateFunctionPermissionChecksGraphQLReturn; AutomateFunctionRelease: AutomateFunctionReleaseGraphQLReturn; AutomateFunctionReleaseCollection: Omit & { items: Array }; AutomateFunctionReleasesFilter: AutomateFunctionReleasesFilter; @@ -6221,11 +6235,12 @@ export type AutomateFunctionResolvers; logo?: Resolver, ParentType, ContextType>; name?: Resolver; + permissions?: Resolver; releases?: Resolver>; repo?: Resolver; supportedSourceApps?: Resolver, ParentType, ContextType>; tags?: Resolver, ParentType, ContextType>; - workspaceIds?: Resolver>, ParentType, ContextType>; + workspaceIds?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }; @@ -6236,6 +6251,11 @@ export type AutomateFunctionCollectionResolvers; }; +export type AutomateFunctionPermissionChecksResolvers = { + canRegenerateToken?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}; + export type AutomateFunctionReleaseResolvers = { commitId?: Resolver; createdAt?: Resolver; @@ -6286,6 +6306,7 @@ export type AutomateFunctionTokenResolvers = { createFunction?: Resolver>; createFunctionWithoutVersion?: Resolver>; + regenerateFunctionToken?: Resolver>; updateFunction?: Resolver>; __isTypeOf?: IsTypeOfResolverFn; }; @@ -7979,6 +8000,7 @@ export type Resolvers = { AuthStrategy?: AuthStrategyResolvers; AutomateFunction?: AutomateFunctionResolvers; AutomateFunctionCollection?: AutomateFunctionCollectionResolvers; + AutomateFunctionPermissionChecks?: AutomateFunctionPermissionChecksResolvers; AutomateFunctionRelease?: AutomateFunctionReleaseResolvers; AutomateFunctionReleaseCollection?: AutomateFunctionReleaseCollectionResolvers; AutomateFunctionRun?: AutomateFunctionRunResolvers; diff --git a/packages/server/modules/shared/helpers/errorHelper.ts b/packages/server/modules/shared/helpers/errorHelper.ts index 51cb60b87..194fe283c 100644 --- a/packages/server/modules/shared/helpers/errorHelper.ts +++ b/packages/server/modules/shared/helpers/errorHelper.ts @@ -1,3 +1,4 @@ +import { AutomateModuleDisabledError } from '@/modules/core/errors/automate' import { StreamNotFoundError } from '@/modules/core/errors/stream' import { WorkspacesModuleDisabledError } from '@/modules/core/errors/workspaces' import { @@ -43,6 +44,7 @@ export const mapAuthToServerError = (e: Authz.AllAuthErrors): BaseError => { case Authz.ProjectNotEnoughPermissionsError.code: case Authz.WorkspacePlanNoFeatureAccessError.code: case Authz.EligibleForExclusiveWorkspaceError.code: + case Authz.AutomateFunctionNotCreatorError.code: return new ForbiddenError(e.message) case Authz.WorkspaceSsoSessionNoAccessError.code: throw new SsoSessionMissingOrExpiredError(e.message, { @@ -56,12 +58,15 @@ export const mapAuthToServerError = (e: Authz.AllAuthErrors): BaseError => { return new ForbiddenError(e.message) case Authz.WorkspacesNotEnabledError.code: return new WorkspacesModuleDisabledError() + case Authz.AutomateNotEnabledError.code: + return new AutomateModuleDisabledError() case Authz.ProjectLastOwnerError.code: case Authz.ReservedModelNotDeletableError.code: return new BadRequestError(e.message) case Authz.CommentNotFoundError.code: case Authz.ModelNotFoundError.code: case Authz.VersionNotFoundError.code: + case Authz.AutomateFunctionNotFoundError.code: return new NotFoundError(e.message) case Authz.PersonalProjectsLimitedError.code: return new BadRequestError(e.message) diff --git a/packages/server/modules/workspacesCore/authz/loaders/index.ts b/packages/server/modules/workspacesCore/authz/loaders/index.ts index 40e28c95f..3af57d842 100644 --- a/packages/server/modules/workspacesCore/authz/loaders/index.ts +++ b/packages/server/modules/workspacesCore/authz/loaders/index.ts @@ -2,6 +2,7 @@ import { defineModuleLoaders } from '@/modules/loaders' import { LoaderUnsupportedError } from '@/modules/shared/errors' export default defineModuleLoaders(() => ({ + getAutomateFunction: async () => null, getWorkspace: async () => { throw new LoaderUnsupportedError() }, diff --git a/packages/shared/src/authz/domain/authErrors.ts b/packages/shared/src/authz/domain/authErrors.ts index 15b03c157..15ffc18de 100644 --- a/packages/shared/src/authz/domain/authErrors.ts +++ b/packages/shared/src/authz/domain/authErrors.ts @@ -181,6 +181,21 @@ export const VersionNotFoundError = defineAuthError({ message: 'Version not found' }) +export const AutomateNotEnabledError = defineAuthError({ + code: 'AutomateNotEnabled', + message: 'Automate is not enabled on this server' +}) + +export const AutomateFunctionNotFoundError = defineAuthError({ + code: 'AutomateFunctionNotFound', + message: 'Function not found' +}) + +export const AutomateFunctionNotCreatorError = defineAuthError({ + code: 'AutomateFunctionNotCreator', + message: 'You are not the function creator and cannot make changes to it.' +}) + // Resolve all exported error types export type AllAuthErrors = ValueOf<{ [key in keyof typeof import('./authErrors.js')]: typeof import('./authErrors.js')[key] extends new ( diff --git a/packages/shared/src/authz/domain/automate/operations.ts b/packages/shared/src/authz/domain/automate/operations.ts new file mode 100644 index 000000000..746bcfac8 --- /dev/null +++ b/packages/shared/src/authz/domain/automate/operations.ts @@ -0,0 +1,5 @@ +import { AutomateFunction } from './types.js' + +export type GetAutomateFunction = (args: { + functionId: string +}) => Promise diff --git a/packages/shared/src/authz/domain/automate/types.ts b/packages/shared/src/authz/domain/automate/types.ts new file mode 100644 index 000000000..ab039083a --- /dev/null +++ b/packages/shared/src/authz/domain/automate/types.ts @@ -0,0 +1,9 @@ +export type AutomateFunction = { + id: string + name: string + functionCreator: { + speckleUserId: string + speckleServerOrigin: string + } | null + workspaceIds: string[] +} diff --git a/packages/shared/src/authz/domain/context.ts b/packages/shared/src/authz/domain/context.ts index 1fcb991f7..9f42c0325 100644 --- a/packages/shared/src/authz/domain/context.ts +++ b/packages/shared/src/authz/domain/context.ts @@ -12,3 +12,5 @@ export type CommentContext = { commentId: string } export type ModelContext = { modelId: string } export type VersionContext = { versionId: string } + +export type AutomateFunctionContext = { functionId: string } diff --git a/packages/shared/src/authz/domain/loaders.ts b/packages/shared/src/authz/domain/loaders.ts index 50f29c751..ea21310a4 100644 --- a/packages/shared/src/authz/domain/loaders.ts +++ b/packages/shared/src/authz/domain/loaders.ts @@ -24,6 +24,7 @@ import type { import { GetComment } from './comments/operations.js' import { GetModel } from './models/operations.js' import { GetVersion } from './versions/operations.js' +import { GetAutomateFunction } from './automate/operations.js' // utility type that ensures all properties functions that return promises type PromiseAll = { @@ -55,6 +56,7 @@ type AuthContextLoaderMappingDefinition< /* v8 ignore start */ export const AuthCheckContextLoaderKeys = { getEnv: 'getEnv', + getAutomateFunction: 'getAutomateFunction', getProject: 'getProject', getProjectRoleCounts: 'getProjectRoleCounts', getProjectRole: 'getProjectRole', @@ -85,6 +87,7 @@ export type AuthCheckContextLoaderKeys = export type AllAuthCheckContextLoaders = AuthContextLoaderMappingDefinition<{ getEnv: GetEnv getAdminOverrideEnabled: GetAdminOverrideEnabled + getAutomateFunction: GetAutomateFunction getProject: GetProject getProjectRole: GetProjectRole getProjectRoleCounts: GetProjectRoleCounts diff --git a/packages/shared/src/authz/fragments/automate.spec.ts b/packages/shared/src/authz/fragments/automate.spec.ts new file mode 100644 index 000000000..c2a41567e --- /dev/null +++ b/packages/shared/src/authz/fragments/automate.spec.ts @@ -0,0 +1,120 @@ +import { describe, expect, it } from 'vitest' +import { + ensureAutomateEnabledFragment, + ensureAutomateFunctionCreatorFragment +} from './automate.js' +import { OverridesOf } from '../../tests/helpers/types.js' +import { parseFeatureFlags } from '../../environment/index.js' +import cryptoRandomString from 'crypto-random-string' +import { + AutomateFunctionNotCreatorError, + AutomateFunctionNotFoundError, + AutomateNotEnabledError +} from '../domain/authErrors.js' + +describe('ensureAutomateEnabledFragment', () => { + const buildFragment = ( + overrides?: OverridesOf + ) => + ensureAutomateEnabledFragment({ + getEnv: async () => + parseFeatureFlags({ + FF_AUTOMATE_MODULE_ENABLED: 'true' + }), + ...overrides + }) + + it('returns ok when automate is enabled', async () => { + const result = await buildFragment()({}) + expect(result).toBeAuthOKResult() + }) + + it('returns err when automate is disabled', async () => { + const result = await buildFragment({ + getEnv: async () => + parseFeatureFlags({ + FF_AUTOMATE_MODULE_ENABLED: 'false' + }) + })({}) + expect(result).toBeAuthErrorResult({ + code: AutomateNotEnabledError.code + }) + }) +}) + +describe('ensureAutomateFunctionCreatorFragment', () => { + const buildFragment = ( + overrides?: OverridesOf + ) => + ensureAutomateFunctionCreatorFragment({ + getAutomateFunction: async ({ functionId }) => { + return { + id: functionId, + name: cryptoRandomString({ length: 9 }), + functionCreator: { + speckleUserId: 'foo', + speckleServerOrigin: 'example.org' + }, + workspaceIds: [] + } + }, + ...overrides + }) + + it('returns ok when user is function creator', async () => { + const userId = cryptoRandomString({ length: 9 }) + + const result = await buildFragment({ + getAutomateFunction: async ({ functionId }) => { + return { + id: functionId, + name: cryptoRandomString({ length: 9 }), + functionCreator: { + speckleUserId: userId, + speckleServerOrigin: 'example.org' + }, + workspaceIds: [] + } + } + })({ + userId, + functionId: cryptoRandomString({ length: 9 }) + }) + + expect(result).toBeAuthOKResult() + }) + + it('return err if function is not found', async () => { + const result = await buildFragment({ + getAutomateFunction: async () => null + })({ + userId: cryptoRandomString({ length: 9 }), + functionId: cryptoRandomString({ length: 9 }) + }) + expect(result).toBeAuthErrorResult({ + code: AutomateFunctionNotFoundError.code + }) + }) + + it('returns err if user is not function creator', async () => { + const result = await buildFragment({ + getAutomateFunction: async ({ functionId }) => { + return { + id: functionId, + name: cryptoRandomString({ length: 9 }), + functionCreator: { + speckleUserId: cryptoRandomString({ length: 9 }), + speckleServerOrigin: 'example.org' + }, + workspaceIds: [] + } + } + })({ + userId: cryptoRandomString({ length: 9 }), + functionId: cryptoRandomString({ length: 9 }) + }) + expect(result).toBeAuthErrorResult({ + code: AutomateFunctionNotCreatorError.code + }) + }) +}) diff --git a/packages/shared/src/authz/fragments/automate.ts b/packages/shared/src/authz/fragments/automate.ts new file mode 100644 index 000000000..52c1b917e --- /dev/null +++ b/packages/shared/src/authz/fragments/automate.ts @@ -0,0 +1,36 @@ +import { err, ok } from 'true-myth/result' +import { + AutomateFunctionNotCreatorError, + AutomateFunctionNotFoundError, + AutomateNotEnabledError +} from '../domain/authErrors.js' +import { Loaders } from '../domain/loaders.js' +import { AuthPolicyEnsureFragment } from '../domain/policies.js' +import { AutomateFunctionContext, MaybeUserContext } from '../domain/context.js' + +export const ensureAutomateEnabledFragment: AuthPolicyEnsureFragment< + typeof Loaders.getEnv, + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + {}, + InstanceType +> = (loaders) => async () => { + const env = await loaders.getEnv() + if (!env.FF_AUTOMATE_MODULE_ENABLED) return err(new AutomateNotEnabledError()) + return ok() +} + +export const ensureAutomateFunctionCreatorFragment: AuthPolicyEnsureFragment< + typeof Loaders.getAutomateFunction, + MaybeUserContext & AutomateFunctionContext, + InstanceType< + typeof AutomateFunctionNotFoundError | typeof AutomateFunctionNotCreatorError + > +> = + (loaders) => + async ({ userId, functionId }) => { + const automateFunction = await loaders.getAutomateFunction({ functionId }) + if (!automateFunction) return err(new AutomateFunctionNotFoundError()) + if (!userId || automateFunction.functionCreator?.speckleUserId !== userId) + return err(new AutomateFunctionNotCreatorError()) + return ok() + } diff --git a/packages/shared/src/authz/policies/automate/function/canEditFunction.spec.ts b/packages/shared/src/authz/policies/automate/function/canEditFunction.spec.ts new file mode 100644 index 000000000..233a9b26d --- /dev/null +++ b/packages/shared/src/authz/policies/automate/function/canEditFunction.spec.ts @@ -0,0 +1,87 @@ +import { describe, expect, it } from 'vitest' +import { canEditFunctionPolicy } from './canEditFunction.js' +import { OverridesOf } from '../../../../tests/helpers/types.js' +import { parseFeatureFlags } from '../../../../environment/index.js' +import cryptoRandomString from 'crypto-random-string' +import { + AutomateFunctionNotCreatorError, + AutomateFunctionNotFoundError, + AutomateNotEnabledError +} from '../../../domain/authErrors.js' + +describe('canEditFunctionPolicy creates a function, that', () => { + const buildCanEditFunctionPolicy = ( + overrides?: OverridesOf + ) => + canEditFunctionPolicy({ + getEnv: async () => + parseFeatureFlags({ + FF_AUTOMATE_MODULE_ENABLED: 'true' + }), + getAutomateFunction: async () => null, + ...overrides + }) + + it('forbids edit if automate is not enabled', async () => { + const result = await buildCanEditFunctionPolicy({ + getEnv: async () => + parseFeatureFlags({ + FF_AUTOMATE_MODULE_ENABLED: 'false' + }) + })({ + functionId: cryptoRandomString({ length: 9 }) + }) + expect(result).toBeAuthErrorResult({ + code: AutomateNotEnabledError.code + }) + }) + + it('forbids edit if function cannot be found', async () => { + const result = await buildCanEditFunctionPolicy()({ + functionId: cryptoRandomString({ length: 9 }) + }) + expect(result).toBeAuthErrorResult({ + code: AutomateFunctionNotFoundError.code + }) + }) + + it('forbids edit if user is not function creator', async () => { + const result = await buildCanEditFunctionPolicy({ + getAutomateFunction: async ({ functionId }) => ({ + id: functionId, + name: cryptoRandomString({ length: 9 }), + functionCreator: { + speckleUserId: cryptoRandomString({ length: 9 }), + speckleServerOrigin: 'example.org' + }, + workspaceIds: [] + }) + })({ + functionId: cryptoRandomString({ length: 9 }) + }) + expect(result).toBeAuthErrorResult({ + code: AutomateFunctionNotCreatorError.code + }) + }) + + it('allows edit for function creators', async () => { + const userId = cryptoRandomString({ length: 9 }) + + const result = await buildCanEditFunctionPolicy({ + getAutomateFunction: async ({ functionId }) => ({ + id: functionId, + name: cryptoRandomString({ length: 9 }), + functionCreator: { + speckleUserId: userId, + speckleServerOrigin: 'example.org' + }, + workspaceIds: [] + }) + })({ + userId, + functionId: cryptoRandomString({ length: 9 }) + }) + + expect(result).toBeAuthOKResult() + }) +}) diff --git a/packages/shared/src/authz/policies/automate/function/canEditFunction.ts b/packages/shared/src/authz/policies/automate/function/canEditFunction.ts new file mode 100644 index 000000000..81736ca64 --- /dev/null +++ b/packages/shared/src/authz/policies/automate/function/canEditFunction.ts @@ -0,0 +1,46 @@ +import { err, ok } from 'true-myth/result' +import { + AutomateFunctionNotCreatorError, + AutomateFunctionNotFoundError, + AutomateNotEnabledError +} from '../../../domain/authErrors.js' +import { AutomateFunctionContext, MaybeUserContext } from '../../../domain/context.js' +import { AuthCheckContextLoaderKeys } from '../../../domain/loaders.js' +import { AuthPolicy } from '../../../domain/policies.js' +import { + ensureAutomateEnabledFragment, + ensureAutomateFunctionCreatorFragment +} from '../../../fragments/automate.js' + +type PolicyLoaderKeys = + | typeof AuthCheckContextLoaderKeys.getEnv + | typeof AuthCheckContextLoaderKeys.getAutomateFunction + +type PolicyArgs = MaybeUserContext & AutomateFunctionContext + +type PolicyErrors = InstanceType< + | typeof AutomateNotEnabledError + | typeof AutomateFunctionNotFoundError + | typeof AutomateFunctionNotCreatorError +> + +export const canEditFunctionPolicy: AuthPolicy< + PolicyLoaderKeys, + PolicyArgs, + PolicyErrors +> = + (loaders) => + async ({ userId, functionId }) => { + const isAutomateEnabled = await ensureAutomateEnabledFragment(loaders)({}) + if (isAutomateEnabled.isErr) return err(isAutomateEnabled.error) + + const isAutomateFunctionCreator = await ensureAutomateFunctionCreatorFragment( + loaders + )({ + userId, + functionId + }) + if (isAutomateFunctionCreator.isErr) return err(isAutomateFunctionCreator.error) + + return ok() + } diff --git a/packages/shared/src/authz/policies/index.ts b/packages/shared/src/authz/policies/index.ts index def12f934..b43c7f91b 100644 --- a/packages/shared/src/authz/policies/index.ts +++ b/packages/shared/src/authz/policies/index.ts @@ -31,9 +31,15 @@ import { canLoadPolicy } from './project/canLoad.js' import { canReadMemberEmailPolicy } from './workspace/canReadMemberEmail.js' import { canCreateWorkspacePolicy } from './workspace/canCreateWorkspace.js' import { canUseWorkspacePlanFeature } from './workspace/canUseWorkspacePlanFeature.js' +import { canEditFunctionPolicy } from './automate/function/canEditFunction.js' import { canUpdateEmbedTokensPolicy } from './project/canUpdateEmbedTokens.js' export const authPoliciesFactory = (loaders: AllAuthCheckContextLoaders) => ({ + automate: { + function: { + canRegenerateToken: canEditFunctionPolicy(loaders) + } + }, project: { automation: { canCreate: canCreateAutomationPolicy(loaders), diff --git a/packages/ui-components/src/helpers/layout/components.ts b/packages/ui-components/src/helpers/layout/components.ts index 0525b539d..22f3ce375 100644 --- a/packages/ui-components/src/helpers/layout/components.ts +++ b/packages/ui-components/src/helpers/layout/components.ts @@ -48,4 +48,10 @@ export type LayoutDialogButton = { id?: string } +export type LayoutHeaderButton = { + label: string + props: Record & FormButtonProps + onClick?: (e: MouseEvent) => void +} + export type LayoutTableColours = 'primary' | 'outline' | 'subtle' | 'danger' diff --git a/packages/ui-components/src/lib.ts b/packages/ui-components/src/lib.ts index 90018bf33..061f346df 100644 --- a/packages/ui-components/src/lib.ts +++ b/packages/ui-components/src/lib.ts @@ -50,7 +50,8 @@ import LayoutDisclosure from '~~/src/components/layout/Disclosure.vue' import LayoutGridListToggle from '~~/src/components/layout/GridListToggle.vue' import type { LayoutPageTabItem, - LayoutDialogButton + LayoutDialogButton, + LayoutHeaderButton } from '~~/src/helpers/layout/components' import { GridListToggleValue } from '~~/src/helpers/layout/components' import { @@ -188,6 +189,7 @@ export { } export type { LayoutDialogButton, + LayoutHeaderButton, ToastNotification, BulletStepType, NumberStepType,