mirror of https://github.com/buster-so/buster.git
Refactor chat types and remove unnecessary request schema
- Updated chat types to include AssetPermissionRoleSchema for better clarity. - Removed the ShareUpdateRequestSchema as it was deemed unnecessary.
This commit is contained in:
parent
f7feb4b3d1
commit
6c4fbe027f
|
@ -1,10 +1,9 @@
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { AssetTypeSchema } from '../assets/asset-types.types';
|
import { AssetTypeSchema } from '../assets/asset-types.types';
|
||||||
import { ShareIndividualSchema } from '../share';
|
import { AssetPermissionRoleSchema, ShareIndividualSchema } from '../share';
|
||||||
import { ChatMessageSchema } from './chat-message.types';
|
import { ChatMessageSchema } from './chat-message.types';
|
||||||
|
|
||||||
// Asset Permission Role enum (matching database enum)
|
// Asset Permission Role enum (matching database enum)
|
||||||
export const AssetPermissionRoleSchema = z.enum(['viewer', 'editor', 'owner']);
|
|
||||||
export const ChatAssetTypeSchema = AssetTypeSchema.exclude(['chat', 'collection']);
|
export const ChatAssetTypeSchema = AssetTypeSchema.exclude(['chat', 'collection']);
|
||||||
|
|
||||||
// Main ChatWithMessages schema
|
// Main ChatWithMessages schema
|
||||||
|
|
|
@ -53,21 +53,6 @@ export const BulkUpdateMetricVerificationStatusRequestSchema = z.array(
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
export const ShareUpdateRequestSchema = z.object({
|
|
||||||
users: z
|
|
||||||
.array(
|
|
||||||
z.object({
|
|
||||||
email: z.string(),
|
|
||||||
role: ShareRoleSchema,
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.optional(),
|
|
||||||
publicly_accessible: z.boolean().optional(),
|
|
||||||
public_password: z.string().nullable().optional(),
|
|
||||||
public_expiry_date: z.string().nullable().optional(),
|
|
||||||
workspace_sharing: WorkspaceShareRoleSchema.nullable().optional(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export type GetMetricDataRequest = z.infer<typeof GetMetricDataRequestSchema>;
|
export type GetMetricDataRequest = z.infer<typeof GetMetricDataRequestSchema>;
|
||||||
export type GetMetricRequest = z.infer<typeof GetMetricRequestSchema>;
|
export type GetMetricRequest = z.infer<typeof GetMetricRequestSchema>;
|
||||||
export type GetMetricListRequest = z.infer<typeof GetMetricListRequestSchema>;
|
export type GetMetricListRequest = z.infer<typeof GetMetricListRequestSchema>;
|
||||||
|
|
Loading…
Reference in New Issue