scope down more types

This commit is contained in:
Nate Kelley 2025-09-17 16:42:47 -06:00
parent 4c8875b7c6
commit 6bcd9e7b9e
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 5 additions and 12 deletions

View File

@ -1,9 +1,10 @@
import type { AssetType } from '@buster/server-shared/assets';
import type { BusterSearchResult } from '@/api/asset_interfaces/search';
import { mainApi } from '../instances';
export const search = async (params: {
query: string;
asset_types: ('dashboard_file' | 'metric_file' | 'collection')[];
asset_types: Extract<AssetType, 'dashboard_file' | 'metric_file' | 'collection'>[];
num_results?: number;
}) => {
return mainApi.post<BusterSearchResult[]>('/search', params).then((res) => res.data);

View File

@ -1,4 +1,4 @@
import type { AssetType } from '@buster/database';
import type { AssetType } from '@buster/database/schema-types';
import { z } from 'zod';
// Internal types for asset permissions
@ -7,12 +7,7 @@ export const IdentityTypeSchema = z.enum(['user', 'team', 'organization']);
export type IdentityType = z.infer<typeof IdentityTypeSchema>;
// Types that support cascading permissions
export type CascadingAssetType =
| 'chat'
| 'metric_file'
| 'dashboard_file'
| 'report_file'
| 'collection';
export type CascadingAssetType = AssetType;
// Permission roles - matching database AssetPermissionRole enum
export const AssetPermissionRoleSchema = z.enum([

View File

@ -94,10 +94,7 @@ export function createDoneToolStart(context: DoneToolContext, doneToolState: Don
try {
await updateChat(context.chatId, {
mostRecentFileId: mostRecentFile.id,
mostRecentFileType: mostRecentFile.fileType as
| 'metric_file'
| 'dashboard_file'
| 'report_file',
mostRecentFileType: mostRecentFile.fileType,
mostRecentVersionNumber: mostRecentFile.versionNumber || 1,
});
} catch (error) {