move requests to the request folder

This commit is contained in:
Nate Kelley 2025-02-17 20:35:47 -07:00
parent 5fbcfd87c4
commit b6e9268cf0
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
17 changed files with 455 additions and 329 deletions

View File

@ -1,4 +1,14 @@
import { GetChatParams, GetChatListParams } from '../../request_interfaces/chats';
import type {
GetChatParams,
GetChatListParams,
CreateNewChatParams,
StopChatParams,
UnsubscribeFromChatParams,
DeleteChatParams,
UpdateChatParams,
ChatsSearchParams,
DuplicateChatParams
} from '../../request_interfaces/chats';
import type { BusterSocketRequestBase } from '../base_interfaces';
/**
@ -6,40 +16,14 @@ import type { BusterSocketRequestBase } from '../base_interfaces';
* @interface ChatCreateNewChat
* @extends BusterSocketRequestBase
*/
export type ChatCreateNewChat = BusterSocketRequestBase<
'/chats/post',
{
/** The ID of the dataset to associate with the chat. Null if no dataset is associated */
dataset_id?: string | null;
/** The initial message or prompt to start the chat conversation */
prompt: string;
/** Optional ID of an existing chat for follow-up messages. Null for new chats */
chat_id?: string | null;
/** Optional ID of a clicked suggestion. If provided, returns that specific chat */
suggestion_id?: string | null;
/** Optional ID of a message to replace in an existing chat */
message_id?: string;
/** Optional ID of a metric to initialize the chat from */
metric_id?: string;
/** Optional ID of a dashboard to initialize the chat from */
dashboard_id?: string;
}
>;
export type ChatCreateNewChat = BusterSocketRequestBase<'/chats/post', CreateNewChatParams>;
/**
* Request type for stopping an active chat or message generation.
* @interface ChatStopChat
* @extends BusterSocketRequestBase
*/
export type ChatStopChat = BusterSocketRequestBase<
'/chats/stop',
{
/** The unique identifier of the chat to stop */
id: string;
/** The ID of the specific message to stop generating */
message_id: string;
}
>;
export type ChatStopChat = BusterSocketRequestBase<'/chats/stop', StopChatParams>;
/**
* Request type for retrieving a specific chat by its ID.
@ -55,10 +39,7 @@ export type ChatGetChat = BusterSocketRequestBase<'/chats/get', GetChatParams>;
*/
export type ChatUnsubscribeFromChat = BusterSocketRequestBase<
'/chats/unsubscribe',
{
/** The unique identifier of the chat to unsubscribe from */
id: string;
}
UnsubscribeFromChatParams
>;
/**
@ -73,60 +54,28 @@ export type ChatListEmitPayload = BusterSocketRequestBase<'/chats/list', GetChat
* @interface ChatDeleteChat
* @extends BusterSocketRequestBase
*/
export type ChatDeleteChat = BusterSocketRequestBase<
'/chats/delete',
{
/** The unique identifier of the chat to delete */
id: string;
}[]
>;
export type ChatDeleteChat = BusterSocketRequestBase<'/chats/delete', DeleteChatParams[]>;
/**
* Request type for updating chat properties.
* @interface ChatUpdateChat
* @extends BusterSocketRequestBase
*/
export type ChatUpdateChat = BusterSocketRequestBase<
'/chats/update',
{
/** The unique identifier of the chat to update */
id: string;
/** Optional new title to set for the chat */
title?: string;
/** Optional flag to set the chat's favorite status */
is_favorited?: boolean;
}
>;
export type ChatUpdateChat = BusterSocketRequestBase<'/chats/update', UpdateChatParams>;
/**
* Request type for searching through chats using a text prompt.
* @interface ChatsSearch
* @extends BusterSocketRequestBase
*/
export type ChatsSearch = BusterSocketRequestBase<
'/chats/search',
{
/** The search query string to match against chats */
prompt: string;
}
>;
export type ChatsSearch = BusterSocketRequestBase<'/chats/search', ChatsSearchParams>;
/**
* Request type for duplicating an existing chat.
* @interface ChatsDuplicateChat
* @extends BusterSocketRequestBase
*/
export type ChatsDuplicateChat = BusterSocketRequestBase<
'/chats/duplicate',
{
/** The unique identifier of the source chat to duplicate */
id: string;
/** The message ID to start the duplication from */
message_id: string;
/** The target chat ID to duplicate content to */
chat_id: string;
}
>;
export type ChatsDuplicateChat = BusterSocketRequestBase<'/chats/duplicate', DuplicateChatParams>;
/**
* Union type of all possible chat-related request types.

View File

@ -1,10 +1,12 @@
import { ShareAssetType } from '../../asset_interfaces';
import { BusterSocketRequestBase } from '../base_interfaces';
import { ShareRequest } from '../shared_interfaces';
import type { ShareRequest } from '../shared_interfaces';
import type {
GetCollectionListParams,
GetCollectionParams
} from '../../request_interfaces/collections';
GetCollectionParams,
CreateCollectionParams,
UpdateCollectionParams,
DeleteCollectionParams
} from '../../request_interfaces/collections/interfaces';
/**
* WebSocket request for listing collections with pagination support.
@ -27,12 +29,7 @@ export type CollectionGetIndividual = BusterSocketRequestBase<
*/
export type CollectionCreateNewCollection = BusterSocketRequestBase<
'/collections/post',
{
/** Name of the new collection */
name: string;
/** Description detailing the purpose or contents of the collection */
description: string;
}
CreateCollectionParams
>;
/**
@ -40,19 +37,7 @@ export type CollectionCreateNewCollection = BusterSocketRequestBase<
*/
export type CollectionUpdateCollection = BusterSocketRequestBase<
'/collections/update',
{
/** Unique identifier of the collection to update */
id: string;
/** Optional new name for the collection */
name?: string;
/** Optional array of assets to be associated with the collection */
assets?: {
/** Type of the asset being added */
type: ShareAssetType;
/** Unique identifier of the asset */
id: string;
}[];
} & ShareRequest
UpdateCollectionParams & ShareRequest
>;
/**
@ -60,10 +45,7 @@ export type CollectionUpdateCollection = BusterSocketRequestBase<
*/
export type CollectionDeleteCollection = BusterSocketRequestBase<
'/collections/delete',
{
/** Array of collection IDs to be deleted */
ids: string[];
}
DeleteCollectionParams
>;
/**

View File

@ -1,4 +1,4 @@
import { BusterCollection, BusterCollectionListItem } from '@/api/asset_interfaces';
import type { BusterCollection, BusterCollectionListItem } from '@/api/asset_interfaces';
export enum CollectionResponses {
'/collections/list:listCollections' = '/collections/list:listCollections',

View File

@ -1,55 +1,44 @@
import type { ShareRole, DashboardConfig, VerificationStatus } from '@/api/asset_interfaces';
import type { BusterSocketRequestBase } from '../base_interfaces';
import { ShareRequest } from '../shared_interfaces';
import type {
DashboardsListRequest,
DashboardSubscribeRequest,
DashboardUnsubscribeRequest,
DashboardCreateRequest,
DashboardUpdateRequest,
DashboardDeleteRequest
} from '@/api/request_interfaces/dashboards/interfaces';
/**
* Payload type for requesting a list of dashboards
*
* @interface DashboardsListEmitPayload
* @extends BusterSocketRequestBase<'/dashboards/list', Object>
* @extends BusterSocketRequestBase<'/dashboards/list', DashboardsListRequest>
*/
export type DashboardsListEmitPayload = BusterSocketRequestBase<
'/dashboards/list',
{
/** The page number to fetch */
page_token: number;
/** Number of items per page */
page_size: number;
/** Filter for dashboards shared with the current user */
shared_with_me?: boolean;
/** Filter for dashboards owned by the current user */
only_my_dashboards?: boolean;
}
DashboardsListRequest
>;
/**
* Payload type for subscribing to a dashboard
*
* @interface DashboardSubscribeToDashboard
* @extends BusterSocketRequestBase<'/dashboards/get', Object>
* @extends BusterSocketRequestBase<'/dashboards/get', DashboardSubscribeRequest>
*/
export type DashboardSubscribeToDashboard = BusterSocketRequestBase<
'/dashboards/get',
{
/** The unique identifier of the dashboard */
id: string;
/** Optional password for accessing protected dashboards */
password?: string;
}
DashboardSubscribeRequest
>;
/**
* Payload type for unsubscribing from a specific dashboard
*
* @interface DashboardUnsubscribeFromDashboard
* @extends BusterSocketRequestBase<'/dashboards/unsubscribe', Object>
* @extends BusterSocketRequestBase<'/dashboards/unsubscribe', DashboardUnsubscribeRequest>
*/
export type DashboardUnsubscribeFromDashboard = BusterSocketRequestBase<
'/dashboards/unsubscribe',
{
/** The unique identifier of the dashboard to unsubscribe from */
id: string;
}
DashboardUnsubscribeRequest
>;
/**
@ -64,61 +53,25 @@ export type DashboardUnsubscribeFromAll = BusterSocketRequestBase<'/dashboards/u
* Payload type for creating a new dashboard
*
* @interface DashboardCreate
* @extends BusterSocketRequestBase<'/dashboards/post', Object>
* @extends BusterSocketRequestBase<'/dashboards/post', DashboardCreateRequest>
*/
export type DashboardCreate = BusterSocketRequestBase<
'/dashboards/post',
{
/** The name of the dashboard */
name: string;
/** Optional description of the dashboard */
description?: string | null;
}
>;
export type DashboardCreate = BusterSocketRequestBase<'/dashboards/post', DashboardCreateRequest>;
/**
* Payload type for updating a dashboard
*
* @interface DashboardUpdate
* @extends BusterSocketRequestBase<'/dashboards/update', Object>
* @extends BusterSocketRequestBase<'/dashboards/update', DashboardUpdateRequest>
*/
export type DashboardUpdate = BusterSocketRequestBase<
'/dashboards/update',
{
/** The unique identifier of the dashboard */
id: string;
/** New name for the dashboard */
name?: string;
/** New description for the dashboard */
description?: string | null;
/** Updated dashboard configuration */
config?: DashboardConfig;
/** Updated verification status */
status?: VerificationStatus;
/** Collection IDs to add the dashboard to */
add_to_collections?: string[];
/** Collection IDs to remove the dashboard from */
remove_from_collections?: string[];
/** User IDs to remove access from */
remove_users?: string[];
/** Array of metric IDs associated with the dashboard */
metrics?: string[];
} & ShareRequest
>;
export type DashboardUpdate = BusterSocketRequestBase<'/dashboards/update', DashboardUpdateRequest>;
/**
* Payload type for deleting dashboards
*
* @interface DashboardDelete
* @extends BusterSocketRequestBase<'/dashboards/delete', Object>
* @extends BusterSocketRequestBase<'/dashboards/delete', DashboardDeleteRequest>
*/
export type DashboardDelete = BusterSocketRequestBase<
'/dashboards/delete',
{
/** Array of dashboard IDs to delete */
ids: string[];
}
>;
export type DashboardDelete = BusterSocketRequestBase<'/dashboards/delete', DashboardDeleteRequest>;
/**
* Union type of all possible dashboard-related socket emit payloads

View File

@ -1,106 +1,47 @@
import { BusterSocketRequestBase } from '../base_interfaces';
import type { BusterSocketRequestBase } from '../base_interfaces';
import type {
DatasetListPayload,
DatasetGetPayload,
DatasetPostPayload,
DatasetDeletePayload,
DatasetUpdatePayload,
DatasetUpdateColumnPayload
} from '../../request_interfaces/datasets/interfaces';
/**
* Request payload for listing datasets with pagination and filtering options.
* @interface DatasetListEmitPayload
* @extends {BusterSocketRequestBase<'/datasets/list', ListPayload>}
*/
export type DatasetListEmitPayload = BusterSocketRequestBase<
'/datasets/list',
{
/** Current page number */
page: number;
/** Number of items per page */
page_size: number;
/** Whether to view in admin mode - if true it will show all datasets assosciated with the organization*/
admin_view: boolean;
/** Filter by enabled status */
enabled?: boolean;
/** Filter by import status */
imported?: boolean;
/** Filter by permission group ID */
permission_group_id?: string;
/** Filter by ownership of the current user */
belongs_to?: boolean | null;
}
>;
export type DatasetListEmitPayload = BusterSocketRequestBase<'/datasets/list', DatasetListPayload>;
/**
* Request payload for retrieving a specific dataset by ID.
* @interface DatasetGetEmit
* @extends {BusterSocketRequestBase<'/datasets/get', GetPayload>}
*/
export type DatasetGetEmit = BusterSocketRequestBase<
'/datasets/get',
{
/** Unique identifier of the dataset */
id: string;
}
>;
export type DatasetGetEmit = BusterSocketRequestBase<'/datasets/get', DatasetGetPayload>;
/**
* Request payload for creating a new dataset.
* @interface DatasetPostEmit
* @extends {BusterSocketRequestBase<'/datasets/post', PostPayload>}
*/
export type DatasetPostEmit = BusterSocketRequestBase<
'/datasets/post',
{
/** Optional name for the dataset */
name?: string;
/** ID of the data source to associate with the dataset */
data_source_id: string;
/** Optional dataset identifier */
dataset_id?: string;
}
>;
export type DatasetPostEmit = BusterSocketRequestBase<'/datasets/post', DatasetPostPayload>;
/**
* Request payload for deleting multiple datasets.
* @interface DatasetDeleteEmit
* @extends {BusterSocketRequestBase<'/datasets/delete', DeletePayload>}
*/
export type DatasetDeleteEmit = BusterSocketRequestBase<
'/datasets/delete',
{
/** Array of dataset IDs to delete */
ids: string[];
}
>;
export type DatasetDeleteEmit = BusterSocketRequestBase<'/datasets/delete', DatasetDeletePayload>;
/**
* Request payload for updating a dataset's properties.
* @interface DatasetUpdateEmit
* @extends {BusterSocketRequestBase<'/datasets/update', UpdatePayload>}
*/
export type DatasetUpdateEmit = BusterSocketRequestBase<
'/datasets/update',
{
/** Unique identifier of the dataset to update */
id: string;
/** Whether the dataset is enabled */
enabled?: boolean;
/** Usage guidelines for when to use this dataset */
when_to_use?: string;
/** Usage guidelines for when not to use this dataset */
when_not_to_use?: string;
/** Updated name for the dataset */
name?: string;
/** Dataset definition configuration */
dataset_definition?: {
/** SQL query for the dataset */
sql: string;
/** Database schema name */
schema: string;
/** Dataset identifier */
identifier: string;
/** Type of the dataset view */
type: 'view' | 'materializedView';
};
/** Updated data source ID */
data_source_id?: string;
}
>;
export type DatasetUpdateEmit = BusterSocketRequestBase<'/datasets/update', DatasetUpdatePayload>;
/**
* Request payload for updating a dataset column's properties.
@ -109,14 +50,7 @@ export type DatasetUpdateEmit = BusterSocketRequestBase<
*/
export type DatasetUpdateColumnEmit = BusterSocketRequestBase<
'/datasets/column/update',
{
/** Unique identifier of the column to update */
id: string;
/** Updated description for the column */
description?: string;
/** Whether to store values for this column */
stored_values?: boolean;
}
DatasetUpdateColumnPayload
>;
/**

View File

@ -1,5 +1,11 @@
import type { BusterSocketRequestBase } from '../base_interfaces';
import type { DatasourceCreateCredentials } from './interface';
import type {
DatasourceListParams,
DatasourceGetParams,
DatasourceDeleteParams,
DatasourcePostParams,
DatasourceUpdateParams
} from '../../request_interfaces/datasources/interfaces';
/**
* Request type for listing data sources with pagination.
@ -7,12 +13,7 @@ import type { DatasourceCreateCredentials } from './interface';
*/
export type DatasourceListRequest = BusterSocketRequestBase<
'/data_sources/list',
{
/** The page number for pagination */
page: number;
/** Number of items per page */
page_size: number;
}
DatasourceListParams
>;
/**
@ -21,10 +22,7 @@ export type DatasourceListRequest = BusterSocketRequestBase<
*/
export type DatasourceGetRequest = BusterSocketRequestBase<
'/data_sources/get',
{
/** Unique identifier of the data source */
id: string;
}
DatasourceGetParams
>;
/**
@ -33,10 +31,7 @@ export type DatasourceGetRequest = BusterSocketRequestBase<
*/
export type DatasourceDeleteRequest = BusterSocketRequestBase<
'/data_sources/delete',
{
/** Unique identifier of the data source to delete */
id: string;
}
DatasourceDeleteParams
>;
/**
@ -45,14 +40,7 @@ export type DatasourceDeleteRequest = BusterSocketRequestBase<
*/
export type DatasourcePostRequest = BusterSocketRequestBase<
'/data_sources/post',
{
/** Name of the data source */
name: string;
/** Type of the data source */
type: string;
/** Authentication credentials for the data source */
credentials: DatasourceCreateCredentials;
}
DatasourcePostParams
>;
/**
@ -61,16 +49,7 @@ export type DatasourcePostRequest = BusterSocketRequestBase<
*/
export type DatasourceUpdateRequest = BusterSocketRequestBase<
'/data_sources/update',
{
/** Unique identifier of the data source to update */
id: string;
/** Optional new name for the data source */
name?: string;
/** Optional new type for the data source */
type?: string;
/** Updated authentication credentials */
credentials: DatasourceCreateCredentials;
}
DatasourceUpdateParams
>;
/** Union type of all possible data source request types */

View File

@ -1,4 +1,5 @@
import type { BusterSocketRequestBase } from '../base_interfaces';
import type { SearchParams } from '../../request_interfaces/search/interfaces';
/**
* Represents a search request in the Buster system.
@ -30,21 +31,7 @@ import type { BusterSocketRequestBase } from '../base_interfaces';
* };
* ```
*/
export type BusterSearchRequest = BusterSocketRequestBase<
'/search',
{
query: string;
num_results?: null | number;
exclude_metrics?: null | boolean;
exclude_collections?: null | boolean;
exclude_dashboards?: null | boolean;
exclude_data_sources?: null | boolean;
exclude_datasets?: null | boolean;
exclude_permission_groups?: null | boolean;
exclude_teams?: null | boolean;
exclude_terms?: null | boolean;
}
>;
export type BusterSearchRequest = BusterSocketRequestBase<'/search', SearchParams>;
/**
* Type alias for BusterSearchRequest, representing the emitted search events

View File

@ -1,11 +1,6 @@
import { BusterSocketRequestBase } from '../base_interfaces';
import { SQLRunRequestParams } from '../../request_interfaces/sql/interfaces';
export type SQLRunEmit = BusterSocketRequestBase<
'/sql/run',
{
data_source_id: string;
sql: string;
}
>;
export type SQLRunEmit = BusterSocketRequestBase<'/sql/run', SQLRunRequestParams>;
export type SQLEmits = SQLRunEmit;

View File

@ -1,64 +1,51 @@
import type { ShareAssetType } from '@/api/asset_interfaces';
import type { BusterSocketRequestBase } from '../base_interfaces';
import type {
UserColorsCreatePayload,
UserColorsUpdatePayload,
UserColorsDeletePayload,
UsersFavoritePostPayload,
UserFavoriteDeletePayload,
UserUpdateFavoritesPayload,
UserRequestUserListPayload
} from '@/api/request_interfaces/user/interfaces';
export type UserColorsList = BusterSocketRequestBase<'/users/colors/list', {}>;
export type UserColorsCreate = BusterSocketRequestBase<
'/users/colors/post',
{
color_palette: string[];
}
UserColorsCreatePayload
>;
export type UserColorsUpdate = BusterSocketRequestBase<
'/users/colors/update',
{
id: string;
color_palette: string[];
}
UserColorsUpdatePayload
>;
export type UserColorsDelete = BusterSocketRequestBase<
'/users/colors/delete',
{
id: string;
}
UserColorsDeletePayload
>;
export type UsersFavoritePost = BusterSocketRequestBase<
'/users/favorites/post',
{
id: string;
asset_type: ShareAssetType;
index?: number;
name: string;
}
UsersFavoritePostPayload
>;
export type UsersFavoriteList = BusterSocketRequestBase<'/users/favorites/list', {}>;
export type UserFavoriteDelete = BusterSocketRequestBase<
'/users/favorites/delete',
{
id: string;
asset_type: ShareAssetType;
}
UserFavoriteDeletePayload
>;
export type UserUpdateFavorites = BusterSocketRequestBase<
'/users/favorites/update',
{
favorites: string[]; // Array of favorite ids
}
UserUpdateFavoritesPayload
>;
export type UserRequestUserList = BusterSocketRequestBase<
'/users/list',
{
team_id: string;
page?: number;
page_size?: number;
}
UserRequestUserListPayload
>;
export type UserEmits =

View File

@ -11,3 +11,60 @@ export interface GetChatParams {
/** The unique identifier of the chat to retrieve */
id: string;
}
export interface CreateNewChatParams {
/** The ID of the dataset to associate with the chat. Null if no dataset is associated */
dataset_id?: string | null;
/** The initial message or prompt to start the chat conversation */
prompt: string;
/** Optional ID of an existing chat for follow-up messages. Null for new chats */
chat_id?: string | null;
/** Optional ID of a clicked suggestion. If provided, returns that specific chat */
suggestion_id?: string | null;
/** Optional ID of a message to replace in an existing chat */
message_id?: string;
/** Optional ID of a metric to initialize the chat from */
metric_id?: string;
/** Optional ID of a dashboard to initialize the chat from */
dashboard_id?: string;
}
export interface StopChatParams {
/** The unique identifier of the chat to stop */
id: string;
/** The ID of the specific message to stop generating */
message_id: string;
}
export interface UnsubscribeFromChatParams {
/** The unique identifier of the chat to unsubscribe from */
id: string;
}
export interface DeleteChatParams {
/** The unique identifier of the chat to delete */
id: string;
}
export interface UpdateChatParams {
/** The unique identifier of the chat to update */
id: string;
/** Optional new title to set for the chat */
title?: string;
/** Optional flag to set the chat's favorite status */
is_favorited?: boolean;
}
export interface ChatsSearchParams {
/** The search query string to match against chats */
prompt: string;
}
export interface DuplicateChatParams {
/** The unique identifier of the source chat to duplicate */
id: string;
/** The message ID to start the duplication from */
message_id: string;
/** The target chat ID to duplicate content to */
chat_id: string;
}

View File

@ -1,3 +1,5 @@
import { ShareAssetType } from '../../asset_interfaces';
export interface GetCollectionListParams {
/** Current page number (1-based indexing) */
page: number;
@ -13,3 +15,32 @@ export interface GetCollectionParams {
/** Unique identifier of the collection to retrieve */
id: string;
}
export interface CreateCollectionParams {
/** Name of the new collection */
name: string;
/** Description detailing the purpose or contents of the collection */
description: string;
}
export interface UpdateCollectionParams {
/** Unique identifier of the collection to update */
id: string;
/** Optional new name for the collection */
name?: string;
/** Optional array of assets to be associated with the collection */
assets?: {
/** Type of the asset being added */
type: ShareAssetType;
/** Unique identifier of the asset */
id: string;
}[];
/** Share request parameters */
share_with?: string[];
share_type?: string;
}
export interface DeleteCollectionParams {
/** Array of collection IDs to be deleted */
ids: string[];
}

View File

@ -0,0 +1,76 @@
import type { DashboardConfig, VerificationStatus } from '@/api/asset_interfaces';
import type { ShareRequest } from '@/api/buster_socket/shared_interfaces';
/**
* Interface for dashboard list request parameters
*/
export interface DashboardsListRequest {
/** The page number to fetch */
page_token: number;
/** Number of items per page */
page_size: number;
/** Filter for dashboards shared with the current user */
shared_with_me?: boolean;
/** Filter for dashboards owned by the current user */
only_my_dashboards?: boolean;
}
/**
* Interface for subscribing to a dashboard
*/
export interface DashboardSubscribeRequest {
/** The unique identifier of the dashboard */
id: string;
/** Optional password for accessing protected dashboards */
password?: string;
}
/**
* Interface for unsubscribing from a specific dashboard
*/
export interface DashboardUnsubscribeRequest {
/** The unique identifier of the dashboard to unsubscribe from */
id: string;
}
/**
* Interface for creating a new dashboard
*/
export interface DashboardCreateRequest {
/** The name of the dashboard */
name: string;
/** Optional description of the dashboard */
description?: string | null;
}
/**
* Interface for updating a dashboard
*/
export interface DashboardUpdateRequest extends ShareRequest {
/** The unique identifier of the dashboard */
id: string;
/** New name for the dashboard */
name?: string;
/** New description for the dashboard */
description?: string | null;
/** Updated dashboard configuration */
config?: DashboardConfig;
/** Updated verification status */
status?: VerificationStatus;
/** Collection IDs to add the dashboard to */
add_to_collections?: string[];
/** Collection IDs to remove the dashboard from */
remove_from_collections?: string[];
/** User IDs to remove access from */
remove_users?: string[];
/** Array of metric IDs associated with the dashboard */
metrics?: string[];
}
/**
* Interface for deleting dashboards
*/
export interface DashboardDeleteRequest {
/** Array of dashboard IDs to delete */
ids: string[];
}

View File

@ -0,0 +1,88 @@
/**
* Interface for dataset list request payload
*/
export interface DatasetListPayload {
/** Current page number */
page: number;
/** Number of items per page */
page_size: number;
/** Whether to view in admin mode - if true it will show all datasets assosciated with the organization*/
admin_view: boolean;
/** Filter by enabled status */
enabled?: boolean;
/** Filter by import status */
imported?: boolean;
/** Filter by permission group ID */
permission_group_id?: string;
/** Filter by ownership of the current user */
belongs_to?: boolean | null;
}
/**
* Interface for getting a specific dataset
*/
export interface DatasetGetPayload {
/** Unique identifier of the dataset */
id: string;
}
/**
* Interface for creating a new dataset
*/
export interface DatasetPostPayload {
/** Optional name for the dataset */
name?: string;
/** ID of the data source to associate with the dataset */
data_source_id: string;
/** Optional dataset identifier */
dataset_id?: string;
}
/**
* Interface for deleting datasets
*/
export interface DatasetDeletePayload {
/** Array of dataset IDs to delete */
ids: string[];
}
/**
* Interface for updating a dataset
*/
export interface DatasetUpdatePayload {
/** Unique identifier of the dataset to update */
id: string;
/** Whether the dataset is enabled */
enabled?: boolean;
/** Usage guidelines for when to use this dataset */
when_to_use?: string;
/** Usage guidelines for when not to use this dataset */
when_not_to_use?: string;
/** Updated name for the dataset */
name?: string;
/** Dataset definition configuration */
dataset_definition?: {
/** SQL query for the dataset */
sql: string;
/** Database schema name */
schema: string;
/** Dataset identifier */
identifier: string;
/** Type of the dataset view */
type: 'view' | 'materializedView';
};
/** Updated data source ID */
data_source_id?: string;
}
/**
* Interface for updating a dataset column
*/
export interface DatasetUpdateColumnPayload {
/** Unique identifier of the column to update */
id: string;
/** Updated description for the column */
description?: string;
/** Whether to store values for this column */
stored_values?: boolean;
}

View File

@ -0,0 +1,38 @@
import type { DatasourceCreateCredentials } from '../../buster_socket/datasources/interface';
export interface DatasourceListParams {
/** The page number for pagination */
page: number;
/** Number of items per page */
page_size: number;
}
export interface DatasourceGetParams {
/** Unique identifier of the data source */
id: string;
}
export interface DatasourceDeleteParams {
/** Unique identifier of the data source to delete */
id: string;
}
export interface DatasourcePostParams {
/** Name of the data source */
name: string;
/** Type of the data source */
type: string;
/** Authentication credentials for the data source */
credentials: DatasourceCreateCredentials;
}
export interface DatasourceUpdateParams {
/** Unique identifier of the data source to update */
id: string;
/** Optional new name for the data source */
name?: string;
/** Optional new type for the data source */
type?: string;
/** Updated authentication credentials */
credentials: DatasourceCreateCredentials;
}

View File

@ -0,0 +1,27 @@
/**
* Search request parameters interface
* Defines the parameters for performing global searches across various entities.
*
* @param query - The search query string to filter results
* @param num_results - Maximum number of results to return. Defaults to 15 if not specified
* @param exclude_metrics - When true, excludes metrics from search results
* @param exclude_collections - When true, excludes collections from search results
* @param exclude_dashboards - When true, excludes dashboards from search results
* @param exclude_data_sources - When true, excludes data sources from search results
* @param exclude_datasets - When true, excludes datasets from search results
* @param exclude_permission_groups - When true, excludes permission groups from search results
* @param exclude_teams - When true, excludes teams from search results
* @param exclude_terms - When true, excludes terms from search results
*/
export interface SearchParams {
query: string;
num_results?: null | number;
exclude_metrics?: null | boolean;
exclude_collections?: null | boolean;
exclude_dashboards?: null | boolean;
exclude_data_sources?: null | boolean;
exclude_datasets?: null | boolean;
exclude_permission_groups?: null | boolean;
exclude_teams?: null | boolean;
exclude_terms?: null | boolean;
}

View File

@ -0,0 +1,7 @@
/**
* Interface for SQL run request parameters
*/
export interface SQLRunRequestParams {
data_source_id: string;
sql: string;
}

View File

@ -0,0 +1,36 @@
import type { ShareAssetType } from '@/api/asset_interfaces';
export interface UserColorsCreatePayload {
color_palette: string[];
}
export interface UserColorsUpdatePayload {
id: string;
color_palette: string[];
}
export interface UserColorsDeletePayload {
id: string;
}
export interface UsersFavoritePostPayload {
id: string;
asset_type: ShareAssetType;
index?: number;
name: string;
}
export interface UserFavoriteDeletePayload {
id: string;
asset_type: ShareAssetType;
}
export interface UserUpdateFavoritesPayload {
favorites: string[]; // Array of favorite ids
}
export interface UserRequestUserListPayload {
team_id: string;
page?: number;
page_size?: number;
}