@burdenoff/microfe-workspaces 2026.519.1 → 2026.528.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WorkspacesRoot.js +4 -1
- package/dist/WorkspacesRoot.js.map +1 -1
- package/dist/WorkspacesRoutes.js +4 -4
- package/dist/WorkspacesRoutes.js.map +1 -1
- package/dist/components/CreateProjectDialog.js +1 -1
- package/dist/components/CreateProjectDialog.js.map +1 -1
- package/dist/components/CreateWorkspaceDialog.js +2 -2
- package/dist/components/CreateWorkspaceDialog.js.map +1 -1
- package/dist/components/InviteMemberDialog.js +2 -2
- package/dist/components/InviteMemberDialog.js.map +1 -1
- package/dist/components/MemberListItem.js +71 -86
- package/dist/components/MemberListItem.js.map +1 -1
- package/dist/components/ProjectCard.js +12 -10
- package/dist/components/ProjectCard.js.map +1 -1
- package/dist/components/WorkspaceCard.js.map +1 -1
- package/dist/components/WorkspacesErrorBoundary.js +12 -4
- package/dist/components/WorkspacesErrorBoundary.js.map +1 -1
- package/dist/components/tags/ProjectTagsWidget.js +248 -0
- package/dist/components/tags/ProjectTagsWidget.js.map +1 -0
- package/dist/generated/global-operations.js +9 -1
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/hooks/useOrgsWithPermission.js +55 -0
- package/dist/hooks/useOrgsWithPermission.js.map +1 -0
- package/dist/hooks/useWorkspacesEventEmitter.js.map +1 -1
- package/dist/hooks/useWorkspacesPageView.js +6 -4
- package/dist/hooks/useWorkspacesPageView.js.map +1 -1
- package/dist/pages/CreateWorkspacePage.js +173 -149
- package/dist/pages/CreateWorkspacePage.js.map +1 -1
- package/dist/pages/InviteAcceptancePage.js +28 -28
- package/dist/pages/InviteAcceptancePage.js.map +1 -1
- package/dist/pages/MembersListPage.js +380 -352
- package/dist/pages/MembersListPage.js.map +1 -1
- package/dist/pages/ProjectDetailPage.js +96 -97
- package/dist/pages/ProjectDetailPage.js.map +1 -1
- package/dist/pages/ProjectsListPage.js +307 -304
- package/dist/pages/ProjectsListPage.js.map +1 -1
- package/dist/pages/WorkspaceSettingsPage.js +94 -91
- package/dist/pages/WorkspaceSettingsPage.js.map +1 -1
- package/dist/pages/WorkspacesListPage.js +1 -1
- package/dist/pages/WorkspacesListPage.js.map +1 -1
- package/dist/pages/dashboard/DashboardCustomizer.js +68 -68
- package/dist/pages/dashboard/DashboardCustomizer.js.map +1 -1
- package/dist/pages/dashboard/DashboardGrid.js +52 -41
- package/dist/pages/dashboard/DashboardGrid.js.map +1 -1
- package/dist/pages/dashboard/DashboardPage.js +74 -65
- package/dist/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/pages/dashboard/WidgetWrapper.js +3 -3
- package/dist/pages/dashboard/WidgetWrapper.js.map +1 -1
- package/dist/pages/dashboard/config.js +126 -30
- package/dist/pages/dashboard/config.js.map +1 -1
- package/dist/pages/dashboard/hooks/useDashboardData.js +39 -2
- package/dist/pages/dashboard/hooks/useDashboardData.js.map +1 -1
- package/dist/pages/dashboard/widgets/AgentsWidget.js +109 -0
- package/dist/pages/dashboard/widgets/AgentsWidget.js.map +1 -0
- package/dist/pages/dashboard/widgets/GroupsWidget.js +6 -5
- package/dist/pages/dashboard/widgets/GroupsWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/MembersWidget.js +6 -6
- package/dist/pages/dashboard/widgets/MembersWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/ProjectsWidget.js +8 -7
- package/dist/pages/dashboard/widgets/ProjectsWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/QuickActionsWidget.js +72 -18
- package/dist/pages/dashboard/widgets/QuickActionsWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/RecentActivityWidget.js +3 -3
- package/dist/pages/dashboard/widgets/RecentActivityWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/SessionsWidget.js +78 -0
- package/dist/pages/dashboard/widgets/SessionsWidget.js.map +1 -0
- package/dist/pages/dashboard/widgets/StorageWidget.js +35 -20
- package/dist/pages/dashboard/widgets/StorageWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/TagCloudWidget.js +2 -2
- package/dist/pages/dashboard/widgets/TagCloudWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/TipsWidget.js +81 -22
- package/dist/pages/dashboard/widgets/TipsWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/UpcomingEventsWidget.js +6 -5
- package/dist/pages/dashboard/widgets/UpcomingEventsWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/VibesWidget.js +64 -0
- package/dist/pages/dashboard/widgets/VibesWidget.js.map +1 -0
- package/dist/pages/dashboard/widgets/WelcomeWidget.js +5 -5
- package/dist/pages/dashboard/widgets/WelcomeWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/WorkflowStatsWidget.js +3 -3
- package/dist/pages/dashboard/widgets/WorkflowStatsWidget.js.map +1 -1
- package/dist/pages/dashboard/widgets/WorkspacesWidget.js +6 -5
- package/dist/pages/dashboard/widgets/WorkspacesWidget.js.map +1 -1
- package/dist/providers/WorkspacesProvider.js +1 -1
- package/dist/providers/WorkspacesProvider.js.map +1 -1
- package/dist/store/workspacesStore.js.map +1 -1
- package/dist/utils/formatters.js +21 -16
- package/dist/utils/formatters.js.map +1 -1
- package/dist/utils/telemetryError.js +1 -1
- package/dist/utils/telemetryError.js.map +1 -1
- package/package.json +7 -7
- package/dist/WorkspacesRoot.d.ts +0 -35
- package/dist/WorkspacesRoot.d.ts.map +0 -1
- package/dist/WorkspacesRoutes.d.ts +0 -10
- package/dist/WorkspacesRoutes.d.ts.map +0 -1
- package/dist/components/CreateProjectDialog.d.ts +0 -6
- package/dist/components/CreateProjectDialog.d.ts.map +0 -1
- package/dist/components/CreateWorkspaceDialog.d.ts +0 -2
- package/dist/components/CreateWorkspaceDialog.d.ts.map +0 -1
- package/dist/components/InviteMemberDialog.d.ts +0 -7
- package/dist/components/InviteMemberDialog.d.ts.map +0 -1
- package/dist/components/MemberListItem.d.ts +0 -11
- package/dist/components/MemberListItem.d.ts.map +0 -1
- package/dist/components/ProjectCard.d.ts +0 -13
- package/dist/components/ProjectCard.d.ts.map +0 -1
- package/dist/components/WorkspaceCard.d.ts +0 -8
- package/dist/components/WorkspaceCard.d.ts.map +0 -1
- package/dist/components/WorkspacesErrorBoundary.d.ts +0 -27
- package/dist/components/WorkspacesErrorBoundary.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -8
- package/dist/components/index.d.ts.map +0 -1
- package/dist/constants/permissions.d.ts +0 -33
- package/dist/constants/permissions.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts +0 -279
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts +0 -23527
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts +0 -2300
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts +0 -57851
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/hooks/index.d.ts +0 -8
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/useMemberMutations.d.ts +0 -61
- package/dist/hooks/useMemberMutations.d.ts.map +0 -1
- package/dist/hooks/useProjectMutations.d.ts +0 -26
- package/dist/hooks/useProjectMutations.d.ts.map +0 -1
- package/dist/hooks/useProjects.d.ts +0 -16
- package/dist/hooks/useProjects.d.ts.map +0 -1
- package/dist/hooks/useScopedNavigation.d.ts +0 -4
- package/dist/hooks/useScopedNavigation.d.ts.map +0 -1
- package/dist/hooks/useTenants.d.ts +0 -13
- package/dist/hooks/useTenants.d.ts.map +0 -1
- package/dist/hooks/useWorkspaceActivity.d.ts +0 -12
- package/dist/hooks/useWorkspaceActivity.d.ts.map +0 -1
- package/dist/hooks/useWorkspaceMembers.d.ts +0 -24
- package/dist/hooks/useWorkspaceMembers.d.ts.map +0 -1
- package/dist/hooks/useWorkspaceMutations.d.ts +0 -36
- package/dist/hooks/useWorkspaceMutations.d.ts.map +0 -1
- package/dist/hooks/useWorkspacePermissions.d.ts +0 -29
- package/dist/hooks/useWorkspacePermissions.d.ts.map +0 -1
- package/dist/hooks/useWorkspaceRoles.d.ts +0 -8
- package/dist/hooks/useWorkspaceRoles.d.ts.map +0 -1
- package/dist/hooks/useWorkspaces.d.ts +0 -21
- package/dist/hooks/useWorkspaces.d.ts.map +0 -1
- package/dist/hooks/useWorkspacesEventEmitter.d.ts +0 -18
- package/dist/hooks/useWorkspacesEventEmitter.d.ts.map +0 -1
- package/dist/hooks/useWorkspacesPageView.d.ts +0 -27
- package/dist/hooks/useWorkspacesPageView.d.ts.map +0 -1
- package/dist/index.d.ts +0 -33
- package/dist/index.d.ts.map +0 -1
- package/dist/pages/ActivityListPage.d.ts +0 -2
- package/dist/pages/ActivityListPage.d.ts.map +0 -1
- package/dist/pages/CreateWorkspacePage.d.ts +0 -2
- package/dist/pages/CreateWorkspacePage.d.ts.map +0 -1
- package/dist/pages/InviteAcceptancePage.d.ts +0 -6
- package/dist/pages/InviteAcceptancePage.d.ts.map +0 -1
- package/dist/pages/MembersListPage.d.ts +0 -2
- package/dist/pages/MembersListPage.d.ts.map +0 -1
- package/dist/pages/ProjectDetailPage.d.ts +0 -2
- package/dist/pages/ProjectDetailPage.d.ts.map +0 -1
- package/dist/pages/ProjectsListPage.d.ts +0 -2
- package/dist/pages/ProjectsListPage.d.ts.map +0 -1
- package/dist/pages/WorkspaceDetailPage.d.ts +0 -2
- package/dist/pages/WorkspaceDetailPage.d.ts.map +0 -1
- package/dist/pages/WorkspaceSettingsPage.d.ts +0 -2
- package/dist/pages/WorkspaceSettingsPage.d.ts.map +0 -1
- package/dist/pages/WorkspacesListPage.d.ts +0 -2
- package/dist/pages/WorkspacesListPage.d.ts.map +0 -1
- package/dist/pages/dashboard/DashboardCustomizer.d.ts +0 -12
- package/dist/pages/dashboard/DashboardCustomizer.d.ts.map +0 -1
- package/dist/pages/dashboard/DashboardGrid.d.ts +0 -8
- package/dist/pages/dashboard/DashboardGrid.d.ts.map +0 -1
- package/dist/pages/dashboard/DashboardPage.d.ts +0 -14
- package/dist/pages/dashboard/DashboardPage.d.ts.map +0 -1
- package/dist/pages/dashboard/WidgetWrapper.d.ts +0 -17
- package/dist/pages/dashboard/WidgetWrapper.d.ts.map +0 -1
- package/dist/pages/dashboard/config.d.ts +0 -9
- package/dist/pages/dashboard/config.d.ts.map +0 -1
- package/dist/pages/dashboard/hooks/useDashboardData.d.ts +0 -9
- package/dist/pages/dashboard/hooks/useDashboardData.d.ts.map +0 -1
- package/dist/pages/dashboard/hooks/useDashboardPreferences.d.ts +0 -4
- package/dist/pages/dashboard/hooks/useDashboardPreferences.d.ts.map +0 -1
- package/dist/pages/dashboard/types.d.ts +0 -145
- package/dist/pages/dashboard/types.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/GroupsWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/GroupsWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/MembersWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/MembersWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/ProjectsWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/ProjectsWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/QuickActionsWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/QuickActionsWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/RecentActivityWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/RecentActivityWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/StorageWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/StorageWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/SystemHealthWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/SystemHealthWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/SystemHealthWidget.js +0 -59
- package/dist/pages/dashboard/widgets/SystemHealthWidget.js.map +0 -1
- package/dist/pages/dashboard/widgets/TagCloudWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/TagCloudWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/TipsWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/TipsWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/UpcomingEventsWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/UpcomingEventsWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/WelcomeWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/WelcomeWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/WorkflowStatsWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/WorkflowStatsWidget.d.ts.map +0 -1
- package/dist/pages/dashboard/widgets/WorkspacesWidget.d.ts +0 -4
- package/dist/pages/dashboard/widgets/WorkspacesWidget.d.ts.map +0 -1
- package/dist/providers/WorkspacesProvider.d.ts +0 -13
- package/dist/providers/WorkspacesProvider.d.ts.map +0 -1
- package/dist/store/workspacesStore.d.ts +0 -82
- package/dist/store/workspacesStore.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -280
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/formatters.d.ts +0 -60
- package/dist/utils/formatters.d.ts.map +0 -1
- package/dist/utils/i18n.d.ts +0 -13
- package/dist/utils/i18n.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts +0 -3
- package/dist/utils/nativeBridge.d.ts.map +0 -1
- package/dist/utils/projectTags.d.ts +0 -6
- package/dist/utils/projectTags.d.ts.map +0 -1
- package/dist/utils/slug.d.ts +0 -13
- package/dist/utils/slug.d.ts.map +0 -1
- package/dist/utils/telemetryError.d.ts +0 -2
- package/dist/utils/telemetryError.d.ts.map +0 -1
- package/dist/utils/tokenHelpers.d.ts +0 -114
- package/dist/utils/tokenHelpers.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-operations.js","names":[],"sources":["../../src/generated/global-operations.ts"],"sourcesContent":["// @ts-nocheck\nimport * as Types from './global-types';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nimport * as ApolloReactHooks from '@apollo/client/react';\nconst defaultOptions = {} as const;\nexport type DashboardGlobalDataQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type DashboardGlobalDataQuery = { __typename?: 'Query', myDashboardPreferences?: Record<string, unknown> | null, currentUser?: { __typename?: 'User', id: string, email: string, firstName?: string | null, lastName?: string | null, name?: string | null, role: string, createdAt: string } | null, myWorkspaces: { __typename?: 'WorkspaceList', total: number, items: Array<{ __typename?: 'Workspace', id: string, name: string, status: Types.WorkspaceStatus, type: Types.WorkspaceType, createdAt: string, memberCount: number }> }, myOrganizations: { __typename?: 'OrganizationList', total: number, items: Array<{ __typename?: 'Organization', id: string, name: string, status: string, type: string, createdAt: string }> } };\n\nexport type UpdateDashboardPreferencesMutationVariables = Types.Exact<{\n input: Types.UpdateDashboardPreferencesInput;\n}>;\n\n\nexport type UpdateDashboardPreferencesMutation = { __typename?: 'Mutation', updateMyDashboardPreferences: Record<string, unknown> };\n\nexport type GetGlobalMyWorkspacesQueryVariables = Types.Exact<{\n limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n offset?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n}>;\n\n\nexport type GetGlobalMyWorkspacesQuery = { __typename?: 'Query', myWorkspaces: { __typename?: 'WorkspaceList', total: number, hasMore: boolean, items: Array<{ __typename?: 'Workspace', id: string, name: string, type: Types.WorkspaceType, status: Types.WorkspaceStatus, createdAt: string, updatedAt: string, memberCount: number }> } };\n\nexport type GetMyTenantsQueryVariables = Types.Exact<{\n limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n offset?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n}>;\n\n\nexport type GetMyTenantsQuery = { __typename?: 'Query', myTenants: { __typename?: 'TenantList', total: number, hasMore: boolean, items: Array<{ __typename?: 'Tenant', id: string, name: string, slug: string, status: Types.TenantStatus, type: Types.TenantType }> } };\n\nexport type GetMyOrganizationsQueryVariables = Types.Exact<{\n limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n offset?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n}>;\n\n\nexport type GetMyOrganizationsQuery = { __typename?: 'Query', myOrganizations: { __typename?: 'OrganizationList', total: number, hasMore: boolean, items: Array<{ __typename?: 'Organization', id: string, name: string, slug: string, tenantId: string }> } };\n\nexport type CreateGlobalWorkspaceMutationVariables = Types.Exact<{\n input: Types.CreateWorkspaceInput;\n}>;\n\n\nexport type CreateGlobalWorkspaceMutation = { __typename?: 'Mutation', createWorkspace: { __typename?: 'Workspace', id: string, name: string, slug: string, type: Types.WorkspaceType, status: Types.WorkspaceStatus, tenantId: string, organizationId?: string | null, createdAt: string } };\n\n\nexport const DashboardGlobalDataDocument = gql`\n query DashboardGlobalData {\n currentUser {\n id\n email\n firstName\n lastName\n name\n role\n createdAt\n }\n myDashboardPreferences\n myWorkspaces {\n items {\n id\n name\n status\n type\n createdAt\n memberCount\n }\n total\n }\n myOrganizations {\n items {\n id\n name\n status\n type\n createdAt\n }\n total\n }\n}\n `;\n\n/**\n * __useDashboardGlobalDataQuery__\n *\n * To run a query within a React component, call `useDashboardGlobalDataQuery` and pass it any options that fit your needs.\n * When your component renders, `useDashboardGlobalDataQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useDashboardGlobalDataQuery({\n * variables: {\n * },\n * });\n */\nexport function useDashboardGlobalDataQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>(DashboardGlobalDataDocument, options);\n }\nexport function useDashboardGlobalDataLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>(DashboardGlobalDataDocument, options);\n }\n// @ts-ignore\nexport function useDashboardGlobalDataSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>;\nexport function useDashboardGlobalDataSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.DashboardGlobalDataQuery | undefined, Types.DashboardGlobalDataQueryVariables>;\nexport function useDashboardGlobalDataSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>(DashboardGlobalDataDocument, options);\n }\nexport type DashboardGlobalDataQueryHookResult = ReturnType<typeof useDashboardGlobalDataQuery>;\nexport type DashboardGlobalDataLazyQueryHookResult = ReturnType<typeof useDashboardGlobalDataLazyQuery>;\nexport type DashboardGlobalDataSuspenseQueryHookResult = ReturnType<typeof useDashboardGlobalDataSuspenseQuery>;\nexport type DashboardGlobalDataQueryResult = Apollo.QueryResult<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>;\nexport const UpdateDashboardPreferencesDocument = gql`\n mutation UpdateDashboardPreferences($input: UpdateDashboardPreferencesInput!) {\n updateMyDashboardPreferences(input: $input)\n}\n `;\nexport type UpdateDashboardPreferencesMutationFn = Apollo.MutationFunction<Types.UpdateDashboardPreferencesMutation, Types.UpdateDashboardPreferencesMutationVariables>;\n\n/**\n * __useUpdateDashboardPreferencesMutation__\n *\n * To run a mutation, you first call `useUpdateDashboardPreferencesMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useUpdateDashboardPreferencesMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [updateDashboardPreferencesMutation, { data, loading, error }] = useUpdateDashboardPreferencesMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useUpdateDashboardPreferencesMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<Types.UpdateDashboardPreferencesMutation, Types.UpdateDashboardPreferencesMutationVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useMutation<Types.UpdateDashboardPreferencesMutation, Types.UpdateDashboardPreferencesMutationVariables>(UpdateDashboardPreferencesDocument, options);\n }\nexport type UpdateDashboardPreferencesMutationHookResult = ReturnType<typeof useUpdateDashboardPreferencesMutation>;\nexport type UpdateDashboardPreferencesMutationResult = Apollo.MutationResult<Types.UpdateDashboardPreferencesMutation>;\nexport type UpdateDashboardPreferencesMutationOptions = Apollo.BaseMutationOptions<Types.UpdateDashboardPreferencesMutation, Types.UpdateDashboardPreferencesMutationVariables>;\nexport const GetGlobalMyWorkspacesDocument = gql`\n query GetGlobalMyWorkspaces($limit: Int, $offset: Int) {\n myWorkspaces(limit: $limit, offset: $offset) {\n items {\n id\n name\n type\n status\n createdAt\n updatedAt\n memberCount\n }\n total\n hasMore\n }\n}\n `;\n\n/**\n * __useGetGlobalMyWorkspacesQuery__\n *\n * To run a query within a React component, call `useGetGlobalMyWorkspacesQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetGlobalMyWorkspacesQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetGlobalMyWorkspacesQuery({\n * variables: {\n * limit: // value for 'limit'\n * offset: // value for 'offset'\n * },\n * });\n */\nexport function useGetGlobalMyWorkspacesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>(GetGlobalMyWorkspacesDocument, options);\n }\nexport function useGetGlobalMyWorkspacesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>(GetGlobalMyWorkspacesDocument, options);\n }\n// @ts-ignore\nexport function useGetGlobalMyWorkspacesSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>;\nexport function useGetGlobalMyWorkspacesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetGlobalMyWorkspacesQuery | undefined, Types.GetGlobalMyWorkspacesQueryVariables>;\nexport function useGetGlobalMyWorkspacesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>(GetGlobalMyWorkspacesDocument, options);\n }\nexport type GetGlobalMyWorkspacesQueryHookResult = ReturnType<typeof useGetGlobalMyWorkspacesQuery>;\nexport type GetGlobalMyWorkspacesLazyQueryHookResult = ReturnType<typeof useGetGlobalMyWorkspacesLazyQuery>;\nexport type GetGlobalMyWorkspacesSuspenseQueryHookResult = ReturnType<typeof useGetGlobalMyWorkspacesSuspenseQuery>;\nexport type GetGlobalMyWorkspacesQueryResult = Apollo.QueryResult<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>;\nexport const GetMyTenantsDocument = gql`\n query GetMyTenants($limit: Int, $offset: Int) {\n myTenants(limit: $limit, offset: $offset) {\n items {\n id\n name\n slug\n status\n type\n }\n total\n hasMore\n }\n}\n `;\n\n/**\n * __useGetMyTenantsQuery__\n *\n * To run a query within a React component, call `useGetMyTenantsQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetMyTenantsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetMyTenantsQuery({\n * variables: {\n * limit: // value for 'limit'\n * offset: // value for 'offset'\n * },\n * });\n */\nexport function useGetMyTenantsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>(GetMyTenantsDocument, options);\n }\nexport function useGetMyTenantsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>(GetMyTenantsDocument, options);\n }\n// @ts-ignore\nexport function useGetMyTenantsSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>;\nexport function useGetMyTenantsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetMyTenantsQuery | undefined, Types.GetMyTenantsQueryVariables>;\nexport function useGetMyTenantsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>(GetMyTenantsDocument, options);\n }\nexport type GetMyTenantsQueryHookResult = ReturnType<typeof useGetMyTenantsQuery>;\nexport type GetMyTenantsLazyQueryHookResult = ReturnType<typeof useGetMyTenantsLazyQuery>;\nexport type GetMyTenantsSuspenseQueryHookResult = ReturnType<typeof useGetMyTenantsSuspenseQuery>;\nexport type GetMyTenantsQueryResult = Apollo.QueryResult<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>;\nexport const GetMyOrganizationsDocument = gql`\n query GetMyOrganizations($limit: Int, $offset: Int) {\n myOrganizations(limit: $limit, offset: $offset) {\n items {\n id\n name\n slug\n tenantId\n }\n total\n hasMore\n }\n}\n `;\n\n/**\n * __useGetMyOrganizationsQuery__\n *\n * To run a query within a React component, call `useGetMyOrganizationsQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetMyOrganizationsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetMyOrganizationsQuery({\n * variables: {\n * limit: // value for 'limit'\n * offset: // value for 'offset'\n * },\n * });\n */\nexport function useGetMyOrganizationsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>(GetMyOrganizationsDocument, options);\n }\nexport function useGetMyOrganizationsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>(GetMyOrganizationsDocument, options);\n }\n// @ts-ignore\nexport function useGetMyOrganizationsSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>;\nexport function useGetMyOrganizationsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetMyOrganizationsQuery | undefined, Types.GetMyOrganizationsQueryVariables>;\nexport function useGetMyOrganizationsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>(GetMyOrganizationsDocument, options);\n }\nexport type GetMyOrganizationsQueryHookResult = ReturnType<typeof useGetMyOrganizationsQuery>;\nexport type GetMyOrganizationsLazyQueryHookResult = ReturnType<typeof useGetMyOrganizationsLazyQuery>;\nexport type GetMyOrganizationsSuspenseQueryHookResult = ReturnType<typeof useGetMyOrganizationsSuspenseQuery>;\nexport type GetMyOrganizationsQueryResult = Apollo.QueryResult<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>;\nexport const CreateGlobalWorkspaceDocument = gql`\n mutation CreateGlobalWorkspace($input: CreateWorkspaceInput!) {\n createWorkspace(input: $input) {\n id\n name\n slug\n type\n status\n tenantId\n organizationId\n createdAt\n }\n}\n `;\nexport type CreateGlobalWorkspaceMutationFn = Apollo.MutationFunction<Types.CreateGlobalWorkspaceMutation, Types.CreateGlobalWorkspaceMutationVariables>;\n\n/**\n * __useCreateGlobalWorkspaceMutation__\n *\n * To run a mutation, you first call `useCreateGlobalWorkspaceMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateGlobalWorkspaceMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createGlobalWorkspaceMutation, { data, loading, error }] = useCreateGlobalWorkspaceMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useCreateGlobalWorkspaceMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<Types.CreateGlobalWorkspaceMutation, Types.CreateGlobalWorkspaceMutationVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useMutation<Types.CreateGlobalWorkspaceMutation, Types.CreateGlobalWorkspaceMutationVariables>(CreateGlobalWorkspaceDocument, options);\n }\nexport type CreateGlobalWorkspaceMutationHookResult = ReturnType<typeof useCreateGlobalWorkspaceMutation>;\nexport type CreateGlobalWorkspaceMutationResult = Apollo.MutationResult<Types.CreateGlobalWorkspaceMutation>;\nexport type CreateGlobalWorkspaceMutationOptions = Apollo.BaseMutationOptions<Types.CreateGlobalWorkspaceMutation, Types.CreateGlobalWorkspaceMutationVariables>;"],"mappings":";;;AAmDA,IAAa,IAA8B,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsEjC,IAAqC,CAAG;;;;OA+BxC,IAAgC,CAAG;;;;;;;;;;;;;;;;;AAsDZ,CAAG;;;;;;;;;;;;;;OAoDG,CAAG;;;;;;;;;;;;;OAmDA,CAAG"}
|
|
1
|
+
{"version":3,"file":"global-operations.js","names":[],"sources":["../../src/generated/global-operations.ts"],"sourcesContent":["// @ts-nocheck\nimport * as Types from './global-types';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nimport * as ApolloReactHooks from '@apollo/client/react';\nconst defaultOptions = {} as const;\nexport type DashboardGlobalDataQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type DashboardGlobalDataQuery = { __typename?: 'Query', myDashboardPreferences?: Record<string, unknown> | null, currentUser?: { __typename?: 'User', id: string, email: string, firstName?: string | null, lastName?: string | null, name?: string | null, role: string, createdAt: string } | null, myWorkspaces: { __typename?: 'WorkspaceList', total: number, items: Array<{ __typename?: 'Workspace', id: string, name: string, status: Types.WorkspaceStatus, type: Types.WorkspaceType, createdAt: string, memberCount: number }> }, myOrganizations: { __typename?: 'OrganizationList', total: number, items: Array<{ __typename?: 'Organization', id: string, name: string, status: string, type: string, createdAt: string }> } };\n\nexport type UpdateDashboardPreferencesMutationVariables = Types.Exact<{\n input: Types.UpdateDashboardPreferencesInput;\n}>;\n\n\nexport type UpdateDashboardPreferencesMutation = { __typename?: 'Mutation', updateMyDashboardPreferences: Record<string, unknown> };\n\nexport type CheckRbacPermissionsQueryVariables = Types.Exact<{\n inputs: Array<Types.PermissionCheckInput> | Types.PermissionCheckInput;\n}>;\n\n\nexport type CheckRbacPermissionsQuery = { __typename?: 'Query', checkPermissions: Array<{ __typename?: 'PermissionCheckResult', allowed: boolean }> };\n\nexport type GetGlobalMyWorkspacesQueryVariables = Types.Exact<{\n limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n offset?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n}>;\n\n\nexport type GetGlobalMyWorkspacesQuery = { __typename?: 'Query', myWorkspaces: { __typename?: 'WorkspaceList', total: number, hasMore: boolean, items: Array<{ __typename?: 'Workspace', id: string, name: string, type: Types.WorkspaceType, status: Types.WorkspaceStatus, createdAt: string, updatedAt: string, memberCount: number }> } };\n\nexport type GetMyTenantsQueryVariables = Types.Exact<{\n limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n offset?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n}>;\n\n\nexport type GetMyTenantsQuery = { __typename?: 'Query', myTenants: { __typename?: 'TenantList', total: number, hasMore: boolean, items: Array<{ __typename?: 'Tenant', id: string, name: string, slug: string, status: Types.TenantStatus, type: Types.TenantType }> } };\n\nexport type GetMyOrganizationsQueryVariables = Types.Exact<{\n limit?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n offset?: Types.InputMaybe<Types.Scalars['Int']['input']>;\n}>;\n\n\nexport type GetMyOrganizationsQuery = { __typename?: 'Query', myOrganizations: { __typename?: 'OrganizationList', total: number, hasMore: boolean, items: Array<{ __typename?: 'Organization', id: string, name: string, slug: string, tenantId: string }> } };\n\nexport type CreateGlobalWorkspaceMutationVariables = Types.Exact<{\n input: Types.CreateWorkspaceInput;\n}>;\n\n\nexport type CreateGlobalWorkspaceMutation = { __typename?: 'Mutation', createWorkspace: { __typename?: 'Workspace', id: string, name: string, slug: string, type: Types.WorkspaceType, status: Types.WorkspaceStatus, tenantId: string, organizationId?: string | null, createdAt: string } };\n\n\nexport const DashboardGlobalDataDocument = gql`\n query DashboardGlobalData {\n currentUser {\n id\n email\n firstName\n lastName\n name\n role\n createdAt\n }\n myDashboardPreferences\n myWorkspaces {\n items {\n id\n name\n status\n type\n createdAt\n memberCount\n }\n total\n }\n myOrganizations {\n items {\n id\n name\n status\n type\n createdAt\n }\n total\n }\n}\n `;\n\n/**\n * __useDashboardGlobalDataQuery__\n *\n * To run a query within a React component, call `useDashboardGlobalDataQuery` and pass it any options that fit your needs.\n * When your component renders, `useDashboardGlobalDataQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useDashboardGlobalDataQuery({\n * variables: {\n * },\n * });\n */\nexport function useDashboardGlobalDataQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>(DashboardGlobalDataDocument, options);\n }\nexport function useDashboardGlobalDataLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>(DashboardGlobalDataDocument, options);\n }\n// @ts-ignore\nexport function useDashboardGlobalDataSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>;\nexport function useDashboardGlobalDataSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.DashboardGlobalDataQuery | undefined, Types.DashboardGlobalDataQueryVariables>;\nexport function useDashboardGlobalDataSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>(DashboardGlobalDataDocument, options);\n }\nexport type DashboardGlobalDataQueryHookResult = ReturnType<typeof useDashboardGlobalDataQuery>;\nexport type DashboardGlobalDataLazyQueryHookResult = ReturnType<typeof useDashboardGlobalDataLazyQuery>;\nexport type DashboardGlobalDataSuspenseQueryHookResult = ReturnType<typeof useDashboardGlobalDataSuspenseQuery>;\nexport type DashboardGlobalDataQueryResult = Apollo.QueryResult<Types.DashboardGlobalDataQuery, Types.DashboardGlobalDataQueryVariables>;\nexport const UpdateDashboardPreferencesDocument = gql`\n mutation UpdateDashboardPreferences($input: UpdateDashboardPreferencesInput!) {\n updateMyDashboardPreferences(input: $input)\n}\n `;\nexport type UpdateDashboardPreferencesMutationFn = Apollo.MutationFunction<Types.UpdateDashboardPreferencesMutation, Types.UpdateDashboardPreferencesMutationVariables>;\n\n/**\n * __useUpdateDashboardPreferencesMutation__\n *\n * To run a mutation, you first call `useUpdateDashboardPreferencesMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useUpdateDashboardPreferencesMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [updateDashboardPreferencesMutation, { data, loading, error }] = useUpdateDashboardPreferencesMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useUpdateDashboardPreferencesMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<Types.UpdateDashboardPreferencesMutation, Types.UpdateDashboardPreferencesMutationVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useMutation<Types.UpdateDashboardPreferencesMutation, Types.UpdateDashboardPreferencesMutationVariables>(UpdateDashboardPreferencesDocument, options);\n }\nexport type UpdateDashboardPreferencesMutationHookResult = ReturnType<typeof useUpdateDashboardPreferencesMutation>;\nexport type UpdateDashboardPreferencesMutationResult = Apollo.MutationResult<Types.UpdateDashboardPreferencesMutation>;\nexport type UpdateDashboardPreferencesMutationOptions = Apollo.BaseMutationOptions<Types.UpdateDashboardPreferencesMutation, Types.UpdateDashboardPreferencesMutationVariables>;\nexport const CheckRbacPermissionsDocument = gql`\n query CheckRbacPermissions($inputs: [PermissionCheckInput!]!) {\n checkPermissions(inputs: $inputs) {\n allowed\n }\n}\n `;\n\n/**\n * __useCheckRbacPermissionsQuery__\n *\n * To run a query within a React component, call `useCheckRbacPermissionsQuery` and pass it any options that fit your needs.\n * When your component renders, `useCheckRbacPermissionsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCheckRbacPermissionsQuery({\n * variables: {\n * inputs: // value for 'inputs'\n * },\n * });\n */\nexport function useCheckRbacPermissionsQuery(baseOptions: ApolloReactHooks.QueryHookOptions<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables> & ({ variables: Types.CheckRbacPermissionsQueryVariables; skip?: boolean; } | { skip: boolean; }) ) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables>(CheckRbacPermissionsDocument, options);\n }\nexport function useCheckRbacPermissionsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables>(CheckRbacPermissionsDocument, options);\n }\n// @ts-ignore\nexport function useCheckRbacPermissionsSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables>;\nexport function useCheckRbacPermissionsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.CheckRbacPermissionsQuery | undefined, Types.CheckRbacPermissionsQueryVariables>;\nexport function useCheckRbacPermissionsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables>(CheckRbacPermissionsDocument, options);\n }\nexport type CheckRbacPermissionsQueryHookResult = ReturnType<typeof useCheckRbacPermissionsQuery>;\nexport type CheckRbacPermissionsLazyQueryHookResult = ReturnType<typeof useCheckRbacPermissionsLazyQuery>;\nexport type CheckRbacPermissionsSuspenseQueryHookResult = ReturnType<typeof useCheckRbacPermissionsSuspenseQuery>;\nexport type CheckRbacPermissionsQueryResult = Apollo.QueryResult<Types.CheckRbacPermissionsQuery, Types.CheckRbacPermissionsQueryVariables>;\nexport const GetGlobalMyWorkspacesDocument = gql`\n query GetGlobalMyWorkspaces($limit: Int, $offset: Int) {\n myWorkspaces(limit: $limit, offset: $offset) {\n items {\n id\n name\n type\n status\n createdAt\n updatedAt\n memberCount\n }\n total\n hasMore\n }\n}\n `;\n\n/**\n * __useGetGlobalMyWorkspacesQuery__\n *\n * To run a query within a React component, call `useGetGlobalMyWorkspacesQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetGlobalMyWorkspacesQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetGlobalMyWorkspacesQuery({\n * variables: {\n * limit: // value for 'limit'\n * offset: // value for 'offset'\n * },\n * });\n */\nexport function useGetGlobalMyWorkspacesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>(GetGlobalMyWorkspacesDocument, options);\n }\nexport function useGetGlobalMyWorkspacesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>(GetGlobalMyWorkspacesDocument, options);\n }\n// @ts-ignore\nexport function useGetGlobalMyWorkspacesSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>;\nexport function useGetGlobalMyWorkspacesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetGlobalMyWorkspacesQuery | undefined, Types.GetGlobalMyWorkspacesQueryVariables>;\nexport function useGetGlobalMyWorkspacesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>(GetGlobalMyWorkspacesDocument, options);\n }\nexport type GetGlobalMyWorkspacesQueryHookResult = ReturnType<typeof useGetGlobalMyWorkspacesQuery>;\nexport type GetGlobalMyWorkspacesLazyQueryHookResult = ReturnType<typeof useGetGlobalMyWorkspacesLazyQuery>;\nexport type GetGlobalMyWorkspacesSuspenseQueryHookResult = ReturnType<typeof useGetGlobalMyWorkspacesSuspenseQuery>;\nexport type GetGlobalMyWorkspacesQueryResult = Apollo.QueryResult<Types.GetGlobalMyWorkspacesQuery, Types.GetGlobalMyWorkspacesQueryVariables>;\nexport const GetMyTenantsDocument = gql`\n query GetMyTenants($limit: Int, $offset: Int) {\n myTenants(limit: $limit, offset: $offset) {\n items {\n id\n name\n slug\n status\n type\n }\n total\n hasMore\n }\n}\n `;\n\n/**\n * __useGetMyTenantsQuery__\n *\n * To run a query within a React component, call `useGetMyTenantsQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetMyTenantsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetMyTenantsQuery({\n * variables: {\n * limit: // value for 'limit'\n * offset: // value for 'offset'\n * },\n * });\n */\nexport function useGetMyTenantsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>(GetMyTenantsDocument, options);\n }\nexport function useGetMyTenantsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>(GetMyTenantsDocument, options);\n }\n// @ts-ignore\nexport function useGetMyTenantsSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>;\nexport function useGetMyTenantsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetMyTenantsQuery | undefined, Types.GetMyTenantsQueryVariables>;\nexport function useGetMyTenantsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>(GetMyTenantsDocument, options);\n }\nexport type GetMyTenantsQueryHookResult = ReturnType<typeof useGetMyTenantsQuery>;\nexport type GetMyTenantsLazyQueryHookResult = ReturnType<typeof useGetMyTenantsLazyQuery>;\nexport type GetMyTenantsSuspenseQueryHookResult = ReturnType<typeof useGetMyTenantsSuspenseQuery>;\nexport type GetMyTenantsQueryResult = Apollo.QueryResult<Types.GetMyTenantsQuery, Types.GetMyTenantsQueryVariables>;\nexport const GetMyOrganizationsDocument = gql`\n query GetMyOrganizations($limit: Int, $offset: Int) {\n myOrganizations(limit: $limit, offset: $offset) {\n items {\n id\n name\n slug\n tenantId\n }\n total\n hasMore\n }\n}\n `;\n\n/**\n * __useGetMyOrganizationsQuery__\n *\n * To run a query within a React component, call `useGetMyOrganizationsQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetMyOrganizationsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetMyOrganizationsQuery({\n * variables: {\n * limit: // value for 'limit'\n * offset: // value for 'offset'\n * },\n * });\n */\nexport function useGetMyOrganizationsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useQuery<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>(GetMyOrganizationsDocument, options);\n }\nexport function useGetMyOrganizationsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useLazyQuery<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>(GetMyOrganizationsDocument, options);\n }\n// @ts-ignore\nexport function useGetMyOrganizationsSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>;\nexport function useGetMyOrganizationsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetMyOrganizationsQuery | undefined, Types.GetMyOrganizationsQueryVariables>;\nexport function useGetMyOrganizationsSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>) {\n const options = baseOptions === ApolloReactHooks.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useSuspenseQuery<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>(GetMyOrganizationsDocument, options);\n }\nexport type GetMyOrganizationsQueryHookResult = ReturnType<typeof useGetMyOrganizationsQuery>;\nexport type GetMyOrganizationsLazyQueryHookResult = ReturnType<typeof useGetMyOrganizationsLazyQuery>;\nexport type GetMyOrganizationsSuspenseQueryHookResult = ReturnType<typeof useGetMyOrganizationsSuspenseQuery>;\nexport type GetMyOrganizationsQueryResult = Apollo.QueryResult<Types.GetMyOrganizationsQuery, Types.GetMyOrganizationsQueryVariables>;\nexport const CreateGlobalWorkspaceDocument = gql`\n mutation CreateGlobalWorkspace($input: CreateWorkspaceInput!) {\n createWorkspace(input: $input) {\n id\n name\n slug\n type\n status\n tenantId\n organizationId\n createdAt\n }\n}\n `;\nexport type CreateGlobalWorkspaceMutationFn = Apollo.MutationFunction<Types.CreateGlobalWorkspaceMutation, Types.CreateGlobalWorkspaceMutationVariables>;\n\n/**\n * __useCreateGlobalWorkspaceMutation__\n *\n * To run a mutation, you first call `useCreateGlobalWorkspaceMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateGlobalWorkspaceMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createGlobalWorkspaceMutation, { data, loading, error }] = useCreateGlobalWorkspaceMutation({\n * variables: {\n * input: // value for 'input'\n * },\n * });\n */\nexport function useCreateGlobalWorkspaceMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<Types.CreateGlobalWorkspaceMutation, Types.CreateGlobalWorkspaceMutationVariables>) {\n const options = {...defaultOptions, ...baseOptions}\n return ApolloReactHooks.useMutation<Types.CreateGlobalWorkspaceMutation, Types.CreateGlobalWorkspaceMutationVariables>(CreateGlobalWorkspaceDocument, options);\n }\nexport type CreateGlobalWorkspaceMutationHookResult = ReturnType<typeof useCreateGlobalWorkspaceMutation>;\nexport type CreateGlobalWorkspaceMutationResult = Apollo.MutationResult<Types.CreateGlobalWorkspaceMutation>;\nexport type CreateGlobalWorkspaceMutationOptions = Apollo.BaseMutationOptions<Types.CreateGlobalWorkspaceMutation, Types.CreateGlobalWorkspaceMutationVariables>;"],"mappings":";;;AA0DA,IAAa,IAA8B,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsEjC,IAAqC,CAAG;;;;;AA+BT,CAAG;;;;;;;AA2C/C,IAAa,IAAgC,CAAG;;;;;;;;;;;;;;;;;AAsDZ,CAAG;;;;;;;;;;;;;;OAoDG,CAAG;;;;;;;;;;;;;OAmDA,CAAG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useWorkspacesContext as e } from "../providers/WorkspacesProvider.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { useAuth as n } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
4
|
+
import { useQuery as r } from "@tanstack/react-query";
|
|
5
|
+
import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
|
|
6
|
+
//#region src/hooks/useOrgsWithPermission.ts
|
|
7
|
+
var a = 50, o = "\n query CheckRbacPermissions($inputs: [PermissionCheckInput!]!) {\n checkPermissions(inputs: $inputs) {\n allowed\n }\n }\n";
|
|
8
|
+
function s(s, c, l) {
|
|
9
|
+
let { user: u } = n(), { authToken: d } = e(), f = u?.id ?? "", p = !!(f && s.length > 0), m = t(() => s.join(","), [s]), h = t(() => m ? m.split(",") : [], [m]), { data: g, isLoading: _, error: v } = r({
|
|
10
|
+
queryKey: [
|
|
11
|
+
"checkPermissions",
|
|
12
|
+
f,
|
|
13
|
+
c,
|
|
14
|
+
l,
|
|
15
|
+
m
|
|
16
|
+
],
|
|
17
|
+
enabled: p,
|
|
18
|
+
queryFn: async () => {
|
|
19
|
+
let e = [];
|
|
20
|
+
for (let t = 0; t < h.length; t += a) e.push(h.slice(t, t + a));
|
|
21
|
+
return (await Promise.all(e.map(async (e) => {
|
|
22
|
+
let t = await i({
|
|
23
|
+
gateway: "global",
|
|
24
|
+
authToken: d || void 0,
|
|
25
|
+
query: o,
|
|
26
|
+
variables: { inputs: e.map((e) => ({
|
|
27
|
+
actorId: f,
|
|
28
|
+
actorType: "USER",
|
|
29
|
+
scopeId: e,
|
|
30
|
+
resourceType: c,
|
|
31
|
+
action: l
|
|
32
|
+
})) }
|
|
33
|
+
});
|
|
34
|
+
if (t.errors?.length) throw Error(t.errors[0]?.message || "Failed to check permissions");
|
|
35
|
+
return t.data?.checkPermissions ?? [];
|
|
36
|
+
}))).flat();
|
|
37
|
+
},
|
|
38
|
+
staleTime: 60 * 1e3
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
allowedIds: t(() => {
|
|
42
|
+
let e = /* @__PURE__ */ new Set();
|
|
43
|
+
if (!g) return e;
|
|
44
|
+
let t = Math.min(g.length, h.length);
|
|
45
|
+
for (let n = 0; n < t; n += 1) g[n].allowed && h[n] && e.add(h[n]);
|
|
46
|
+
return e;
|
|
47
|
+
}, [g, h]),
|
|
48
|
+
loading: p && _,
|
|
49
|
+
isError: p && !!v
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { s as useOrgsWithPermission };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=useOrgsWithPermission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOrgsWithPermission.js","names":[],"sources":["../../src/hooks/useOrgsWithPermission.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\nimport { useAuth } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useWorkspacesContext } from '../providers/WorkspacesProvider';\n\n/**\n * Filter a set of organization ids down to those where the current user has\n * a specific RBAC permission. Bulk-checks against the rbac service so the\n * result tracks the authoritative permission evaluator — including\n * overrides and future OPA policies — instead of duplicating role→permission\n * logic on the client.\n *\n * The server caps a single bulk call at `CHECK_PERMISSIONS_BATCH_LIMIT`\n * inputs, so when a user has more orgs than that we chunk into multiple\n * parallel calls and merge the results positionally. Most users will fit\n * in one batch; the chunking is just defensive for power users / service\n * accounts with many memberships.\n *\n * Backend `@rbac` directives still enforce on the mutation; this filter is\n * purely UX so users aren't offered options that will 403 on submit.\n *\n * Note: this MFE talks to the gateway via the shared `graphqlFetch` helper\n * + react-query (not Apollo), so we mirror that pattern instead of using\n * the codegen'd Apollo hook. The duplicate `.graphql` file at\n * `src/operations/global/rbac/check-permissions.graphql` is intentionally\n * kept so when this MFE eventually migrates to the codegen'd pattern (see\n * todo.md, \"Issue to address later\"), the operation already exists.\n */\n\n// Matches the server-side limit on `checkPermissions(inputs: [...])` —\n// kept here as a constant so the chunking intent is explicit.\nconst CHECK_PERMISSIONS_BATCH_LIMIT = 50;\n\n// `decisionPath` is intentionally NOT selected — only `allowed` drives\n// the UI here, and `decisionPath` exposes RBAC policy internals (role\n// names, override decisions) that we don't want to leak into network\n// traffic visible in browser devtools just for UX filtering.\nconst CHECK_PERMISSIONS_QUERY = `\n query CheckRbacPermissions($inputs: [PermissionCheckInput!]!) {\n checkPermissions(inputs: $inputs) {\n allowed\n }\n }\n`;\n\ninterface PermissionCheckResult {\n allowed: boolean;\n}\n\nexport interface UseOrgsWithPermissionResult {\n allowedIds: Set<string>;\n loading: boolean;\n isError: boolean;\n}\n\nexport function useOrgsWithPermission(\n orgIds: readonly string[],\n resourceType: string,\n action: string\n): UseOrgsWithPermissionResult {\n const { user } = useAuth();\n const { authToken } = useWorkspacesContext();\n const actorId = user?.id ?? '';\n\n const enabled = Boolean(actorId && orgIds.length > 0);\n\n // `stableIds` only needs to change when the *values* change — a fresh array\n // with identical contents shouldn't bust the query cache or trigger refetch.\n // Use the joined string as the memo key so deep-equal arrays share a memo.\n // Separator MUST be a char that can't appear in an id (',') — joining\n // on '' would collide on adjacency: ['ab','cd'] and ['a','bcd'] would\n // share a cache key.\n const stableKey = useMemo(() => orgIds.join(','), [orgIds]);\n const stableIds = useMemo(() => (stableKey ? stableKey.split(',') : []), [stableKey]);\n\n const { data, isLoading, error } = useQuery({\n queryKey: ['checkPermissions', actorId, resourceType, action, stableKey],\n enabled,\n queryFn: async (): Promise<PermissionCheckResult[]> => {\n // Chunk into <=CHECK_PERMISSIONS_BATCH_LIMIT-sized batches so users\n // with more orgs than the server cap still get a complete answer.\n // Run batches in parallel and concat in input order so the\n // positional contract relied on below holds.\n const chunks: string[][] = [];\n for (let i = 0; i < stableIds.length; i += CHECK_PERMISSIONS_BATCH_LIMIT) {\n chunks.push(stableIds.slice(i, i + CHECK_PERMISSIONS_BATCH_LIMIT));\n }\n\n const batchResults = await Promise.all(\n chunks.map(async (chunk) => {\n const result = await graphqlFetch<{ checkPermissions: PermissionCheckResult[] }>({\n gateway: 'global',\n authToken: authToken || undefined,\n query: CHECK_PERMISSIONS_QUERY,\n variables: {\n inputs: chunk.map((scopeId) => ({\n actorId,\n actorType: 'USER',\n scopeId,\n resourceType,\n action,\n })),\n },\n });\n\n if (result.errors?.length) {\n throw new Error(result.errors[0]?.message || 'Failed to check permissions');\n }\n return result.data?.checkPermissions ?? [];\n })\n );\n\n return batchResults.flat();\n },\n staleTime: 60 * 1000,\n });\n\n const allowedIds = useMemo(() => {\n const out = new Set<string>();\n if (!data) return out;\n // Positional mapping is the documented contract of the bulk\n // `checkPermissions` API — results come back in the same order as\n // inputs. Length-guard against a backend that ever reorders/filters\n // so we never silently mis-attribute a permission to the wrong org.\n const bounded = Math.min(data.length, stableIds.length);\n for (let i = 0; i < bounded; i += 1) {\n if (data[i].allowed && stableIds[i]) out.add(stableIds[i]);\n }\n return out;\n }, [data, stableIds]);\n\n return {\n allowedIds,\n loading: enabled && isLoading,\n // Surface error so callers can decide between \"stay in loading state\"\n // and \"show an error\". Default behavior should be the former — the\n // backend @rbac directive still enforces correctly on submit, so it's\n // safer to keep the form visible than to lock the user out on a\n // transient rbac-svc blip.\n isError: enabled && Boolean(error),\n };\n}\n"],"mappings":";;;;;;AAgCA,IAAM,IAAgC,IAMhC,IAA0B;AAkBhC,SAAgB,EACd,GACA,GACA,GAC6B;CAC7B,IAAM,EAAE,YAAS,GAAS,EACpB,EAAE,iBAAc,GAAsB,EACtC,IAAU,GAAM,MAAM,IAEtB,IAAU,GAAQ,KAAW,EAAO,SAAS,IAQ7C,IAAY,QAAc,EAAO,KAAK,IAAI,EAAE,CAAC,EAAO,CAAC,EACrD,IAAY,QAAe,IAAY,EAAU,MAAM,IAAI,GAAG,EAAE,EAAG,CAAC,EAAU,CAAC,EAE/E,EAAE,SAAM,cAAW,aAAU,EAAS;EAC1C,UAAU;GAAC;GAAoB;GAAS;GAAc;GAAQ;GAAU;EACxE;EACA,SAAS,YAA8C;GAKrD,IAAM,IAAqB,EAAE;AAC7B,QAAK,IAAI,IAAI,GAAG,IAAI,EAAU,QAAQ,KAAK,EACzC,GAAO,KAAK,EAAU,MAAM,GAAG,IAAI,EAA8B,CAAC;AA2BpE,WAxBqB,MAAM,QAAQ,IACjC,EAAO,IAAI,OAAO,MAAU;IAC1B,IAAM,IAAS,MAAM,EAA4D;KAC/E,SAAS;KACT,WAAW,KAAa,KAAA;KACxB,OAAO;KACP,WAAW,EACT,QAAQ,EAAM,KAAK,OAAa;MAC9B;MACA,WAAW;MACX;MACA;MACA;MACD,EAAE,EACJ;KACF,CAAC;AAEF,QAAI,EAAO,QAAQ,OACjB,OAAU,MAAM,EAAO,OAAO,IAAI,WAAW,8BAA8B;AAE7E,WAAO,EAAO,MAAM,oBAAoB,EAAE;KAC1C,CACH,EAEmB,MAAM;;EAE5B,WAAW,KAAK;EACjB,CAAC;AAgBF,QAAO;EACL,YAfiB,QAAc;GAC/B,IAAM,oBAAM,IAAI,KAAa;AAC7B,OAAI,CAAC,EAAM,QAAO;GAKlB,IAAM,IAAU,KAAK,IAAI,EAAK,QAAQ,EAAU,OAAO;AACvD,QAAK,IAAI,IAAI,GAAG,IAAI,GAAS,KAAK,EAChC,CAAI,EAAK,GAAG,WAAW,EAAU,MAAI,EAAI,IAAI,EAAU,GAAG;AAE5D,UAAO;KACN,CAAC,GAAM,EAAU,CAAC;EAInB,SAAS,KAAW;EAMpB,SAAS,KAAW,EAAQ;EAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWorkspacesEventEmitter.js","names":[],"sources":["../../src/hooks/useWorkspacesEventEmitter.ts"],"sourcesContent":["/**\n * Workspaces-domain event emitter. Emits lifecycle events to the host shell's\n * event bus per `~/products/infra/infra-specs/microfrontends/47-FRONTEND-EVENT-BUS.md`.\n *\n * The MFE never sinks directly to Rybbit/audit — it goes through the bus.\n *\n * The fe-libs `EventBus.emit` is statically typed against `BurdenoffEventName`\n * which doesn't list our workspaces-domain names. The runtime bus is dynamic,\n * so the cast loses autocomplete but is sound.\n */\nimport { useCallback } from 'react';\n\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\n\nexport type WorkspacesDomainEvent =\n // Lifecycle (success)\n | 'workspace.created'\n | 'workspace.updated'\n | 'workspace.deleted'\n | 'workspace.archived'\n | 'workspace.reactivated'\n | 'project.created'\n | 'project.updated'\n | 'project.deleted'\n | 'project.archived'\n | 'project.unarchived'\n | 'workspace-member.added'\n | 'workspace-member.removed'\n | 'workspace-member.role-updated'\n | 'workspace-invitation.created'\n | 'workspace-invitation.updated'\n | 'workspace-invitation.accepted'\n | 'workspace-invitation.rejected'\n | 'workspace-invitation.cancelled'\n | 'workspace-invitation.resent'\n | 'workspace-invitation.deleted'\n | 'workspace-activity.appended'\n // Failure / observability — forwarded to OtelBrowserSink + audit sink\n | 'workspace.create_failed'\n | 'workspace.update_failed'\n | 'workspace.delete_failed'\n | 'workspace.archive_failed'\n | 'workspace.reactivate_failed'\n | 'project.create_failed'\n | 'project.update_failed'\n | 'project.delete_failed'\n | 'project.archive_failed'\n | 'project.unarchive_failed'\n | 'workspace-member.add_failed'\n | 'workspace-member.remove_failed'\n | 'workspace-member.role-update_failed'\n | 'workspace-invitation.create_failed'\n | 'workspace-invitation.update_failed'\n | 'workspace-invitation.accept_failed'\n | 'workspace-invitation.reject_failed'\n | 'workspace-invitation.cancel_failed'\n | 'workspace-invitation.resend_failed'\n | 'workspace-invitation.delete_failed'\n // Module-scoped (plural) — describes a navigation event into the module,\n // not an action on a single resource.\n | 'workspaces.page.viewed';\n\nexport interface WorkspacesEventPayload {\n workspaceId?: string;\n projectId?: string;\n memberId?: string;\n invitationId?: string;\n userId?: string;\n email?: string;\n source?: string;\n // Observability fields (no PII per SRE guide §7)\n page?: string;\n durationMs?: number;\n errorCode?: string;\n errorMessage?: string;\n}\n\nexport function useWorkspacesEventEmitter(): {\n emit: (event: WorkspacesDomainEvent, payload?: WorkspacesEventPayload) => void;\n} {\n const bus = useEventBus();\n // Memoize the emit callback so consumers (notably `useWorkspacesPageView`)\n // can put it in effect dep arrays without firing on every render.\n const emit = useCallback(\n (event: WorkspacesDomainEvent, payload: WorkspacesEventPayload = {}) => {\n try {\n type DynamicEmit = (e: string, p: unknown) => void;\n (bus as unknown as { emit: DynamicEmit }).emit(event, payload);\n } catch (err) {\n // Bus failures must not break workspace operations — but in dev we\n // surface the error so a wrong event shape doesn't disappear silently.\n if (import.meta.env?.DEV) {\n
|
|
1
|
+
{"version":3,"file":"useWorkspacesEventEmitter.js","names":[],"sources":["../../src/hooks/useWorkspacesEventEmitter.ts"],"sourcesContent":["/**\n * Workspaces-domain event emitter. Emits lifecycle events to the host shell's\n * event bus per `~/products/infra/infra-specs/microfrontends/47-FRONTEND-EVENT-BUS.md`.\n *\n * The MFE never sinks directly to Rybbit/audit — it goes through the bus.\n *\n * The fe-libs `EventBus.emit` is statically typed against `BurdenoffEventName`\n * which doesn't list our workspaces-domain names. The runtime bus is dynamic,\n * so the cast loses autocomplete but is sound.\n */\nimport { useCallback } from 'react';\n\nimport { useEventBus } from '@burdenoff/fe-libs/shared/events';\n\nexport type WorkspacesDomainEvent =\n // Lifecycle (success)\n | 'workspace.created'\n | 'workspace.updated'\n | 'workspace.deleted'\n | 'workspace.archived'\n | 'workspace.reactivated'\n | 'project.created'\n | 'project.updated'\n | 'project.deleted'\n | 'project.archived'\n | 'project.unarchived'\n | 'workspace-member.added'\n | 'workspace-member.removed'\n | 'workspace-member.role-updated'\n | 'workspace-invitation.created'\n | 'workspace-invitation.updated'\n | 'workspace-invitation.accepted'\n | 'workspace-invitation.rejected'\n | 'workspace-invitation.cancelled'\n | 'workspace-invitation.resent'\n | 'workspace-invitation.deleted'\n | 'workspace-activity.appended'\n // Failure / observability — forwarded to OtelBrowserSink + audit sink\n | 'workspace.create_failed'\n | 'workspace.update_failed'\n | 'workspace.delete_failed'\n | 'workspace.archive_failed'\n | 'workspace.reactivate_failed'\n | 'project.create_failed'\n | 'project.update_failed'\n | 'project.delete_failed'\n | 'project.archive_failed'\n | 'project.unarchive_failed'\n | 'workspace-member.add_failed'\n | 'workspace-member.remove_failed'\n | 'workspace-member.role-update_failed'\n | 'workspace-invitation.create_failed'\n | 'workspace-invitation.update_failed'\n | 'workspace-invitation.accept_failed'\n | 'workspace-invitation.reject_failed'\n | 'workspace-invitation.cancel_failed'\n | 'workspace-invitation.resend_failed'\n | 'workspace-invitation.delete_failed'\n // Module-scoped (plural) — describes a navigation event into the module,\n // not an action on a single resource.\n | 'workspaces.page.viewed';\n\nexport interface WorkspacesEventPayload {\n workspaceId?: string;\n projectId?: string;\n memberId?: string;\n invitationId?: string;\n userId?: string;\n email?: string;\n source?: string;\n // Observability fields (no PII per SRE guide §7)\n page?: string;\n durationMs?: number;\n errorCode?: string;\n errorMessage?: string;\n}\n\nexport function useWorkspacesEventEmitter(): {\n emit: (event: WorkspacesDomainEvent, payload?: WorkspacesEventPayload) => void;\n} {\n const bus = useEventBus();\n // Memoize the emit callback so consumers (notably `useWorkspacesPageView`)\n // can put it in effect dep arrays without firing on every render.\n const emit = useCallback(\n (event: WorkspacesDomainEvent, payload: WorkspacesEventPayload = {}) => {\n try {\n type DynamicEmit = (e: string, p: unknown) => void;\n (bus as unknown as { emit: DynamicEmit }).emit(event, payload);\n } catch (err) {\n // Bus failures must not break workspace operations — but in dev we\n // surface the error so a wrong event shape doesn't disappear silently.\n if (import.meta.env?.DEV) {\n console.warn('[useWorkspacesEventEmitter] event bus emit failed', {\n event,\n payload,\n err,\n });\n }\n }\n },\n [bus]\n );\n return { emit };\n}\n"],"mappings":";;;AA6EA,SAAgB,IAEd;CACA,IAAM,IAAM,GAAa;AAsBzB,QAAO,EAAE,MAnBI,GACV,GAA8B,IAAkC,EAAE,KAAK;AACtE,MAAI;AAED,KAAyC,KAAK,GAAO,EAAQ;UAClD;IAYhB,CAAC,EAAI,CACN,EACc"}
|
|
@@ -3,14 +3,14 @@ import { useEffect as t, useRef as n } from "react";
|
|
|
3
3
|
//#region src/hooks/useWorkspacesPageView.ts
|
|
4
4
|
var r = (e) => typeof e == "string" && e.length > 0;
|
|
5
5
|
function i(i, a) {
|
|
6
|
-
let { emit: o } = e(), s = a?.workspaceId, c = a?.projectId, l = a?.requireParams ?? !1, u = n(null);
|
|
6
|
+
let { emit: o } = e(), s = a?.workspaceId, c = a?.projectId, l = a?.requireParams ?? !1, u = a ? "workspaceId" in a : !1, d = a ? "projectId" in a : !1, f = n(null);
|
|
7
7
|
t(() => {
|
|
8
8
|
if (l) {
|
|
9
9
|
let e = [];
|
|
10
|
-
if (
|
|
10
|
+
if (u && e.push(s), d && e.push(c), e.some((e) => !r(e))) return;
|
|
11
11
|
}
|
|
12
12
|
let e = `${i}::${s ?? ""}::${c ?? ""}`;
|
|
13
|
-
|
|
13
|
+
f.current !== e && (f.current = e, o("workspaces.page.viewed", {
|
|
14
14
|
page: i,
|
|
15
15
|
workspaceId: s ?? void 0,
|
|
16
16
|
projectId: c ?? void 0
|
|
@@ -20,7 +20,9 @@ function i(i, a) {
|
|
|
20
20
|
i,
|
|
21
21
|
s,
|
|
22
22
|
c,
|
|
23
|
-
l
|
|
23
|
+
l,
|
|
24
|
+
u,
|
|
25
|
+
d
|
|
24
26
|
]);
|
|
25
27
|
}
|
|
26
28
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWorkspacesPageView.js","names":[],"sources":["../../src/hooks/useWorkspacesPageView.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nimport { useWorkspacesEventEmitter } from './useWorkspacesEventEmitter';\n\ninterface PageViewExtra {\n /**\n * Workspace context for the page. `undefined` / `null` / `''` are all\n * treated as \"unresolved\" when `requireParams` is true so that\n * `useParams()`'s `string | undefined` initial render doesn't fire\n * a phantom event with missing context.\n */\n workspaceId?: string | null;\n projectId?: string | null;\n /**\n * Set to `true` on routes that include `:workspaceId` / `:projectId`\n * in the path. The hook then skips the emit until **every value\n * supplied in `extra`** resolves to a non-empty string. Anything you\n * don't pass to `extra` is treated as \"not applicable to this page\"\n * — the hook ignores it.\n */\n requireParams?: boolean;\n}\n\nconst isResolved = (v: string | null | undefined): v is string =>\n typeof v === 'string' && v.length > 0;\n\n/**\n * Emit a `workspaces.page.viewed` event when a top-level workspaces page mounts\n * (and again when its `page` / `workspaceId` / `projectId` context changes).\n * The event is forwarded by the shell's bus to OtelBrowserSink / RybbitSink /\n * BackendAuditSink — the MFE never sinks directly.\n */\nexport function useWorkspacesPageView(page: string, extra?: PageViewExtra): void {\n const { emit } = useWorkspacesEventEmitter();\n const workspaceId = extra?.workspaceId;\n const projectId = extra?.projectId;\n const requireParams = extra?.requireParams ?? false;\n\n // Track the last (page, workspaceId, projectId) tuple we emitted for, so\n // when params resolve asynchronously and the same effect re-runs we don't\n // double-fire — and so a quick router transition that lands on the same\n // page only counts once.\n const lastKey = useRef<string | null>(null);\n\n useEffect(() => {\n // Skip while params are still resolving on routes that need them.\n // We check every key the caller actually supplied — if `extra.projectId`\n // wasn't passed it stays `undefined` and is ignored; if it WAS passed\n // (even as `undefined` from `useParams`) we wait for it to resolve.\n if (requireParams) {\n const passed: Array<string | null | undefined> = [];\n if (
|
|
1
|
+
{"version":3,"file":"useWorkspacesPageView.js","names":[],"sources":["../../src/hooks/useWorkspacesPageView.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nimport { useWorkspacesEventEmitter } from './useWorkspacesEventEmitter';\n\ninterface PageViewExtra {\n /**\n * Workspace context for the page. `undefined` / `null` / `''` are all\n * treated as \"unresolved\" when `requireParams` is true so that\n * `useParams()`'s `string | undefined` initial render doesn't fire\n * a phantom event with missing context.\n */\n workspaceId?: string | null;\n projectId?: string | null;\n /**\n * Set to `true` on routes that include `:workspaceId` / `:projectId`\n * in the path. The hook then skips the emit until **every value\n * supplied in `extra`** resolves to a non-empty string. Anything you\n * don't pass to `extra` is treated as \"not applicable to this page\"\n * — the hook ignores it.\n */\n requireParams?: boolean;\n}\n\nconst isResolved = (v: string | null | undefined): v is string =>\n typeof v === 'string' && v.length > 0;\n\n/**\n * Emit a `workspaces.page.viewed` event when a top-level workspaces page mounts\n * (and again when its `page` / `workspaceId` / `projectId` context changes).\n * The event is forwarded by the shell's bus to OtelBrowserSink / RybbitSink /\n * BackendAuditSink — the MFE never sinks directly.\n */\nexport function useWorkspacesPageView(page: string, extra?: PageViewExtra): void {\n const { emit } = useWorkspacesEventEmitter();\n const workspaceId = extra?.workspaceId;\n const projectId = extra?.projectId;\n const requireParams = extra?.requireParams ?? false;\n const hasWorkspaceIdKey = extra ? 'workspaceId' in extra : false;\n const hasProjectIdKey = extra ? 'projectId' in extra : false;\n\n // Track the last (page, workspaceId, projectId) tuple we emitted for, so\n // when params resolve asynchronously and the same effect re-runs we don't\n // double-fire — and so a quick router transition that lands on the same\n // page only counts once.\n const lastKey = useRef<string | null>(null);\n\n useEffect(() => {\n // Skip while params are still resolving on routes that need them.\n // We check every key the caller actually supplied — if `extra.projectId`\n // wasn't passed it stays `undefined` and is ignored; if it WAS passed\n // (even as `undefined` from `useParams`) we wait for it to resolve.\n if (requireParams) {\n const passed: Array<string | null | undefined> = [];\n if (hasWorkspaceIdKey) passed.push(workspaceId);\n if (hasProjectIdKey) passed.push(projectId);\n if (passed.some((v) => !isResolved(v))) {\n if (import.meta.env?.DEV) {\n console.debug('[useWorkspacesPageView] skipping — required params not yet resolved', {\n page,\n workspaceId,\n projectId,\n });\n }\n return;\n }\n }\n\n const key = `${page}::${workspaceId ?? ''}::${projectId ?? ''}`;\n if (lastKey.current === key) return;\n lastKey.current = key;\n\n emit('workspaces.page.viewed', {\n page,\n workspaceId: workspaceId ?? undefined,\n projectId: projectId ?? undefined,\n });\n }, [emit, page, workspaceId, projectId, requireParams, hasWorkspaceIdKey, hasProjectIdKey]);\n}\n"],"mappings":";;;AAuBA,IAAM,KAAc,MAClB,OAAO,KAAM,YAAY,EAAE,SAAS;AAQtC,SAAgB,EAAsB,GAAc,GAA6B;CAC/E,IAAM,EAAE,YAAS,GAA2B,EACtC,IAAc,GAAO,aACrB,IAAY,GAAO,WACnB,IAAgB,GAAO,iBAAiB,IACxC,IAAoB,IAAQ,iBAAiB,IAAQ,IACrD,IAAkB,IAAQ,eAAe,IAAQ,IAMjD,IAAU,EAAsB,KAAK;AAE3C,SAAgB;AAKd,MAAI,GAAe;GACjB,IAAM,IAA2C,EAAE;AAGnD,OAFI,KAAmB,EAAO,KAAK,EAAY,EAC3C,KAAiB,EAAO,KAAK,EAAU,EACvC,EAAO,MAAM,MAAM,CAAC,EAAW,EAAE,CAAC,CAQpC;;EAIJ,IAAM,IAAM,GAAG,EAAK,IAAI,KAAe,GAAG,IAAI,KAAa;AACvD,IAAQ,YAAY,MACxB,EAAQ,UAAU,GAElB,EAAK,0BAA0B;GAC7B;GACA,aAAa,KAAe,KAAA;GAC5B,WAAW,KAAa,KAAA;GACzB,CAAC;IACD;EAAC;EAAM;EAAM;EAAa;EAAW;EAAe;EAAmB;EAAgB,CAAC"}
|