From 40d4532788b6227bdd4610955e40205413d07b97 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Sat, 1 Feb 2025 21:53:01 -0700 Subject: [PATCH] move permission to asset interfaces --- .../asset_interfaces/dataset_groups/index.ts | 1 + .../dataset_groups/interfaces.ts} | 0 .../api/asset_interfaces/datasets/index.ts | 1 + .../datasets/permissionInterfaces.ts} | 0 web/src/api/asset_interfaces/index.ts | 4 + .../asset_interfaces/permission/interfaces.ts | 119 +++++++++++++++++ .../permission_groups/index.ts | 1 + .../permission_groups/interfaces.ts} | 0 web/src/api/asset_interfaces/sql/index.ts | 1 + .../sql/interfaces.ts} | 2 +- .../terms/index.ts | 0 .../api/buster_rest/dataset_groups/index.ts | 1 - .../dataset_groups/queryRequests.ts | 4 +- .../buster_rest/dataset_groups/requests.ts | 4 +- .../buster_rest/datasets/permissions/index.ts | 1 - .../datasets/permissions/queryRequests.ts | 2 +- .../datasets/permissions/requests.ts | 4 +- .../datasets/permissions/serverRequests.ts | 2 +- web/src/api/buster_rest/index.ts | 3 +- .../buster_rest/permission_groups/index.ts | 1 - .../permission_groups/queryRequests.ts | 7 +- .../buster_rest/permission_groups/requests.ts | 4 +- web/src/api/buster_rest/permissions/index.ts | 120 ------------------ web/src/api/buster_rest/sql/index.ts | 1 - web/src/api/buster_rest/sql/requests.ts | 2 +- .../buster_socket/metrics/metricsRequests.ts | 6 - .../permissions/permissionRequests.ts | 2 +- .../permissions/permissionResponses.ts | 4 +- web/src/api/buster_socket/sql/sqlResponses.ts | 2 +- .../PermissionLineageBreadcrumb.tsx | 2 +- .../_components/ShareMenu/AccessDropdown.tsx | 2 +- .../ShareMenu/IndividualSharePerson.tsx | 3 +- .../_components/ShareMenu/ShareMenuTopBar.tsx | 2 +- .../ShareMenu/ShareWithTeamAndGroup.tsx | 2 +- .../_DashboardIndividualContent.tsx | 2 +- .../PermissionListDatasetGroupContainer.tsx | 3 +- .../PermissionListUserContainer.tsx | 2 +- ...PermissionListPermissionGroupContainer.tsx | 7 +- .../PermissionListUsersContainer.tsx | 8 +- .../ListDatasetGroupsComponent.tsx | 2 +- .../DatasetGroupDatasetsListContainer.tsx | 10 +- .../DatasetGroupDatasetsListContainer.tsx | 8 +- .../users/DatasetGroupUsersListContainer.tsx | 8 +- .../ListPermissionGroupsComponent.tsx | 2 +- .../PermissionGroupDatasetsListContainer.tsx | 6 +- .../PermissionGroupDatasetsListContainer.tsx | 9 +- .../PermissionGroupUsersListContainer.tsx | 3 +- .../Permissions/PermissionsConfigProvider.tsx | 4 +- .../Permissions/usePermissionsGroups.tsx | 2 +- .../Permissions/usePermissionsTeams.tsx | 2 +- .../Permissions/usePermissionsUsers.tsx | 2 +- web/src/context/SQL/useSQLProvider.tsx | 2 +- 52 files changed, 192 insertions(+), 200 deletions(-) create mode 100644 web/src/api/asset_interfaces/dataset_groups/index.ts rename web/src/api/{buster_rest/dataset_groups/responseInterfaces.ts => asset_interfaces/dataset_groups/interfaces.ts} (100%) rename web/src/api/{buster_rest/datasets/permissions/responseInterfaces.ts => asset_interfaces/datasets/permissionInterfaces.ts} (100%) create mode 100644 web/src/api/asset_interfaces/permission_groups/index.ts rename web/src/api/{buster_rest/permission_groups/responseInterfaces.ts => asset_interfaces/permission_groups/interfaces.ts} (100%) create mode 100644 web/src/api/asset_interfaces/sql/index.ts rename web/src/api/{buster_rest/sql/responseInterfaces.ts => asset_interfaces/sql/interfaces.ts} (68%) rename web/src/api/{buster_rest => asset_interfaces}/terms/index.ts (100%) delete mode 100644 web/src/api/buster_rest/permissions/index.ts diff --git a/web/src/api/asset_interfaces/dataset_groups/index.ts b/web/src/api/asset_interfaces/dataset_groups/index.ts new file mode 100644 index 000000000..957860982 --- /dev/null +++ b/web/src/api/asset_interfaces/dataset_groups/index.ts @@ -0,0 +1 @@ +export * from './interfaces'; diff --git a/web/src/api/buster_rest/dataset_groups/responseInterfaces.ts b/web/src/api/asset_interfaces/dataset_groups/interfaces.ts similarity index 100% rename from web/src/api/buster_rest/dataset_groups/responseInterfaces.ts rename to web/src/api/asset_interfaces/dataset_groups/interfaces.ts diff --git a/web/src/api/asset_interfaces/datasets/index.ts b/web/src/api/asset_interfaces/datasets/index.ts index 957860982..d5970ff52 100644 --- a/web/src/api/asset_interfaces/datasets/index.ts +++ b/web/src/api/asset_interfaces/datasets/index.ts @@ -1 +1,2 @@ export * from './interfaces'; +export * from './permissionInterfaces'; diff --git a/web/src/api/buster_rest/datasets/permissions/responseInterfaces.ts b/web/src/api/asset_interfaces/datasets/permissionInterfaces.ts similarity index 100% rename from web/src/api/buster_rest/datasets/permissions/responseInterfaces.ts rename to web/src/api/asset_interfaces/datasets/permissionInterfaces.ts diff --git a/web/src/api/asset_interfaces/index.ts b/web/src/api/asset_interfaces/index.ts index 7c02222c4..0c12e3fe6 100644 --- a/web/src/api/asset_interfaces/index.ts +++ b/web/src/api/asset_interfaces/index.ts @@ -9,3 +9,7 @@ export * from './datasources'; export * from './users'; export * from './permission'; export * from './organizations'; +export * from './terms'; +export * from './sql'; +export * from './permission_groups'; +export * from './dataset_groups'; diff --git a/web/src/api/asset_interfaces/permission/interfaces.ts b/web/src/api/asset_interfaces/permission/interfaces.ts index ea684a582..9e521b720 100644 --- a/web/src/api/asset_interfaces/permission/interfaces.ts +++ b/web/src/api/asset_interfaces/permission/interfaces.ts @@ -119,3 +119,122 @@ export interface BusterPermissionGroup { user_count: number; users: BusterPermissionListUser[]; } + +export interface BusterPermissionListUser { + id: string; + email: string; + name: string; + role: BusterOrganizationRole; + belongs_to: boolean; + //only shows up with no filters. To lazy to type this out better + team_role?: BusterOrganizationRole; + //??? + team_count: number; + permission_group_count: number; +} + +export interface BusterPermissionUser { + id: string; + email: string; + name: string; + role: BusterOrganizationRole; + created_at: string; + permission_group_count: number; + permission_groups: { + dataset_count: number; + id: string; + identities: ('User' | 'Team')[]; + name: string; + }[]; + queries_last_30_days: number; + team_count: number; + teams: { + id: string; + member_count: number; + name: string; + team_role: BusterOrganizationRole; + }[]; + updated_at: string; + edit_sql: boolean; + export_assets: boolean; + email_slack_enabled: boolean; + upload_csv: boolean; + sharing_setting: 'none' | 'team' | 'organization' | 'public'; + dataset_count: number; +} + +export interface BusterPermissionListTeam { + id: string; + name: string; + member_count: number; + permission_group_count: number; + team_role: BusterOrganizationRole; + belongs_to: boolean; +} + +export interface BusterPermissionTeam { + id: string; + name: string; + member_count: number; + sharing_setting: BusterPermissionUser['sharing_setting']; + edit_sql: boolean; + export_assets: boolean; + email_slack_enabled: boolean; + upload_csv: boolean; + created_at: string; + updated_at: string; + permission_group_count: number; + users: { + email: string; + id: string; + name: string; + role: BusterOrganizationRole; + }[]; + permission_groups: { + dataset_count: number; + id: string; + identities: ('User' | 'Team')[]; + name: string; + }[]; + organization_id: string; + created_by: { + name: string; + id: string; + }; +} + +export interface BusterPermissionListGroup { + id: string; + name: string; + dataset_count: number; + belongs_to: boolean; + teams?: { id: string; name: string }[]; + //only shows up with no filters. To lazy to type this out better + team_count?: number; + member_count?: number; +} + +export interface BusterPermissionGroup { + id: string; + name: string; + dataset_count: number; + member_count: number; + team_count: number; + created_by: { + name: string; + id: string; + }; + updated_at: string; + datasets: BusterDatasetListItem[]; + deleted_at: string | null; + organization_id: string; + teams: { + id: string; + member_count: number; + name: string; + team_role: BusterOrganizationRole; + }[]; + updated_by: string; + user_count: number; + users: BusterPermissionListUser[]; +} diff --git a/web/src/api/asset_interfaces/permission_groups/index.ts b/web/src/api/asset_interfaces/permission_groups/index.ts new file mode 100644 index 000000000..957860982 --- /dev/null +++ b/web/src/api/asset_interfaces/permission_groups/index.ts @@ -0,0 +1 @@ +export * from './interfaces'; diff --git a/web/src/api/buster_rest/permission_groups/responseInterfaces.ts b/web/src/api/asset_interfaces/permission_groups/interfaces.ts similarity index 100% rename from web/src/api/buster_rest/permission_groups/responseInterfaces.ts rename to web/src/api/asset_interfaces/permission_groups/interfaces.ts diff --git a/web/src/api/asset_interfaces/sql/index.ts b/web/src/api/asset_interfaces/sql/index.ts new file mode 100644 index 000000000..957860982 --- /dev/null +++ b/web/src/api/asset_interfaces/sql/index.ts @@ -0,0 +1 @@ +export * from './interfaces'; diff --git a/web/src/api/buster_rest/sql/responseInterfaces.ts b/web/src/api/asset_interfaces/sql/interfaces.ts similarity index 68% rename from web/src/api/buster_rest/sql/responseInterfaces.ts rename to web/src/api/asset_interfaces/sql/interfaces.ts index 1fd2037dc..ba54ac7ff 100644 --- a/web/src/api/buster_rest/sql/responseInterfaces.ts +++ b/web/src/api/asset_interfaces/sql/interfaces.ts @@ -1,4 +1,4 @@ -import { DataMetadata } from '@/api/asset_interfaces'; +import { DataMetadata } from '../metric'; export interface RunSQLResponse { data: Record[]; diff --git a/web/src/api/buster_rest/terms/index.ts b/web/src/api/asset_interfaces/terms/index.ts similarity index 100% rename from web/src/api/buster_rest/terms/index.ts rename to web/src/api/asset_interfaces/terms/index.ts diff --git a/web/src/api/buster_rest/dataset_groups/index.ts b/web/src/api/buster_rest/dataset_groups/index.ts index 2f7f15ca0..cf25f89f5 100644 --- a/web/src/api/buster_rest/dataset_groups/index.ts +++ b/web/src/api/buster_rest/dataset_groups/index.ts @@ -1,3 +1,2 @@ export * from './requests'; -export * from './responseInterfaces'; export * from './queryRequests'; diff --git a/web/src/api/buster_rest/dataset_groups/queryRequests.ts b/web/src/api/buster_rest/dataset_groups/queryRequests.ts index 5e558eeba..ebef6d5cc 100644 --- a/web/src/api/buster_rest/dataset_groups/queryRequests.ts +++ b/web/src/api/buster_rest/dataset_groups/queryRequests.ts @@ -20,11 +20,11 @@ import { QueryClient, useQueryClient } from '@tanstack/react-query'; import { useMemoizedFn } from 'ahooks'; import { LIST_DATASET_GROUPS_QUERY_KEY } from '../datasets/permissions/config'; import { USER_PERMISSIONS_DATASET_GROUPS_QUERY_KEY } from '../users/permissions/config'; -import { +import type { GetDatasetGroupDatasetsResponse, GetDatasetGroupPermissionGroupsResponse, GetDatasetGroupUsersResponse -} from './responseInterfaces'; +} from '../../asset_interfaces'; import { timeout } from '@/utils'; export const useListDatasetGroups = () => { diff --git a/web/src/api/buster_rest/dataset_groups/requests.ts b/web/src/api/buster_rest/dataset_groups/requests.ts index 5740de29f..59f957ae3 100644 --- a/web/src/api/buster_rest/dataset_groups/requests.ts +++ b/web/src/api/buster_rest/dataset_groups/requests.ts @@ -1,11 +1,11 @@ import { serverFetch } from '@/api/createServerInstance'; import { mainApi } from '../instances'; -import { +import type { DatasetGroup, GetDatasetGroupPermissionGroupsResponse, GetDatasetGroupDatasetsResponse, GetDatasetGroupUsersResponse -} from './responseInterfaces'; +} from '../../asset_interfaces'; export const listDatasetGroups = async () => { return mainApi.get(`/dataset_groups`).then((res) => res.data); diff --git a/web/src/api/buster_rest/datasets/permissions/index.ts b/web/src/api/buster_rest/datasets/permissions/index.ts index 3f66ae8c3..1f3496d77 100644 --- a/web/src/api/buster_rest/datasets/permissions/index.ts +++ b/web/src/api/buster_rest/datasets/permissions/index.ts @@ -1,4 +1,3 @@ export * from './requests'; export * from './queryRequests'; -export * from './responseInterfaces'; export * from './config'; diff --git a/web/src/api/buster_rest/datasets/permissions/queryRequests.ts b/web/src/api/buster_rest/datasets/permissions/queryRequests.ts index 732f38c76..6d1bb5379 100644 --- a/web/src/api/buster_rest/datasets/permissions/queryRequests.ts +++ b/web/src/api/buster_rest/datasets/permissions/queryRequests.ts @@ -15,7 +15,7 @@ import { import { useMemoizedFn } from 'ahooks'; import { QueryClient, useQueryClient } from '@tanstack/react-query'; import { getDatasetPermissionsOverview_server } from './serverRequests'; -import { ListPermissionUsersResponse } from './responseInterfaces'; +import type { ListPermissionUsersResponse } from '../../../asset_interfaces'; import { PERMISSION_GROUP_QUERY_KEY } from '../../permission_groups'; import { LIST_DATASET_GROUPS_QUERY_KEY } from './config'; diff --git a/web/src/api/buster_rest/datasets/permissions/requests.ts b/web/src/api/buster_rest/datasets/permissions/requests.ts index 7d10a88a2..730dc822c 100644 --- a/web/src/api/buster_rest/datasets/permissions/requests.ts +++ b/web/src/api/buster_rest/datasets/permissions/requests.ts @@ -1,10 +1,10 @@ import { mainApi } from '../../instances'; -import { +import type { DatasetPermissionsOverviewResponse, ListDatasetGroupsResponse, ListPermissionGroupsResponse, ListPermissionUsersResponse -} from './responseInterfaces'; +} from '../../../asset_interfaces'; import * as config from './config'; export const listIndividualDatasetPermissionGroups = async ({ diff --git a/web/src/api/buster_rest/datasets/permissions/serverRequests.ts b/web/src/api/buster_rest/datasets/permissions/serverRequests.ts index a89d6741a..a3a1896c0 100644 --- a/web/src/api/buster_rest/datasets/permissions/serverRequests.ts +++ b/web/src/api/buster_rest/datasets/permissions/serverRequests.ts @@ -2,7 +2,7 @@ import * as config from './config'; import { serverFetch } from '../../../createServerInstance'; -import { DatasetPermissionsOverviewResponse } from './responseInterfaces'; +import type { DatasetPermissionsOverviewResponse } from '../../../asset_interfaces'; export const getDatasetPermissionsOverview_server = async (datasetId: string) => { const response = await serverFetch( diff --git a/web/src/api/buster_rest/index.ts b/web/src/api/buster_rest/index.ts index 29375ea8c..cc827cbc7 100644 --- a/web/src/api/buster_rest/index.ts +++ b/web/src/api/buster_rest/index.ts @@ -1,5 +1,5 @@ export * from './users'; -export * from './terms'; +export * from '../asset_interfaces/terms'; export * from './assets'; export * from './api_keys'; export * from './sql'; @@ -7,3 +7,4 @@ export * from './datasets'; export * from './dataset_groups'; export * from './permission_groups'; export * from './organizations'; +export * from './sql'; diff --git a/web/src/api/buster_rest/permission_groups/index.ts b/web/src/api/buster_rest/permission_groups/index.ts index f17b4e619..1f3496d77 100644 --- a/web/src/api/buster_rest/permission_groups/index.ts +++ b/web/src/api/buster_rest/permission_groups/index.ts @@ -1,4 +1,3 @@ export * from './requests'; -export * from './responseInterfaces'; export * from './queryRequests'; export * from './config'; diff --git a/web/src/api/buster_rest/permission_groups/queryRequests.ts b/web/src/api/buster_rest/permission_groups/queryRequests.ts index 084f0edb4..5d6eb8c2c 100644 --- a/web/src/api/buster_rest/permission_groups/queryRequests.ts +++ b/web/src/api/buster_rest/permission_groups/queryRequests.ts @@ -22,15 +22,16 @@ import { } from './requests'; import { useMemoizedFn } from 'ahooks'; import { QueryClient, useQueryClient } from '@tanstack/react-query'; -import { +import type { GetPermissionGroupDatasetGroupsResponse, GetPermissionGroupDatasetsResponse, GetPermissionGroupResponse, GetPermissionGroupUsersResponse -} from './responseInterfaces'; +} from '@/api/asset_interfaces'; import isEmpty from 'lodash/isEmpty'; import { PERMISSION_GROUP_QUERY_KEY } from './config'; -import { ListPermissionGroupsResponse, updateDatasetPermissionGroups } from '../datasets'; +import { updateDatasetPermissionGroups } from '../datasets'; +import type { ListPermissionGroupsResponse } from '../../asset_interfaces'; import { USER_PERMISSIONS_PERMISSION_GROUPS_QUERY_KEY } from '../users/permissions/config'; export const useListAllPermissionGroups = () => { diff --git a/web/src/api/buster_rest/permission_groups/requests.ts b/web/src/api/buster_rest/permission_groups/requests.ts index d962c11d8..ebe550e9c 100644 --- a/web/src/api/buster_rest/permission_groups/requests.ts +++ b/web/src/api/buster_rest/permission_groups/requests.ts @@ -1,12 +1,12 @@ import { serverFetch } from '@/api/createServerInstance'; import { mainApi } from '../instances'; -import { +import type { CreatePermissionGroupResponse, GetPermissionGroupDatasetGroupsResponse, GetPermissionGroupDatasetsResponse, GetPermissionGroupResponse, GetPermissionGroupUsersResponse -} from './responseInterfaces'; +} from '../../asset_interfaces'; export const listAllPermissionGroups = async (): Promise => { return await mainApi diff --git a/web/src/api/buster_rest/permissions/index.ts b/web/src/api/buster_rest/permissions/index.ts deleted file mode 100644 index 70cf7e4ec..000000000 --- a/web/src/api/buster_rest/permissions/index.ts +++ /dev/null @@ -1,120 +0,0 @@ -import type { BusterDatasetListItem, BusterOrganizationRole } from '../../asset_interfaces/'; - -export interface BusterPermissionListUser { - id: string; - email: string; - name: string; - role: BusterOrganizationRole; - belongs_to: boolean; - //only shows up with no filters. To lazy to type this out better - team_role?: BusterOrganizationRole; - //??? - team_count: number; - permission_group_count: number; -} - -export interface BusterPermissionUser { - id: string; - email: string; - name: string; - role: BusterOrganizationRole; - created_at: string; - permission_group_count: number; - permission_groups: { - dataset_count: number; - id: string; - identities: ('User' | 'Team')[]; - name: string; - }[]; - queries_last_30_days: number; - team_count: number; - teams: { - id: string; - member_count: number; - name: string; - team_role: BusterOrganizationRole; - }[]; - updated_at: string; - edit_sql: boolean; - export_assets: boolean; - email_slack_enabled: boolean; - upload_csv: boolean; - sharing_setting: 'none' | 'team' | 'organization' | 'public'; - dataset_count: number; -} - -export interface BusterPermissionListTeam { - id: string; - name: string; - member_count: number; - permission_group_count: number; - team_role: BusterOrganizationRole; - belongs_to: boolean; -} - -export interface BusterPermissionTeam { - id: string; - name: string; - member_count: number; - sharing_setting: BusterPermissionUser['sharing_setting']; - edit_sql: boolean; - export_assets: boolean; - email_slack_enabled: boolean; - upload_csv: boolean; - created_at: string; - updated_at: string; - permission_group_count: number; - users: { - email: string; - id: string; - name: string; - role: BusterOrganizationRole; - }[]; - permission_groups: { - dataset_count: number; - id: string; - identities: ('User' | 'Team')[]; - name: string; - }[]; - organization_id: string; - created_by: { - name: string; - id: string; - }; -} - -export interface BusterPermissionListGroup { - id: string; - name: string; - dataset_count: number; - belongs_to: boolean; - teams?: { id: string; name: string }[]; - //only shows up with no filters. To lazy to type this out better - team_count?: number; - member_count?: number; -} - -export interface BusterPermissionGroup { - id: string; - name: string; - dataset_count: number; - member_count: number; - team_count: number; - created_by: { - name: string; - id: string; - }; - updated_at: string; - datasets: BusterDatasetListItem[]; - deleted_at: string | null; - organization_id: string; - teams: { - id: string; - member_count: number; - name: string; - team_role: BusterOrganizationRole; - }[]; - updated_by: string; - user_count: number; - users: BusterPermissionListUser[]; -} diff --git a/web/src/api/buster_rest/sql/index.ts b/web/src/api/buster_rest/sql/index.ts index d3f48297f..c3dff2f3f 100644 --- a/web/src/api/buster_rest/sql/index.ts +++ b/web/src/api/buster_rest/sql/index.ts @@ -1,2 +1 @@ export * from './requests'; -export * from './responseInterfaces'; diff --git a/web/src/api/buster_rest/sql/requests.ts b/web/src/api/buster_rest/sql/requests.ts index dcbfa1e79..80dd3b8e9 100644 --- a/web/src/api/buster_rest/sql/requests.ts +++ b/web/src/api/buster_rest/sql/requests.ts @@ -1,5 +1,5 @@ import { mainApi } from '../instances'; -import { RunSQLResponse } from './responseInterfaces'; +import type { RunSQLResponse } from '../../asset_interfaces'; export const runSQL = (params: { data_source_id: string; sql: string }) => { return mainApi.post('/sql/run', params); diff --git a/web/src/api/buster_socket/metrics/metricsRequests.ts b/web/src/api/buster_socket/metrics/metricsRequests.ts index 1d34a9b11..eb50ecc73 100644 --- a/web/src/api/buster_socket/metrics/metricsRequests.ts +++ b/web/src/api/buster_socket/metrics/metricsRequests.ts @@ -35,12 +35,6 @@ export type MetricCreateNewMetric = BusterSocketRequestBase< } >; -export enum ShareRole { - OWNER = 'owner', - EDITOR = 'editor', - VIEWER = 'viewer' -} - export type MetricUpdateMetric = BusterSocketRequestBase< '/metrics/update', { diff --git a/web/src/api/buster_socket/permissions/permissionRequests.ts b/web/src/api/buster_socket/permissions/permissionRequests.ts index 7015d43aa..a768445d6 100644 --- a/web/src/api/buster_socket/permissions/permissionRequests.ts +++ b/web/src/api/buster_socket/permissions/permissionRequests.ts @@ -1,6 +1,6 @@ import type { BusterOrganizationRole } from '../../asset_interfaces'; import type { BusterSocketRequestBase } from '../base_interfaces'; -import type { BusterPermissionUser } from '@/api/buster_rest/permissions'; +import type { BusterPermissionUser } from '@/api/asset_interfaces'; export type PermissionsListUsersRequest = BusterSocketRequestBase< '/permissions/users/list', diff --git a/web/src/api/buster_socket/permissions/permissionResponses.ts b/web/src/api/buster_socket/permissions/permissionResponses.ts index df76f2d12..a2c6567fd 100644 --- a/web/src/api/buster_socket/permissions/permissionResponses.ts +++ b/web/src/api/buster_socket/permissions/permissionResponses.ts @@ -1,11 +1,11 @@ -import { +import type { BusterPermissionGroup, BusterPermissionListGroup, BusterPermissionListTeam, BusterPermissionListUser, BusterPermissionTeam, BusterPermissionUser -} from '@/api/buster_rest/permissions'; +} from '@/api/asset_interfaces'; export enum PermissionsResponses { '/permissions/users/list:listUserPermissions' = '/permissions/users/list:listUserPermissions', diff --git a/web/src/api/buster_socket/sql/sqlResponses.ts b/web/src/api/buster_socket/sql/sqlResponses.ts index 679ccface..4b65235b1 100644 --- a/web/src/api/buster_socket/sql/sqlResponses.ts +++ b/web/src/api/buster_socket/sql/sqlResponses.ts @@ -1,4 +1,4 @@ -import { RunSQLResponse } from '@/api/buster_rest/sql'; +import type { RunSQLResponse } from '@/api/asset_interfaces'; export enum SQLResponses { '/sql/run:runSql' = '/sql/run:runSql' diff --git a/web/src/app/app/_components/PermissionComponents/PermissionLineageBreadcrumb.tsx b/web/src/app/app/_components/PermissionComponents/PermissionLineageBreadcrumb.tsx index c6997d9b4..7b20b6197 100644 --- a/web/src/app/app/_components/PermissionComponents/PermissionLineageBreadcrumb.tsx +++ b/web/src/app/app/_components/PermissionComponents/PermissionLineageBreadcrumb.tsx @@ -1,4 +1,4 @@ -import { DatasetPermissionOverviewUser } from '@/api/buster_rest/datasets'; +import type { DatasetPermissionOverviewUser } from '@/api/asset_interfaces'; import { AppMaterialIcons, AppPopover } from '@/components'; import { BusterRoutes, createBusterRoute } from '@/routes'; import { useMemoizedFn } from 'ahooks'; diff --git a/web/src/app/app/_components/ShareMenu/AccessDropdown.tsx b/web/src/app/app/_components/ShareMenu/AccessDropdown.tsx index 6661c6ada..633d34cd1 100644 --- a/web/src/app/app/_components/ShareMenu/AccessDropdown.tsx +++ b/web/src/app/app/_components/ShareMenu/AccessDropdown.tsx @@ -2,7 +2,7 @@ import { useAntToken } from '@/styles/useAntToken'; import React, { useMemo } from 'react'; import { Dropdown, Divider, MenuProps } from 'antd'; import { AppMaterialIcons } from '@/components'; -import { ShareRole } from '@/api/buster_socket/metrics'; +import { ShareRole } from '@/api/asset_interfaces'; import { DropdownLabel } from '@/components/dropdown'; import { Text } from '@/components'; import { useMemoizedFn } from 'ahooks'; diff --git a/web/src/app/app/_components/ShareMenu/IndividualSharePerson.tsx b/web/src/app/app/_components/ShareMenu/IndividualSharePerson.tsx index 32634e8f7..0090b5e74 100644 --- a/web/src/app/app/_components/ShareMenu/IndividualSharePerson.tsx +++ b/web/src/app/app/_components/ShareMenu/IndividualSharePerson.tsx @@ -2,10 +2,9 @@ import { BusterUserAvatar } from '@/components'; import { AccessDropdown } from './AccessDropdown'; import React from 'react'; -import { ShareRole } from '@/api/buster_socket/metrics'; +import { ShareRole } from '@/api/asset_interfaces'; import { Text } from '@/components'; import { useMemoizedFn } from 'ahooks'; -import { ShareAssetType } from '@/api/asset_interfaces'; export const IndividualSharePerson: React.FC<{ name: string; diff --git a/web/src/app/app/_components/ShareMenu/ShareMenuTopBar.tsx b/web/src/app/app/_components/ShareMenu/ShareMenuTopBar.tsx index 7c6a8416c..9aec7da5f 100644 --- a/web/src/app/app/_components/ShareMenu/ShareMenuTopBar.tsx +++ b/web/src/app/app/_components/ShareMenu/ShareMenuTopBar.tsx @@ -2,7 +2,7 @@ import { AppSegmented, AppSegmentedProps } from '@/components'; import React, { useMemo } from 'react'; import { CopyLinkButton } from './CopyLinkButton'; import { ShareAssetType } from '@/api/asset_interfaces'; -import { ShareRole } from '@/api/buster_socket/metrics'; +import { ShareRole } from '@/api/asset_interfaces'; import { useMemoizedFn } from 'ahooks'; import { SegmentedValue } from 'antd/es/segmented'; diff --git a/web/src/app/app/_components/ShareMenu/ShareWithTeamAndGroup.tsx b/web/src/app/app/_components/ShareMenu/ShareWithTeamAndGroup.tsx index 34dd3c95d..559ec9eed 100644 --- a/web/src/app/app/_components/ShareMenu/ShareWithTeamAndGroup.tsx +++ b/web/src/app/app/_components/ShareMenu/ShareWithTeamAndGroup.tsx @@ -5,7 +5,7 @@ import { AppMaterialIcons, BackButton } from '@/components'; import { useStyles } from './useStyles'; import { AccessDropdown } from './AccessDropdown'; import { useUserConfigContextSelector } from '@/context/Users'; -import { ShareRole } from '@/api/buster_socket/metrics'; +import { ShareRole } from '@/api/asset_interfaces'; import { useDashboardContextSelector, useIndividualDashboard } from '@/context/Dashboards'; import { ShareRequest } from '@/api/buster_socket/dashboards'; import { useMemoizedFn } from 'ahooks'; diff --git a/web/src/app/app/dashboards/[dashboardId]/_DashboardIndividualContent.tsx b/web/src/app/app/dashboards/[dashboardId]/_DashboardIndividualContent.tsx index 87fff10c3..f6e17d004 100644 --- a/web/src/app/app/dashboards/[dashboardId]/_DashboardIndividualContent.tsx +++ b/web/src/app/app/dashboards/[dashboardId]/_DashboardIndividualContent.tsx @@ -11,7 +11,7 @@ import { import { DashboardIndividualDashboard } from './_DashboardIndividualDashboard'; import { EditableTitle } from '@/components'; import { useUserConfigContextSelector } from '@/context/Users'; -import { ShareRole } from '@/api/buster_socket/metrics'; +import { ShareRole } from '@/api/asset_interfaces'; import { useMemoizedFn } from 'ahooks'; import { BusterDashboardResponse } from '@/api/asset_interfaces'; diff --git a/web/src/app/app/datasets/[datasetId]/permissions/dataset-groups/_PermissionDatasetGroups/PermissionListDatasetGroupContainer.tsx b/web/src/app/app/datasets/[datasetId]/permissions/dataset-groups/_PermissionDatasetGroups/PermissionListDatasetGroupContainer.tsx index 16603c2a8..31bdcc243 100644 --- a/web/src/app/app/datasets/[datasetId]/permissions/dataset-groups/_PermissionDatasetGroups/PermissionListDatasetGroupContainer.tsx +++ b/web/src/app/app/datasets/[datasetId]/permissions/dataset-groups/_PermissionDatasetGroups/PermissionListDatasetGroupContainer.tsx @@ -1,4 +1,5 @@ -import { ListDatasetGroupsResponse, useDatasetUpdateDatasetGroups } from '@/api/buster_rest'; +import type { ListDatasetGroupsResponse } from '@/api/asset_interfaces'; +import { useDatasetUpdateDatasetGroups } from '@/api/buster_rest'; import { BusterListColumn, BusterListRowItem, diff --git a/web/src/app/app/datasets/[datasetId]/permissions/overview/_PermissionOverview/PermissionListUserContainer.tsx b/web/src/app/app/datasets/[datasetId]/permissions/overview/_PermissionOverview/PermissionListUserContainer.tsx index 753141e20..1fa51cb91 100644 --- a/web/src/app/app/datasets/[datasetId]/permissions/overview/_PermissionOverview/PermissionListUserContainer.tsx +++ b/web/src/app/app/datasets/[datasetId]/permissions/overview/_PermissionOverview/PermissionListUserContainer.tsx @@ -1,5 +1,5 @@ import React, { useMemo, useState } from 'react'; -import { DatasetPermissionOverviewUser } from '@/api/buster_rest/datasets'; +import type { DatasetPermissionOverviewUser } from '@/api/asset_interfaces'; import { BusterListColumn, BusterListRowItem, diff --git a/web/src/app/app/datasets/[datasetId]/permissions/permission-groups/_PermissionPermissionGroup/PermissionListPermissionGroupContainer.tsx b/web/src/app/app/datasets/[datasetId]/permissions/permission-groups/_PermissionPermissionGroup/PermissionListPermissionGroupContainer.tsx index 940da7c3c..4d23ac2fd 100644 --- a/web/src/app/app/datasets/[datasetId]/permissions/permission-groups/_PermissionPermissionGroup/PermissionListPermissionGroupContainer.tsx +++ b/web/src/app/app/datasets/[datasetId]/permissions/permission-groups/_PermissionPermissionGroup/PermissionListPermissionGroupContainer.tsx @@ -1,11 +1,8 @@ -import { - ListPermissionGroupsResponse, - useDatasetUpdatePermissionGroups -} from '@/api/buster_rest/datasets'; +import type { ListPermissionGroupsResponse } from '@/api/asset_interfaces'; +import { useDatasetUpdatePermissionGroups } from '@/api/buster_rest/datasets'; import { BusterListColumn, BusterListRowItem, EmptyStateList } from '@/components/list'; import { useMemoizedFn } from 'ahooks'; import React, { useMemo, useState } from 'react'; -import { Text } from '@/components/text'; import { PermissionGroupSelectedPopup } from './PermissionGroupSelectedPopup'; import { BusterInfiniteList, InfiniteListContainer } from '@/components/list'; import { PermissionAssignedCell } from '@/app/app/_components/PermissionComponents'; diff --git a/web/src/app/app/datasets/[datasetId]/permissions/users/_PermissionUsers/PermissionListUsersContainer.tsx b/web/src/app/app/datasets/[datasetId]/permissions/users/_PermissionUsers/PermissionListUsersContainer.tsx index 879edcc53..fb75e593c 100644 --- a/web/src/app/app/datasets/[datasetId]/permissions/users/_PermissionUsers/PermissionListUsersContainer.tsx +++ b/web/src/app/app/datasets/[datasetId]/permissions/users/_PermissionUsers/PermissionListUsersContainer.tsx @@ -1,8 +1,8 @@ -import { +import type { ListPermissionGroupsResponse, - ListPermissionUsersResponse, - useDatasetUpdatePermissionUsers -} from '@/api/buster_rest/datasets'; + ListPermissionUsersResponse +} from '@/api/asset_interfaces'; +import { useDatasetUpdatePermissionUsers } from '@/api/buster_rest/datasets'; import { BusterListColumn, BusterListRowItem, diff --git a/web/src/app/app/settings/(permissions)/dataset-groups/ListDatasetGroupsComponent.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/ListDatasetGroupsComponent.tsx index 4e9cde628..b3483ce28 100644 --- a/web/src/app/app/settings/(permissions)/dataset-groups/ListDatasetGroupsComponent.tsx +++ b/web/src/app/app/settings/(permissions)/dataset-groups/ListDatasetGroupsComponent.tsx @@ -7,7 +7,7 @@ import { } from '@/components/list'; import React, { useMemo } from 'react'; import { BusterRoutes, createBusterRoute } from '@/routes'; -import { DatasetGroup } from '@/api/buster_rest'; +import type { DatasetGroup } from '@/api/asset_interfaces'; export const ListDatasetGroupsComponent: React.FC<{ datasetGroups: DatasetGroup[]; diff --git a/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx index 670fef9cb..dde13ed04 100644 --- a/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx +++ b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/datasets/DatasetGroupDatasetsListContainer.tsx @@ -1,10 +1,8 @@ -import { +import type { GetDatasetGroupDatasetsResponse, - GetPermissionGroupDatasetsResponse, - GetPermissionGroupUsersResponse, - useUpdateDatasetGroupDatasets, - useUpdatePermissionGroupDatasets -} from '@/api/buster_rest'; + GetPermissionGroupUsersResponse +} from '@/api/asset_interfaces'; +import { useUpdateDatasetGroupDatasets } from '@/api/buster_rest'; import { PermissionAssignedCell } from '@/app/app/_components/PermissionComponents'; import { BusterInfiniteList, diff --git a/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx index e7a05ebdf..3d6c52066 100644 --- a/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx +++ b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/permission-groups/DatasetGroupDatasetsListContainer.tsx @@ -1,8 +1,8 @@ -import { +import type { GetDatasetGroupPermissionGroupsResponse, - GetPermissionGroupDatasetGroupsResponse, - useUpdateDatasetGroupPermissionGroups -} from '@/api/buster_rest'; + GetPermissionGroupDatasetGroupsResponse +} from '@/api/asset_interfaces'; +import { useUpdateDatasetGroupPermissionGroups } from '@/api/buster_rest'; import { PermissionAssignedCell } from '@appComponents/PermissionComponents'; import { BusterInfiniteList, diff --git a/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx index 04f77e2cd..c97997f41 100644 --- a/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx +++ b/web/src/app/app/settings/(permissions)/dataset-groups/[datasetGroupId]/users/DatasetGroupUsersListContainer.tsx @@ -1,8 +1,8 @@ -import { +import type { GetDatasetGroupUsersResponse, - GetPermissionGroupUsersResponse, - useUpdateDatasetGroupUsers -} from '@/api/buster_rest'; + GetPermissionGroupUsersResponse +} from '@/api/asset_interfaces'; +import { useUpdateDatasetGroupUsers } from '@/api/buster_rest'; import { PermissionAssignedCell } from '@/app/app/_components/PermissionComponents'; import { BusterInfiniteList, diff --git a/web/src/app/app/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx b/web/src/app/app/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx index e8232af38..f2ae815b4 100644 --- a/web/src/app/app/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx +++ b/web/src/app/app/settings/(permissions)/permission-groups/ListPermissionGroupsComponent.tsx @@ -7,7 +7,7 @@ import { } from '@/components/list'; import React, { useMemo } from 'react'; import { BusterRoutes, createBusterRoute } from '@/routes'; -import { GetPermissionGroupResponse } from '@/api/buster_rest'; +import type { GetPermissionGroupResponse } from '@/api/asset_interfaces'; export const ListPermissionGroupsComponent: React.FC<{ permissionGroups: GetPermissionGroupResponse[]; diff --git a/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetsListContainer.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetsListContainer.tsx index 13fe71b19..6065181df 100644 --- a/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetsListContainer.tsx +++ b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/dataset-groups/PermissionGroupDatasetsListContainer.tsx @@ -1,7 +1,5 @@ -import { - GetPermissionGroupDatasetGroupsResponse, - useUpdatePermissionGroupDatasetGroups -} from '@/api/buster_rest'; +import type { GetPermissionGroupDatasetGroupsResponse } from '@/api/asset_interfaces'; +import { useUpdatePermissionGroupDatasetGroups } from '@/api/buster_rest'; import { PermissionAssignedCell } from '@appComponents/PermissionComponents'; import { BusterInfiniteList, diff --git a/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx index 44d5ba830..e237f5be2 100644 --- a/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx +++ b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/datasets/PermissionGroupDatasetsListContainer.tsx @@ -1,9 +1,8 @@ -import { +import type { GetPermissionGroupDatasetsResponse, - GetPermissionGroupUsersResponse, - useUpdatePermissionGroupDatasets, - useUpdatePermissionGroupUsers -} from '@/api/buster_rest'; + GetPermissionGroupUsersResponse +} from '@/api/asset_interfaces'; +import { useUpdatePermissionGroupDatasets } from '@/api/buster_rest'; import { PermissionAssignedCell } from '@/app/app/_components/PermissionComponents'; import { BusterInfiniteList, diff --git a/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersListContainer.tsx b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersListContainer.tsx index 30bccf309..281140260 100644 --- a/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersListContainer.tsx +++ b/web/src/app/app/settings/(permissions)/permission-groups/[permissionGroupId]/users/PermissionGroupUsersListContainer.tsx @@ -1,4 +1,5 @@ -import { GetPermissionGroupUsersResponse, useUpdatePermissionGroupUsers } from '@/api/buster_rest'; +import type { GetPermissionGroupUsersResponse } from '@/api/asset_interfaces'; +import { useUpdatePermissionGroupUsers } from '@/api/buster_rest'; import { PermissionAssignedCell } from '@/app/app/_components/PermissionComponents'; import { BusterInfiniteList, diff --git a/web/src/context/Permissions/PermissionsConfigProvider.tsx b/web/src/context/Permissions/PermissionsConfigProvider.tsx index a070ad77a..0772eaf85 100644 --- a/web/src/context/Permissions/PermissionsConfigProvider.tsx +++ b/web/src/context/Permissions/PermissionsConfigProvider.tsx @@ -1,11 +1,11 @@ import { useMemoizedFn } from 'ahooks'; import React, { useEffect, useRef, useState } from 'react'; import { useBusterWebSocket } from '../BusterWebSocket'; -import { +import type { BusterPermissionGroup, BusterPermissionTeam, BusterPermissionUser -} from '@/api/buster_rest/permissions'; +} from '@/api/asset_interfaces'; import { PermissionGroupUpdateRequest, PermissionTeamUpdateRequest, diff --git a/web/src/context/Permissions/usePermissionsGroups.tsx b/web/src/context/Permissions/usePermissionsGroups.tsx index 48ef53a4b..561f2701d 100644 --- a/web/src/context/Permissions/usePermissionsGroups.tsx +++ b/web/src/context/Permissions/usePermissionsGroups.tsx @@ -1,4 +1,4 @@ -import { BusterPermissionListGroup } from '@/api/buster_rest/permissions'; +import type { BusterPermissionListGroup } from '@/api/asset_interfaces'; import React, { useEffect, useMemo, useState } from 'react'; import { useBusterWebSocket } from '../BusterWebSocket'; import { useMemoizedFn } from 'ahooks'; diff --git a/web/src/context/Permissions/usePermissionsTeams.tsx b/web/src/context/Permissions/usePermissionsTeams.tsx index aef6971af..4d84075bd 100644 --- a/web/src/context/Permissions/usePermissionsTeams.tsx +++ b/web/src/context/Permissions/usePermissionsTeams.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useMemo, useState } from 'react'; import { useBusterWebSocket } from '../BusterWebSocket'; -import { BusterPermissionListTeam } from '@/api/buster_rest/permissions'; +import type { BusterPermissionListTeam } from '@/api/asset_interfaces'; import { useMemoizedFn } from 'ahooks'; import { PermissionListTeamRequest } from '@/api/buster_socket/permissions'; import { useBusterNotifications } from '../BusterNotifications'; diff --git a/web/src/context/Permissions/usePermissionsUsers.tsx b/web/src/context/Permissions/usePermissionsUsers.tsx index 673da5d1d..d22f9d5aa 100644 --- a/web/src/context/Permissions/usePermissionsUsers.tsx +++ b/web/src/context/Permissions/usePermissionsUsers.tsx @@ -1,5 +1,5 @@ import { PermissionsListUsersRequest } from '@/api/buster_socket/permissions'; -import { BusterPermissionListUser } from '@/api/buster_rest/permissions'; +import type { BusterPermissionListUser } from '@/api/asset_interfaces'; import { useMemoizedFn } from 'ahooks'; import React, { useEffect, useMemo } from 'react'; import { useBusterWebSocket } from '../BusterWebSocket'; diff --git a/web/src/context/SQL/useSQLProvider.tsx b/web/src/context/SQL/useSQLProvider.tsx index df226100f..013060398 100644 --- a/web/src/context/SQL/useSQLProvider.tsx +++ b/web/src/context/SQL/useSQLProvider.tsx @@ -12,7 +12,7 @@ import { useBusterMessageDataContextSelector } from '../MetricData'; import { useBusterNotifications } from '../BusterNotifications'; import { didColumnDataChange, simplifyChratConfigForSQLChange } from './helpers'; import { timeout } from '@/utils'; -import { RunSQLResponse } from '@/api/buster_rest/sql/responseInterfaces'; +import type { RunSQLResponse } from '@/api/asset_interfaces'; import { MetricUpdateMessage } from '@/api/buster_socket/metrics'; export const useSQLProvider = () => {