3
packages/schemas/features/events/constants.ts
Normal file
3
packages/schemas/features/events/constants.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export enum EventType {
|
||||
START = 'start',
|
||||
}
|
1
packages/schemas/features/events/index.ts
Normal file
1
packages/schemas/features/events/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './start'
|
10
packages/schemas/features/events/shared.ts
Normal file
10
packages/schemas/features/events/shared.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const eventBaseSchema = z.object({
|
||||
id: z.string(),
|
||||
outgoingEdgeId: z.string().optional(),
|
||||
graphCoordinates: z.object({
|
||||
x: z.number(),
|
||||
y: z.number(),
|
||||
}),
|
||||
})
|
1
packages/schemas/features/events/start/index.ts
Normal file
1
packages/schemas/features/events/start/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './schema'
|
7
packages/schemas/features/events/start/schema.ts
Normal file
7
packages/schemas/features/events/start/schema.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
import { eventBaseSchema } from '../shared'
|
||||
import { EventType } from '../constants'
|
||||
|
||||
export const startEventSchema = eventBaseSchema.extend({
|
||||
type: z.literal(EventType.START),
|
||||
})
|
Reference in New Issue
Block a user