joist-codegen 2.2.0-next.52 → 2.2.0-next.54
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.
- package/build/EntityDbMetadata.d.ts +17 -0
- package/build/EntityDbMetadata.d.ts.map +1 -1
- package/build/EntityDbMetadata.js +31 -0
- package/build/EntityDbMetadata.js.map +1 -1
- package/build/config.d.ts +35 -538
- package/build/config.d.ts.map +1 -1
- package/build/config.js +7 -6
- package/build/config.js.map +1 -1
- package/build/generateEntityCodegenFile.d.ts +1 -1
- package/build/generateEntityCodegenFile.d.ts.map +1 -1
- package/build/generateEntityCodegenFile.js +32 -4
- package/build/generateEntityCodegenFile.js.map +1 -1
- package/build/generateMetadataFile.js +18 -0
- package/build/generateMetadataFile.js.map +1 -1
- package/build/inheritance.d.ts.map +1 -1
- package/build/inheritance.js +2 -0
- package/build/inheritance.js.map +1 -1
- package/build/logger.d.ts +2 -2
- package/build/logger.d.ts.map +1 -1
- package/build/symbols.d.ts +2 -0
- package/build/symbols.d.ts.map +1 -1
- package/build/symbols.js +5 -3
- package/build/symbols.js.map +1 -1
- package/build/write-json-schema.js +6 -4
- package/build/write-json-schema.js.map +1 -1
- package/package.json +11 -12
package/build/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DbMetadata, Entity, EntityDbMetadata } from "EntityDbMetadata";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
declare const fieldConfig: z.ZodObject<{
|
|
4
|
-
derived: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
4
|
+
derived: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
5
5
|
protected: z.ZodOptional<z.ZodBoolean>;
|
|
6
6
|
ignore: z.ZodOptional<z.ZodBoolean>;
|
|
7
7
|
superstruct: z.ZodOptional<z.ZodString>;
|
|
@@ -12,76 +12,25 @@ declare const fieldConfig: z.ZodObject<{
|
|
|
12
12
|
stiType: z.ZodOptional<z.ZodString>;
|
|
13
13
|
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
14
14
|
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
-
},
|
|
16
|
-
type?: string | undefined;
|
|
17
|
-
derived?: "sync" | "async" | undefined;
|
|
18
|
-
protected?: boolean | undefined;
|
|
19
|
-
ignore?: boolean | undefined;
|
|
20
|
-
superstruct?: string | undefined;
|
|
21
|
-
zodSchema?: string | undefined;
|
|
22
|
-
serde?: string | undefined;
|
|
23
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
24
|
-
stiType?: string | undefined;
|
|
25
|
-
notNull?: boolean | undefined;
|
|
26
|
-
hasDefault?: boolean | undefined;
|
|
27
|
-
}, {
|
|
28
|
-
type?: string | undefined;
|
|
29
|
-
derived?: "sync" | "async" | undefined;
|
|
30
|
-
protected?: boolean | undefined;
|
|
31
|
-
ignore?: boolean | undefined;
|
|
32
|
-
superstruct?: string | undefined;
|
|
33
|
-
zodSchema?: string | undefined;
|
|
34
|
-
serde?: string | undefined;
|
|
35
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
36
|
-
stiType?: string | undefined;
|
|
37
|
-
notNull?: boolean | undefined;
|
|
38
|
-
hasDefault?: boolean | undefined;
|
|
39
|
-
}>;
|
|
15
|
+
}, z.core.$strict>;
|
|
40
16
|
export type FieldConfig = z.infer<typeof fieldConfig>;
|
|
41
17
|
declare const relationConfig: z.ZodObject<{
|
|
42
18
|
derived: z.ZodOptional<z.ZodLiteral<"async">>;
|
|
43
|
-
polymorphic: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
19
|
+
polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
44
20
|
large: z.ZodOptional<z.ZodBoolean>;
|
|
45
21
|
orderBy: z.ZodOptional<z.ZodString>;
|
|
46
22
|
stiType: z.ZodOptional<z.ZodString>;
|
|
47
|
-
/**
|
|
48
|
-
* Allow specializing a base type relation (SmallPublisher.group: SmallPublisherGroup).
|
|
49
|
-
*
|
|
50
|
-
* Self-referential FKs also support `subType: "self"` that means each subtype will point
|
|
51
|
-
* at its own subtype.
|
|
52
|
-
*/
|
|
53
23
|
subType: z.ZodOptional<z.ZodString>;
|
|
54
|
-
/** Allow skipping self-referential fields getting a `...Recursive` relation. */
|
|
55
24
|
skipRecursiveRelations: z.ZodOptional<z.ZodBoolean>;
|
|
56
25
|
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
57
26
|
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
-
},
|
|
59
|
-
derived?: "async" | undefined;
|
|
60
|
-
stiType?: string | undefined;
|
|
61
|
-
notNull?: boolean | undefined;
|
|
62
|
-
hasDefault?: boolean | undefined;
|
|
63
|
-
polymorphic?: true | "notNull" | undefined;
|
|
64
|
-
large?: boolean | undefined;
|
|
65
|
-
orderBy?: string | undefined;
|
|
66
|
-
subType?: string | undefined;
|
|
67
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
68
|
-
}, {
|
|
69
|
-
derived?: "async" | undefined;
|
|
70
|
-
stiType?: string | undefined;
|
|
71
|
-
notNull?: boolean | undefined;
|
|
72
|
-
hasDefault?: boolean | undefined;
|
|
73
|
-
polymorphic?: true | "notNull" | undefined;
|
|
74
|
-
large?: boolean | undefined;
|
|
75
|
-
orderBy?: string | undefined;
|
|
76
|
-
subType?: string | undefined;
|
|
77
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
78
|
-
}>;
|
|
27
|
+
}, z.core.$strict>;
|
|
79
28
|
export type RelationConfig = z.infer<typeof relationConfig>;
|
|
80
29
|
declare const entityConfig: z.ZodObject<{
|
|
81
30
|
tag: z.ZodString;
|
|
82
31
|
tableName: z.ZodOptional<z.ZodString>;
|
|
83
32
|
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
84
|
-
derived: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
33
|
+
derived: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
85
34
|
protected: z.ZodOptional<z.ZodBoolean>;
|
|
86
35
|
ignore: z.ZodOptional<z.ZodBoolean>;
|
|
87
36
|
superstruct: z.ZodOptional<z.ZodString>;
|
|
@@ -92,258 +41,57 @@ declare const entityConfig: z.ZodObject<{
|
|
|
92
41
|
stiType: z.ZodOptional<z.ZodString>;
|
|
93
42
|
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
94
43
|
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
-
},
|
|
96
|
-
type?: string | undefined;
|
|
97
|
-
derived?: "sync" | "async" | undefined;
|
|
98
|
-
protected?: boolean | undefined;
|
|
99
|
-
ignore?: boolean | undefined;
|
|
100
|
-
superstruct?: string | undefined;
|
|
101
|
-
zodSchema?: string | undefined;
|
|
102
|
-
serde?: string | undefined;
|
|
103
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
104
|
-
stiType?: string | undefined;
|
|
105
|
-
notNull?: boolean | undefined;
|
|
106
|
-
hasDefault?: boolean | undefined;
|
|
107
|
-
}, {
|
|
108
|
-
type?: string | undefined;
|
|
109
|
-
derived?: "sync" | "async" | undefined;
|
|
110
|
-
protected?: boolean | undefined;
|
|
111
|
-
ignore?: boolean | undefined;
|
|
112
|
-
superstruct?: string | undefined;
|
|
113
|
-
zodSchema?: string | undefined;
|
|
114
|
-
serde?: string | undefined;
|
|
115
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
116
|
-
stiType?: string | undefined;
|
|
117
|
-
notNull?: boolean | undefined;
|
|
118
|
-
hasDefault?: boolean | undefined;
|
|
119
|
-
}>>>;
|
|
44
|
+
}, z.core.$strict>>>;
|
|
120
45
|
relations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
121
46
|
derived: z.ZodOptional<z.ZodLiteral<"async">>;
|
|
122
|
-
polymorphic: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
47
|
+
polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
123
48
|
large: z.ZodOptional<z.ZodBoolean>;
|
|
124
49
|
orderBy: z.ZodOptional<z.ZodString>;
|
|
125
50
|
stiType: z.ZodOptional<z.ZodString>;
|
|
126
|
-
/**
|
|
127
|
-
* Allow specializing a base type relation (SmallPublisher.group: SmallPublisherGroup).
|
|
128
|
-
*
|
|
129
|
-
* Self-referential FKs also support `subType: "self"` that means each subtype will point
|
|
130
|
-
* at its own subtype.
|
|
131
|
-
*/
|
|
132
51
|
subType: z.ZodOptional<z.ZodString>;
|
|
133
|
-
/** Allow skipping self-referential fields getting a `...Recursive` relation. */
|
|
134
52
|
skipRecursiveRelations: z.ZodOptional<z.ZodBoolean>;
|
|
135
53
|
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
136
54
|
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
-
},
|
|
138
|
-
derived?: "async" | undefined;
|
|
139
|
-
stiType?: string | undefined;
|
|
140
|
-
notNull?: boolean | undefined;
|
|
141
|
-
hasDefault?: boolean | undefined;
|
|
142
|
-
polymorphic?: true | "notNull" | undefined;
|
|
143
|
-
large?: boolean | undefined;
|
|
144
|
-
orderBy?: string | undefined;
|
|
145
|
-
subType?: string | undefined;
|
|
146
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
147
|
-
}, {
|
|
148
|
-
derived?: "async" | undefined;
|
|
149
|
-
stiType?: string | undefined;
|
|
150
|
-
notNull?: boolean | undefined;
|
|
151
|
-
hasDefault?: boolean | undefined;
|
|
152
|
-
polymorphic?: true | "notNull" | undefined;
|
|
153
|
-
large?: boolean | undefined;
|
|
154
|
-
orderBy?: string | undefined;
|
|
155
|
-
subType?: string | undefined;
|
|
156
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
157
|
-
}>>>;
|
|
158
|
-
/** Whether this entity should be abstract, e.g. for inheritance a subtype must be instantiated instead of this type. */
|
|
55
|
+
}, z.core.$strict>>>;
|
|
159
56
|
abstract: z.ZodOptional<z.ZodBoolean>;
|
|
160
57
|
orderBy: z.ZodOptional<z.ZodString>;
|
|
161
|
-
uniqueBy: z.ZodOptional<z.
|
|
162
|
-
},
|
|
163
|
-
tag: string;
|
|
164
|
-
tableName?: string | undefined;
|
|
165
|
-
fields?: Record<string, {
|
|
166
|
-
type?: string | undefined;
|
|
167
|
-
derived?: "sync" | "async" | undefined;
|
|
168
|
-
protected?: boolean | undefined;
|
|
169
|
-
ignore?: boolean | undefined;
|
|
170
|
-
superstruct?: string | undefined;
|
|
171
|
-
zodSchema?: string | undefined;
|
|
172
|
-
serde?: string | undefined;
|
|
173
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
174
|
-
stiType?: string | undefined;
|
|
175
|
-
notNull?: boolean | undefined;
|
|
176
|
-
hasDefault?: boolean | undefined;
|
|
177
|
-
}> | undefined;
|
|
178
|
-
relations?: Record<string, {
|
|
179
|
-
derived?: "async" | undefined;
|
|
180
|
-
stiType?: string | undefined;
|
|
181
|
-
notNull?: boolean | undefined;
|
|
182
|
-
hasDefault?: boolean | undefined;
|
|
183
|
-
polymorphic?: true | "notNull" | undefined;
|
|
184
|
-
large?: boolean | undefined;
|
|
185
|
-
orderBy?: string | undefined;
|
|
186
|
-
subType?: string | undefined;
|
|
187
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
188
|
-
}> | undefined;
|
|
189
|
-
orderBy?: string | undefined;
|
|
190
|
-
abstract?: boolean | undefined;
|
|
191
|
-
uniqueBy?: string[][] | undefined;
|
|
192
|
-
}, {
|
|
193
|
-
tag: string;
|
|
194
|
-
tableName?: string | undefined;
|
|
195
|
-
fields?: Record<string, {
|
|
196
|
-
type?: string | undefined;
|
|
197
|
-
derived?: "sync" | "async" | undefined;
|
|
198
|
-
protected?: boolean | undefined;
|
|
199
|
-
ignore?: boolean | undefined;
|
|
200
|
-
superstruct?: string | undefined;
|
|
201
|
-
zodSchema?: string | undefined;
|
|
202
|
-
serde?: string | undefined;
|
|
203
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
204
|
-
stiType?: string | undefined;
|
|
205
|
-
notNull?: boolean | undefined;
|
|
206
|
-
hasDefault?: boolean | undefined;
|
|
207
|
-
}> | undefined;
|
|
208
|
-
relations?: Record<string, {
|
|
209
|
-
derived?: "async" | undefined;
|
|
210
|
-
stiType?: string | undefined;
|
|
211
|
-
notNull?: boolean | undefined;
|
|
212
|
-
hasDefault?: boolean | undefined;
|
|
213
|
-
polymorphic?: true | "notNull" | undefined;
|
|
214
|
-
large?: boolean | undefined;
|
|
215
|
-
orderBy?: string | undefined;
|
|
216
|
-
subType?: string | undefined;
|
|
217
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
218
|
-
}> | undefined;
|
|
219
|
-
orderBy?: string | undefined;
|
|
220
|
-
abstract?: boolean | undefined;
|
|
221
|
-
uniqueBy?: string | string[] | string[][] | undefined;
|
|
222
|
-
}>;
|
|
58
|
+
uniqueBy: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodArray<z.ZodString>>]>, z.ZodTransform<string[][], string | string[] | string[][]>>>;
|
|
59
|
+
}, z.core.$strict>;
|
|
223
60
|
export type EntityConfig = z.infer<typeof entityConfig>;
|
|
224
61
|
declare const timestampConfig: z.ZodObject<{
|
|
225
|
-
|
|
226
|
-
names: z.ZodArray<z.ZodString, "many">;
|
|
227
|
-
/** Whether this timestamp column is required to consider a table an entity, defaults to `false`. */
|
|
62
|
+
names: z.ZodArray<z.ZodString>;
|
|
228
63
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
-
},
|
|
230
|
-
names: string[];
|
|
231
|
-
required?: boolean | undefined;
|
|
232
|
-
}, {
|
|
233
|
-
names: string[];
|
|
234
|
-
required?: boolean | undefined;
|
|
235
|
-
}>;
|
|
64
|
+
}, z.core.$strict>;
|
|
236
65
|
export type TimestampConfig = z.infer<typeof timestampConfig>;
|
|
237
66
|
export declare const config: z.ZodObject<{
|
|
238
|
-
/** The _build-time_ database URL for reading database metadata. */
|
|
239
67
|
databaseUrl: z.ZodOptional<z.ZodString>;
|
|
240
|
-
/** Your application's request-level `Context` type. */
|
|
241
68
|
contextType: z.ZodOptional<z.ZodString>;
|
|
242
|
-
/** Your application's database client's `Transaction` type. */
|
|
243
69
|
transactionType: z.ZodOptional<z.ZodString>;
|
|
244
|
-
/**
|
|
245
|
-
* Allows the user to specify the `updated_at` / `created_at` column names to look up, and if they're optional.
|
|
246
|
-
*
|
|
247
|
-
* We default to looking for `updated_at`, `updatedAt`, `created_at`, `createdAt`, and optional to true,
|
|
248
|
-
* e.g. tables are not required to have both timestamp columns to be considered entities.
|
|
249
|
-
*
|
|
250
|
-
* These defaults are the most lenient, to facilitate running Joist against an existing schema and
|
|
251
|
-
* seeing all of your entities, regardless of your previous conventions.
|
|
252
|
-
*/
|
|
253
70
|
timestampColumns: z.ZodOptional<z.ZodObject<{
|
|
254
71
|
createdAt: z.ZodOptional<z.ZodObject<{
|
|
255
|
-
|
|
256
|
-
names: z.ZodArray<z.ZodString, "many">;
|
|
257
|
-
/** Whether this timestamp column is required to consider a table an entity, defaults to `false`. */
|
|
72
|
+
names: z.ZodArray<z.ZodString>;
|
|
258
73
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
259
|
-
},
|
|
260
|
-
names: string[];
|
|
261
|
-
required?: boolean | undefined;
|
|
262
|
-
}, {
|
|
263
|
-
names: string[];
|
|
264
|
-
required?: boolean | undefined;
|
|
265
|
-
}>>;
|
|
74
|
+
}, z.core.$strict>>;
|
|
266
75
|
updatedAt: z.ZodOptional<z.ZodObject<{
|
|
267
|
-
|
|
268
|
-
names: z.ZodArray<z.ZodString, "many">;
|
|
269
|
-
/** Whether this timestamp column is required to consider a table an entity, defaults to `false`. */
|
|
76
|
+
names: z.ZodArray<z.ZodString>;
|
|
270
77
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
271
|
-
},
|
|
272
|
-
names: string[];
|
|
273
|
-
required?: boolean | undefined;
|
|
274
|
-
}, {
|
|
275
|
-
names: string[];
|
|
276
|
-
required?: boolean | undefined;
|
|
277
|
-
}>>;
|
|
78
|
+
}, z.core.$strict>>;
|
|
278
79
|
deletedAt: z.ZodOptional<z.ZodObject<{
|
|
279
|
-
|
|
280
|
-
names: z.ZodArray<z.ZodString, "many">;
|
|
281
|
-
/** Whether this timestamp column is required to consider a table an entity, defaults to `false`. */
|
|
80
|
+
names: z.ZodArray<z.ZodString>;
|
|
282
81
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
283
|
-
},
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}, {
|
|
287
|
-
names: string[];
|
|
288
|
-
required?: boolean | undefined;
|
|
289
|
-
}>>;
|
|
290
|
-
}, "strip", z.ZodTypeAny, {
|
|
291
|
-
createdAt?: {
|
|
292
|
-
names: string[];
|
|
293
|
-
required?: boolean | undefined;
|
|
294
|
-
} | undefined;
|
|
295
|
-
updatedAt?: {
|
|
296
|
-
names: string[];
|
|
297
|
-
required?: boolean | undefined;
|
|
298
|
-
} | undefined;
|
|
299
|
-
deletedAt?: {
|
|
300
|
-
names: string[];
|
|
301
|
-
required?: boolean | undefined;
|
|
302
|
-
} | undefined;
|
|
303
|
-
}, {
|
|
304
|
-
createdAt?: {
|
|
305
|
-
names: string[];
|
|
306
|
-
required?: boolean | undefined;
|
|
307
|
-
} | undefined;
|
|
308
|
-
updatedAt?: {
|
|
309
|
-
names: string[];
|
|
310
|
-
required?: boolean | undefined;
|
|
311
|
-
} | undefined;
|
|
312
|
-
deletedAt?: {
|
|
313
|
-
names: string[];
|
|
314
|
-
required?: boolean | undefined;
|
|
315
|
-
} | undefined;
|
|
316
|
-
}>>;
|
|
317
|
-
/**
|
|
318
|
-
* Allows the user to have codegen output `Temporal` types instead of the base JS `Date`
|
|
319
|
-
*
|
|
320
|
-
* Additionally, allows for specifying the default time zone for `Temporal` types when converting dates to/from
|
|
321
|
-
* the database.
|
|
322
|
-
*/
|
|
323
|
-
temporal: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
82
|
+
}, z.core.$strict>>;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
temporal: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
324
85
|
timeZone: z.ZodString;
|
|
325
|
-
},
|
|
326
|
-
|
|
327
|
-
}, {
|
|
328
|
-
timeZone: string;
|
|
329
|
-
}>]>>;
|
|
330
|
-
/**
|
|
331
|
-
* By default, we create a `flush_database` function for fast testing.
|
|
332
|
-
*
|
|
333
|
-
* However, if you don't want to use this, or you have your own bespoke function like we do
|
|
334
|
-
* that is more application-aware, then you can disable Joist's out-of-the-box one.
|
|
335
|
-
*
|
|
336
|
-
* If you have more than one test database, you can set `createFlushFunction` to the array
|
|
337
|
-
* of test database names, i.e. `mydb_test_1`, `mydb_test_2`, etc.
|
|
338
|
-
*/
|
|
339
|
-
createFlushFunction: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
|
|
86
|
+
}, z.core.$strip>]>>;
|
|
87
|
+
createFlushFunction: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
340
88
|
entitiesDirectory: z.ZodDefault<z.ZodString>;
|
|
341
|
-
codegenPlugins: z.ZodOptional<z.ZodArray<z.ZodString
|
|
89
|
+
codegenPlugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
342
90
|
entities: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
343
91
|
tag: z.ZodString;
|
|
344
92
|
tableName: z.ZodOptional<z.ZodString>;
|
|
345
93
|
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
346
|
-
derived: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
94
|
+
derived: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"sync">, z.ZodLiteral<"async">]>>;
|
|
347
95
|
protected: z.ZodOptional<z.ZodBoolean>;
|
|
348
96
|
ignore: z.ZodOptional<z.ZodBoolean>;
|
|
349
97
|
superstruct: z.ZodOptional<z.ZodString>;
|
|
@@ -354,284 +102,33 @@ export declare const config: z.ZodObject<{
|
|
|
354
102
|
stiType: z.ZodOptional<z.ZodString>;
|
|
355
103
|
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
356
104
|
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
357
|
-
},
|
|
358
|
-
type?: string | undefined;
|
|
359
|
-
derived?: "sync" | "async" | undefined;
|
|
360
|
-
protected?: boolean | undefined;
|
|
361
|
-
ignore?: boolean | undefined;
|
|
362
|
-
superstruct?: string | undefined;
|
|
363
|
-
zodSchema?: string | undefined;
|
|
364
|
-
serde?: string | undefined;
|
|
365
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
366
|
-
stiType?: string | undefined;
|
|
367
|
-
notNull?: boolean | undefined;
|
|
368
|
-
hasDefault?: boolean | undefined;
|
|
369
|
-
}, {
|
|
370
|
-
type?: string | undefined;
|
|
371
|
-
derived?: "sync" | "async" | undefined;
|
|
372
|
-
protected?: boolean | undefined;
|
|
373
|
-
ignore?: boolean | undefined;
|
|
374
|
-
superstruct?: string | undefined;
|
|
375
|
-
zodSchema?: string | undefined;
|
|
376
|
-
serde?: string | undefined;
|
|
377
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
378
|
-
stiType?: string | undefined;
|
|
379
|
-
notNull?: boolean | undefined;
|
|
380
|
-
hasDefault?: boolean | undefined;
|
|
381
|
-
}>>>;
|
|
105
|
+
}, z.core.$strict>>>;
|
|
382
106
|
relations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
383
107
|
derived: z.ZodOptional<z.ZodLiteral<"async">>;
|
|
384
|
-
polymorphic: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
108
|
+
polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
|
|
385
109
|
large: z.ZodOptional<z.ZodBoolean>;
|
|
386
110
|
orderBy: z.ZodOptional<z.ZodString>;
|
|
387
111
|
stiType: z.ZodOptional<z.ZodString>;
|
|
388
|
-
/**
|
|
389
|
-
* Allow specializing a base type relation (SmallPublisher.group: SmallPublisherGroup).
|
|
390
|
-
*
|
|
391
|
-
* Self-referential FKs also support `subType: "self"` that means each subtype will point
|
|
392
|
-
* at its own subtype.
|
|
393
|
-
*/
|
|
394
112
|
subType: z.ZodOptional<z.ZodString>;
|
|
395
|
-
/** Allow skipping self-referential fields getting a `...Recursive` relation. */
|
|
396
113
|
skipRecursiveRelations: z.ZodOptional<z.ZodBoolean>;
|
|
397
114
|
notNull: z.ZodOptional<z.ZodBoolean>;
|
|
398
115
|
hasDefault: z.ZodOptional<z.ZodBoolean>;
|
|
399
|
-
},
|
|
400
|
-
derived?: "async" | undefined;
|
|
401
|
-
stiType?: string | undefined;
|
|
402
|
-
notNull?: boolean | undefined;
|
|
403
|
-
hasDefault?: boolean | undefined;
|
|
404
|
-
polymorphic?: true | "notNull" | undefined;
|
|
405
|
-
large?: boolean | undefined;
|
|
406
|
-
orderBy?: string | undefined;
|
|
407
|
-
subType?: string | undefined;
|
|
408
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
409
|
-
}, {
|
|
410
|
-
derived?: "async" | undefined;
|
|
411
|
-
stiType?: string | undefined;
|
|
412
|
-
notNull?: boolean | undefined;
|
|
413
|
-
hasDefault?: boolean | undefined;
|
|
414
|
-
polymorphic?: true | "notNull" | undefined;
|
|
415
|
-
large?: boolean | undefined;
|
|
416
|
-
orderBy?: string | undefined;
|
|
417
|
-
subType?: string | undefined;
|
|
418
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
419
|
-
}>>>;
|
|
420
|
-
/** Whether this entity should be abstract, e.g. for inheritance a subtype must be instantiated instead of this type. */
|
|
116
|
+
}, z.core.$strict>>>;
|
|
421
117
|
abstract: z.ZodOptional<z.ZodBoolean>;
|
|
422
118
|
orderBy: z.ZodOptional<z.ZodString>;
|
|
423
|
-
uniqueBy: z.ZodOptional<z.
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
type?: string | undefined;
|
|
429
|
-
derived?: "sync" | "async" | undefined;
|
|
430
|
-
protected?: boolean | undefined;
|
|
431
|
-
ignore?: boolean | undefined;
|
|
432
|
-
superstruct?: string | undefined;
|
|
433
|
-
zodSchema?: string | undefined;
|
|
434
|
-
serde?: string | undefined;
|
|
435
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
436
|
-
stiType?: string | undefined;
|
|
437
|
-
notNull?: boolean | undefined;
|
|
438
|
-
hasDefault?: boolean | undefined;
|
|
439
|
-
}> | undefined;
|
|
440
|
-
relations?: Record<string, {
|
|
441
|
-
derived?: "async" | undefined;
|
|
442
|
-
stiType?: string | undefined;
|
|
443
|
-
notNull?: boolean | undefined;
|
|
444
|
-
hasDefault?: boolean | undefined;
|
|
445
|
-
polymorphic?: true | "notNull" | undefined;
|
|
446
|
-
large?: boolean | undefined;
|
|
447
|
-
orderBy?: string | undefined;
|
|
448
|
-
subType?: string | undefined;
|
|
449
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
450
|
-
}> | undefined;
|
|
451
|
-
orderBy?: string | undefined;
|
|
452
|
-
abstract?: boolean | undefined;
|
|
453
|
-
uniqueBy?: string[][] | undefined;
|
|
454
|
-
}, {
|
|
455
|
-
tag: string;
|
|
456
|
-
tableName?: string | undefined;
|
|
457
|
-
fields?: Record<string, {
|
|
458
|
-
type?: string | undefined;
|
|
459
|
-
derived?: "sync" | "async" | undefined;
|
|
460
|
-
protected?: boolean | undefined;
|
|
461
|
-
ignore?: boolean | undefined;
|
|
462
|
-
superstruct?: string | undefined;
|
|
463
|
-
zodSchema?: string | undefined;
|
|
464
|
-
serde?: string | undefined;
|
|
465
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
466
|
-
stiType?: string | undefined;
|
|
467
|
-
notNull?: boolean | undefined;
|
|
468
|
-
hasDefault?: boolean | undefined;
|
|
469
|
-
}> | undefined;
|
|
470
|
-
relations?: Record<string, {
|
|
471
|
-
derived?: "async" | undefined;
|
|
472
|
-
stiType?: string | undefined;
|
|
473
|
-
notNull?: boolean | undefined;
|
|
474
|
-
hasDefault?: boolean | undefined;
|
|
475
|
-
polymorphic?: true | "notNull" | undefined;
|
|
476
|
-
large?: boolean | undefined;
|
|
477
|
-
orderBy?: string | undefined;
|
|
478
|
-
subType?: string | undefined;
|
|
479
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
480
|
-
}> | undefined;
|
|
481
|
-
orderBy?: string | undefined;
|
|
482
|
-
abstract?: boolean | undefined;
|
|
483
|
-
uniqueBy?: string | string[] | string[][] | undefined;
|
|
484
|
-
}>>>;
|
|
485
|
-
ignoredTables: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
486
|
-
/** The type of entity `id` fields; defaults to `tagged-string`. */
|
|
487
|
-
idType: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"tagged-string">, z.ZodLiteral<"untagged-string">, z.ZodLiteral<"number">]>>;
|
|
488
|
-
/** How we should support non-deferred foreign keys. */
|
|
489
|
-
nonDeferredForeignKeys: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"ignore">]>>;
|
|
490
|
-
/** Enables esm output. */
|
|
119
|
+
uniqueBy: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodArray<z.ZodString>>]>, z.ZodTransform<string[][], string | string[] | string[][]>>>;
|
|
120
|
+
}, z.core.$strict>>>;
|
|
121
|
+
ignoredTables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
122
|
+
idType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"tagged-string">, z.ZodLiteral<"untagged-string">, z.ZodLiteral<"number">]>>;
|
|
123
|
+
nonDeferredForeignKeys: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"ignore">]>>;
|
|
491
124
|
esm: z.ZodOptional<z.ZodBoolean>;
|
|
492
|
-
|
|
493
|
-
paginationStyle: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"cursor">, z.ZodLiteral<"limit">]>>>;
|
|
494
|
-
/** Enables documentation syncing between .md files and JSDocs. */
|
|
125
|
+
paginationStyle: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"cursor">, z.ZodLiteral<"limit">]>>>;
|
|
495
126
|
docs: z.ZodOptional<z.ZodBoolean>;
|
|
496
|
-
/** Output a metadata-docs.ts file with entity/field documentation available at runtime. */
|
|
497
127
|
outputDocs: z.ZodOptional<z.ZodBoolean>;
|
|
498
|
-
/** Auto-set by probing the project's `tsconfig.json` file. */
|
|
499
128
|
allowImportingTsExtensions: z.ZodOptional<z.ZodBoolean>;
|
|
500
|
-
/** The latest Joist codemod counter that has been applied to this project. */
|
|
501
129
|
codemodVersion: z.ZodDefault<z.ZodNumber>;
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
}, "strict", z.ZodTypeAny, {
|
|
505
|
-
entitiesDirectory: string;
|
|
506
|
-
entities: Record<string, {
|
|
507
|
-
tag: string;
|
|
508
|
-
tableName?: string | undefined;
|
|
509
|
-
fields?: Record<string, {
|
|
510
|
-
type?: string | undefined;
|
|
511
|
-
derived?: "sync" | "async" | undefined;
|
|
512
|
-
protected?: boolean | undefined;
|
|
513
|
-
ignore?: boolean | undefined;
|
|
514
|
-
superstruct?: string | undefined;
|
|
515
|
-
zodSchema?: string | undefined;
|
|
516
|
-
serde?: string | undefined;
|
|
517
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
518
|
-
stiType?: string | undefined;
|
|
519
|
-
notNull?: boolean | undefined;
|
|
520
|
-
hasDefault?: boolean | undefined;
|
|
521
|
-
}> | undefined;
|
|
522
|
-
relations?: Record<string, {
|
|
523
|
-
derived?: "async" | undefined;
|
|
524
|
-
stiType?: string | undefined;
|
|
525
|
-
notNull?: boolean | undefined;
|
|
526
|
-
hasDefault?: boolean | undefined;
|
|
527
|
-
polymorphic?: true | "notNull" | undefined;
|
|
528
|
-
large?: boolean | undefined;
|
|
529
|
-
orderBy?: string | undefined;
|
|
530
|
-
subType?: string | undefined;
|
|
531
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
532
|
-
}> | undefined;
|
|
533
|
-
orderBy?: string | undefined;
|
|
534
|
-
abstract?: boolean | undefined;
|
|
535
|
-
uniqueBy?: string[][] | undefined;
|
|
536
|
-
}>;
|
|
537
|
-
paginationStyle: "cursor" | "limit";
|
|
538
|
-
codemodVersion: number;
|
|
539
|
-
databaseUrl?: string | undefined;
|
|
540
|
-
contextType?: string | undefined;
|
|
541
|
-
transactionType?: string | undefined;
|
|
542
|
-
timestampColumns?: {
|
|
543
|
-
createdAt?: {
|
|
544
|
-
names: string[];
|
|
545
|
-
required?: boolean | undefined;
|
|
546
|
-
} | undefined;
|
|
547
|
-
updatedAt?: {
|
|
548
|
-
names: string[];
|
|
549
|
-
required?: boolean | undefined;
|
|
550
|
-
} | undefined;
|
|
551
|
-
deletedAt?: {
|
|
552
|
-
names: string[];
|
|
553
|
-
required?: boolean | undefined;
|
|
554
|
-
} | undefined;
|
|
555
|
-
} | undefined;
|
|
556
|
-
temporal?: boolean | {
|
|
557
|
-
timeZone: string;
|
|
558
|
-
} | undefined;
|
|
559
|
-
createFlushFunction?: boolean | string[] | undefined;
|
|
560
|
-
codegenPlugins?: string[] | undefined;
|
|
561
|
-
ignoredTables?: string[] | undefined;
|
|
562
|
-
idType?: "number" | "tagged-string" | "untagged-string" | undefined;
|
|
563
|
-
nonDeferredForeignKeys?: "warn" | "error" | "ignore" | undefined;
|
|
564
|
-
esm?: boolean | undefined;
|
|
565
|
-
docs?: boolean | undefined;
|
|
566
|
-
outputDocs?: boolean | undefined;
|
|
567
|
-
allowImportingTsExtensions?: boolean | undefined;
|
|
568
|
-
schemas?: string[] | undefined;
|
|
569
|
-
}, {
|
|
570
|
-
databaseUrl?: string | undefined;
|
|
571
|
-
contextType?: string | undefined;
|
|
572
|
-
transactionType?: string | undefined;
|
|
573
|
-
timestampColumns?: {
|
|
574
|
-
createdAt?: {
|
|
575
|
-
names: string[];
|
|
576
|
-
required?: boolean | undefined;
|
|
577
|
-
} | undefined;
|
|
578
|
-
updatedAt?: {
|
|
579
|
-
names: string[];
|
|
580
|
-
required?: boolean | undefined;
|
|
581
|
-
} | undefined;
|
|
582
|
-
deletedAt?: {
|
|
583
|
-
names: string[];
|
|
584
|
-
required?: boolean | undefined;
|
|
585
|
-
} | undefined;
|
|
586
|
-
} | undefined;
|
|
587
|
-
temporal?: boolean | {
|
|
588
|
-
timeZone: string;
|
|
589
|
-
} | undefined;
|
|
590
|
-
createFlushFunction?: boolean | string[] | undefined;
|
|
591
|
-
entitiesDirectory?: string | undefined;
|
|
592
|
-
codegenPlugins?: string[] | undefined;
|
|
593
|
-
entities?: Record<string, {
|
|
594
|
-
tag: string;
|
|
595
|
-
tableName?: string | undefined;
|
|
596
|
-
fields?: Record<string, {
|
|
597
|
-
type?: string | undefined;
|
|
598
|
-
derived?: "sync" | "async" | undefined;
|
|
599
|
-
protected?: boolean | undefined;
|
|
600
|
-
ignore?: boolean | undefined;
|
|
601
|
-
superstruct?: string | undefined;
|
|
602
|
-
zodSchema?: string | undefined;
|
|
603
|
-
serde?: string | undefined;
|
|
604
|
-
stiDiscriminator?: Record<string, string> | undefined;
|
|
605
|
-
stiType?: string | undefined;
|
|
606
|
-
notNull?: boolean | undefined;
|
|
607
|
-
hasDefault?: boolean | undefined;
|
|
608
|
-
}> | undefined;
|
|
609
|
-
relations?: Record<string, {
|
|
610
|
-
derived?: "async" | undefined;
|
|
611
|
-
stiType?: string | undefined;
|
|
612
|
-
notNull?: boolean | undefined;
|
|
613
|
-
hasDefault?: boolean | undefined;
|
|
614
|
-
polymorphic?: true | "notNull" | undefined;
|
|
615
|
-
large?: boolean | undefined;
|
|
616
|
-
orderBy?: string | undefined;
|
|
617
|
-
subType?: string | undefined;
|
|
618
|
-
skipRecursiveRelations?: boolean | undefined;
|
|
619
|
-
}> | undefined;
|
|
620
|
-
orderBy?: string | undefined;
|
|
621
|
-
abstract?: boolean | undefined;
|
|
622
|
-
uniqueBy?: string | string[] | string[][] | undefined;
|
|
623
|
-
}> | undefined;
|
|
624
|
-
ignoredTables?: string[] | undefined;
|
|
625
|
-
idType?: "number" | "tagged-string" | "untagged-string" | undefined;
|
|
626
|
-
nonDeferredForeignKeys?: "warn" | "error" | "ignore" | undefined;
|
|
627
|
-
esm?: boolean | undefined;
|
|
628
|
-
paginationStyle?: "cursor" | "limit" | undefined;
|
|
629
|
-
docs?: boolean | undefined;
|
|
630
|
-
outputDocs?: boolean | undefined;
|
|
631
|
-
allowImportingTsExtensions?: boolean | undefined;
|
|
632
|
-
codemodVersion?: number | undefined;
|
|
633
|
-
schemas?: string[] | undefined;
|
|
634
|
-
}>;
|
|
130
|
+
schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
131
|
+
}, z.core.$strict>;
|
|
635
132
|
export type Config = z.infer<typeof config> & {
|
|
636
133
|
__tableToEntityName?: Record<string, string>;
|
|
637
134
|
};
|