@tertium/prisma-codegen 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,72 @@
1
+ import type { DMMFField, DMMFModel, FilterMode } from '../dmmf/dmmf.types';
2
+
3
+ // ── Internal model types (used by server generators) ─────────────────────────
4
+
5
+ export type Field = {
6
+ name: string;
7
+ type: string;
8
+ required: boolean;
9
+ isId: boolean;
10
+ isRelation: boolean;
11
+ isArray: boolean;
12
+ };
13
+
14
+ export type Model = {
15
+ name: string;
16
+ dbName?: string;
17
+ fields: Field[];
18
+ };
19
+
20
+ export type ForeignKeyField = {
21
+ fieldName: string;
22
+ relationName: string;
23
+ isRequired: boolean;
24
+ };
25
+
26
+ export type EntityMetadata = {
27
+ filterable?: Record<string, FilterMode>;
28
+ searchableFields?: string[];
29
+ includeRelations?: string[];
30
+ orderBy?: string;
31
+ };
32
+
33
+ // ── Generator option/config types ─────────────────────────────────────────────
34
+
35
+ export type MetadataInferrerOptions = {
36
+ skipFilterableFields?: string[];
37
+ searchableFieldPatterns?: RegExp[];
38
+ enumLikeIntPatterns?: RegExp[];
39
+ };
40
+
41
+ export type TypesGeneratorOptions = {
42
+ skipInputFields?: string[];
43
+ };
44
+
45
+ export type LocalizationConfig = {
46
+ localizeImport: string;
47
+ localizeExport?: string;
48
+ };
49
+
50
+ export type GraphQLResolverConfig = {
51
+ prismaClientPath: string;
52
+ prismaClientExport?: string;
53
+ contextTypePath: string;
54
+ contextTypeExport?: string;
55
+ localization?: LocalizationConfig;
56
+ };
57
+
58
+ export type RestHandlerConfig = {
59
+ prismaClientPath: string;
60
+ localization?: LocalizationConfig;
61
+ };
62
+
63
+ export type RestRouterConfig = {
64
+ entityImportBase: string;
65
+ extraImports?: string;
66
+ extraRoutes?: string;
67
+ extraHelpers?: string;
68
+ localization?: {
69
+ getLangImport: string;
70
+ getLangExport?: string;
71
+ };
72
+ };