-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathPubs.ts
93 lines (71 loc) · 3.03 KB
/
Pubs.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import type { ColumnType, Insertable, Selectable, Updateable } from "kysely";
import { z } from "zod";
import type { CommunitiesId } from "./Communities";
import type { PubTypesId } from "./PubTypes";
import type { StagesId } from "./Stages";
import type { UsersId } from "./Users";
import { communitiesIdSchema } from "./Communities";
import { pubTypesIdSchema } from "./PubTypes";
import { stagesIdSchema } from "./Stages";
import { usersIdSchema } from "./Users";
// @generated
// This file is automatically generated by Kanel. Do not modify manually.
/** Identifier type for public.pubs */
export type PubsId = string & { __brand: "PubsId" };
/** Represents the table public.pubs */
export interface PubsTable {
id: ColumnType<PubsId, PubsId | undefined, PubsId>;
createdAt: ColumnType<Date, Date | string | undefined, Date | string>;
updatedAt: ColumnType<Date, Date | string | undefined, Date | string>;
pubTypeId: ColumnType<PubTypesId, PubTypesId, PubTypesId>;
communityId: ColumnType<CommunitiesId, CommunitiesId, CommunitiesId>;
valuesBlob: ColumnType<unknown | null, unknown | null, unknown | null>;
parentId: ColumnType<PubsId | null, PubsId | null, PubsId | null>;
assigneeId: ColumnType<UsersId | null, UsersId | null, UsersId | null>;
title: ColumnType<string | null, string | null, string | null>;
searchVector: ColumnType<string | null, string | null, string | null>;
stageId: ColumnType<StagesId | null, StagesId | null, StagesId | null>;
}
export type Pubs = Selectable<PubsTable>;
export type NewPubs = Insertable<PubsTable>;
export type PubsUpdate = Updateable<PubsTable>;
export const pubsIdSchema = z.string().uuid() as unknown as z.Schema<PubsId>;
export const pubsSchema = z.object({
id: pubsIdSchema,
createdAt: z.date(),
updatedAt: z.date(),
pubTypeId: pubTypesIdSchema,
communityId: communitiesIdSchema,
valuesBlob: z.unknown().nullable(),
parentId: pubsIdSchema.nullable(),
assigneeId: usersIdSchema.nullable(),
title: z.string().nullable(),
searchVector: z.string().nullable(),
stageId: stagesIdSchema.nullable(),
});
export const pubsInitializerSchema = z.object({
id: pubsIdSchema.optional(),
createdAt: z.date().optional(),
updatedAt: z.date().optional(),
pubTypeId: pubTypesIdSchema,
communityId: communitiesIdSchema,
valuesBlob: z.unknown().optional().nullable(),
parentId: pubsIdSchema.optional().nullable(),
assigneeId: usersIdSchema.optional().nullable(),
title: z.string().optional().nullable(),
searchVector: z.string().optional().nullable(),
stageId: stagesIdSchema.optional().nullable(),
});
export const pubsMutatorSchema = z.object({
id: pubsIdSchema.optional(),
createdAt: z.date().optional(),
updatedAt: z.date().optional(),
pubTypeId: pubTypesIdSchema.optional(),
communityId: communitiesIdSchema.optional(),
valuesBlob: z.unknown().optional().nullable(),
parentId: pubsIdSchema.optional().nullable(),
assigneeId: usersIdSchema.optional().nullable(),
title: z.string().optional().nullable(),
searchVector: z.string().optional().nullable(),
stageId: stagesIdSchema.optional().nullable(),
});