sonamu 0.3.1 → 0.4.2
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/.pnp.cjs +11 -0
- package/dist/base-model-BzMJ2E_I.d.mts +43 -0
- package/dist/base-model-CWRKUX49.d.ts +43 -0
- package/dist/bin/cli.js +118 -89
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/cli.mjs +74 -45
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/chunk-6HSW7OS3.js +1567 -0
- package/dist/chunk-6HSW7OS3.js.map +1 -0
- package/dist/chunk-FLPD24HS.mjs +231 -0
- package/dist/chunk-FLPD24HS.mjs.map +1 -0
- package/dist/{chunk-MPXE4IHO.mjs → chunk-PP2PSSAG.mjs} +5284 -5617
- package/dist/chunk-PP2PSSAG.mjs.map +1 -0
- package/dist/chunk-QK5XXJUX.mjs +280 -0
- package/dist/chunk-QK5XXJUX.mjs.map +1 -0
- package/dist/chunk-S6FYTR3V.mjs +1567 -0
- package/dist/chunk-S6FYTR3V.mjs.map +1 -0
- package/dist/chunk-U636LQJJ.js +231 -0
- package/dist/chunk-U636LQJJ.js.map +1 -0
- package/dist/chunk-W7KDVJLQ.js +280 -0
- package/dist/chunk-W7KDVJLQ.js.map +1 -0
- package/dist/{chunk-YXILRRDT.js → chunk-XT6LHCX5.js} +5252 -5585
- package/dist/chunk-XT6LHCX5.js.map +1 -0
- package/dist/database/drivers/knex/base-model.d.mts +16 -0
- package/dist/database/drivers/knex/base-model.d.ts +16 -0
- package/dist/database/drivers/knex/base-model.js +55 -0
- package/dist/database/drivers/knex/base-model.js.map +1 -0
- package/dist/database/drivers/knex/base-model.mjs +56 -0
- package/dist/database/drivers/knex/base-model.mjs.map +1 -0
- package/dist/database/drivers/kysely/base-model.d.mts +22 -0
- package/dist/database/drivers/kysely/base-model.d.ts +22 -0
- package/dist/database/drivers/kysely/base-model.js +64 -0
- package/dist/database/drivers/kysely/base-model.js.map +1 -0
- package/dist/database/drivers/kysely/base-model.mjs +65 -0
- package/dist/database/drivers/kysely/base-model.mjs.map +1 -0
- package/dist/index.d.mts +222 -928
- package/dist/index.d.ts +222 -928
- package/dist/index.js +13 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -31
- package/dist/index.mjs.map +1 -1
- package/dist/model-CAH_4oQh.d.mts +1042 -0
- package/dist/model-CAH_4oQh.d.ts +1042 -0
- package/import-to-require.js +27 -0
- package/package.json +24 -3
- package/src/api/caster.ts +6 -0
- package/src/api/code-converters.ts +3 -1
- package/src/api/sonamu.ts +41 -22
- package/src/bin/cli.ts +79 -46
- package/src/database/_batch_update.ts +16 -11
- package/src/database/base-model.abstract.ts +97 -0
- package/src/database/base-model.ts +214 -280
- package/src/database/code-generator.ts +72 -0
- package/src/database/db.abstract.ts +75 -0
- package/src/database/db.ts +21 -82
- package/src/database/drivers/knex/base-model.ts +55 -0
- package/src/database/drivers/knex/client.ts +209 -0
- package/src/database/drivers/knex/db.ts +227 -0
- package/src/database/drivers/knex/generator.ts +659 -0
- package/src/database/drivers/kysely/base-model.ts +89 -0
- package/src/database/drivers/kysely/client.ts +309 -0
- package/src/database/drivers/kysely/db.ts +238 -0
- package/src/database/drivers/kysely/generator.ts +714 -0
- package/src/database/types.ts +117 -0
- package/src/database/upsert-builder.ts +31 -18
- package/src/entity/entity-utils.ts +1 -1
- package/src/entity/migrator.ts +148 -711
- package/src/index.ts +1 -1
- package/src/syncer/syncer.ts +69 -27
- package/src/templates/generated_http.template.ts +14 -0
- package/src/templates/kysely_types.template.ts +205 -0
- package/src/templates/model.template.ts +2 -139
- package/src/templates/service.template.ts +3 -1
- package/src/testing/_relation-graph.ts +111 -0
- package/src/testing/fixture-manager.ts +216 -332
- package/src/types/types.ts +56 -6
- package/src/utils/utils.ts +56 -4
- package/src/utils/zod-error.ts +189 -0
- package/tsconfig.json +2 -2
- package/tsup.config.js +11 -10
- package/dist/chunk-MPXE4IHO.mjs.map +0 -1
- package/dist/chunk-YXILRRDT.js.map +0 -1
- /package/src/database/{knex-plugins → drivers/knex/plugins}/knex-on-duplicate-update.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,775 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { A as ApiParamType, e as ApiParam, E as EntityPropNode, T as TextProp, f as EntityProp, R as RelationProp, g as EntityIndex, h as EntityJson, S as SubsetQuery, i as EntitySubsetRow, j as TemplateKey, k as TemplateOptions, P as PathAndCode, G as GenerateOptions, l as RenderingNode, m as SonamuDBConfig, c as DatabaseDriver, K as KnexClient, b as KyselyClient, D as DBPreset, a as Database, n as SonamuDBBaseConfig, o as KnexConfig, p as KyselyConfig, q as KnexGenerator, r as KnexBaseConfig, s as SonamuKnexDBConfig, C as CodeGenerator, M as MigrationColumn, t as MigrationIndex, u as GenMigrationCode, v as MigrationForeign, w as KyselyBaseConfig, x as SonamuKyselyDBConfig, y as DatabaseExtend, I as IntegerProp, z as BigIntegerProp, F as StringProp, H as FloatProp, J as DoubleProp, L as DecimalProp, N as BooleanProp, O as DateProp, Q as DateTimeProp, V as TimeProp, W as TimestampProp, X as JsonProp, Y as UuidProp, Z as EnumProp, _ as VirtualProp, $ as DistributiveOmit, a0 as OneToOneRelationProp, a1 as BelongsToOneRelationProp, a2 as HasManyRelationProp, a3 as ManyToManyRelationProp, a4 as MigrationSet, a5 as MigrationSetAndJoinTable, a6 as FixtureSearchOptions, a7 as FixtureRecord, a8 as FixtureImportResult } from './model-CAH_4oQh.js';
|
|
3
|
+
export { aS as ArrayOr, B as BaseListParams, aj as CommonProp, ac as DatabaseClient, d as DriverSpec, af as EnumsLabel, ag as EnumsLabelKo, ad as Environment, am as FlattenSubsetRow, aO as KnexColumnType, aL as KnexError, aR as ListResult, aP as MigrationJoinTable, aQ as RelationNode, al as RelationOn, ak as RelationType, an as SMDInput, ah as SQLDateTimeString, ae as SonamuDBFullConfig, aK as SonamuQueryMode, a9 as UBRef, U as UpsertBuilder, ab as WhereClause, aT as asArray, aG as isBelongsToOneRelationProp, ap as isBigIntegerProp, aw as isBooleanProp, aJ as isCustomJoinClause, ax as isDateProp, ay as isDateTimeProp, av as isDecimalProp, au as isDoubleProp, as as isEnumProp, at as isFloatProp, aH as isHasManyRelationProp, ao as isIntegerProp, aB as isJsonProp, aM as isKnexError, aN as isKyselyError, aI as isManyToManyRelationProp, aF as isOneToOneRelationProp, aa as isRefField, aE as isRelationProp, ar as isStringProp, aq as isTextProp, az as isTimeProp, aA as isTimestampProp, aC as isUuidProp, aD as isVirtualProp, aU as objToMap, ai as zArrayable } from './model-CAH_4oQh.js';
|
|
3
4
|
import { HTTPMethods, FastifyReply, FastifyInstance, FastifyRequest } from 'fastify';
|
|
4
5
|
import { RouteGenericInterface } from 'fastify/types/route';
|
|
5
6
|
import { Server, IncomingMessage, ServerResponse, IncomingHttpHeaders } from 'http';
|
|
6
7
|
import ts from 'typescript';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
type EnumsLabelKo<T extends string> = EnumsLabel<T, "ko">;
|
|
14
|
-
declare const SQLDateTimeString: z.ZodString;
|
|
15
|
-
type SQLDateTimeString = z.infer<typeof SQLDateTimeString>;
|
|
16
|
-
declare function zArrayable<T extends z.ZodTypeAny>(shape: T): z.ZodUnion<[T, z.ZodArray<T, "many">]>;
|
|
17
|
-
type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
|
18
|
-
type CommonProp = {
|
|
19
|
-
name: string;
|
|
20
|
-
nullable?: boolean;
|
|
21
|
-
toFilter?: true;
|
|
22
|
-
desc?: string;
|
|
23
|
-
dbDefault?: string;
|
|
24
|
-
};
|
|
25
|
-
type IntegerProp = CommonProp & {
|
|
26
|
-
type: "integer";
|
|
27
|
-
unsigned?: true;
|
|
28
|
-
};
|
|
29
|
-
type BigIntegerProp = CommonProp & {
|
|
30
|
-
type: "bigInteger";
|
|
31
|
-
unsigned?: true;
|
|
32
|
-
};
|
|
33
|
-
type TextProp = CommonProp & {
|
|
34
|
-
type: "text";
|
|
35
|
-
textType: "text" | "mediumtext" | "longtext";
|
|
36
|
-
};
|
|
37
|
-
type StringProp = CommonProp & {
|
|
38
|
-
type: "string";
|
|
39
|
-
length: number;
|
|
40
|
-
};
|
|
41
|
-
type EnumProp = CommonProp & {
|
|
42
|
-
type: "enum";
|
|
43
|
-
length: number;
|
|
44
|
-
id: string;
|
|
45
|
-
};
|
|
46
|
-
type FloatProp = CommonProp & {
|
|
47
|
-
type: "float";
|
|
48
|
-
unsigned?: true;
|
|
49
|
-
precision: number;
|
|
50
|
-
scale: number;
|
|
51
|
-
};
|
|
52
|
-
type DoubleProp = CommonProp & {
|
|
53
|
-
type: "double";
|
|
54
|
-
unsigned?: true;
|
|
55
|
-
precision: number;
|
|
56
|
-
scale: number;
|
|
57
|
-
};
|
|
58
|
-
type DecimalProp = CommonProp & {
|
|
59
|
-
type: "decimal";
|
|
60
|
-
unsigned?: true;
|
|
61
|
-
precision: number;
|
|
62
|
-
scale: number;
|
|
63
|
-
};
|
|
64
|
-
type BooleanProp = CommonProp & {
|
|
65
|
-
type: "boolean";
|
|
66
|
-
};
|
|
67
|
-
type DateProp = CommonProp & {
|
|
68
|
-
type: "date";
|
|
69
|
-
};
|
|
70
|
-
type DateTimeProp = CommonProp & {
|
|
71
|
-
type: "dateTime";
|
|
72
|
-
};
|
|
73
|
-
type TimeProp = CommonProp & {
|
|
74
|
-
type: "time";
|
|
75
|
-
};
|
|
76
|
-
type TimestampProp = CommonProp & {
|
|
77
|
-
type: "timestamp";
|
|
78
|
-
};
|
|
79
|
-
type JsonProp = CommonProp & {
|
|
80
|
-
type: "json";
|
|
81
|
-
id: string;
|
|
82
|
-
};
|
|
83
|
-
type UuidProp = CommonProp & {
|
|
84
|
-
type: "uuid";
|
|
85
|
-
};
|
|
86
|
-
type VirtualProp = CommonProp & {
|
|
87
|
-
type: "virtual";
|
|
88
|
-
id: string;
|
|
89
|
-
};
|
|
90
|
-
type RelationType = "HasMany" | "BelongsToOne" | "ManyToMany" | "OneToOne";
|
|
91
|
-
type RelationOn = "CASCADE" | "SET NULL" | "NO ACTION" | "SET DEFAULT" | "RESTRICT";
|
|
92
|
-
type _RelationProp = {
|
|
93
|
-
type: "relation";
|
|
94
|
-
name: string;
|
|
95
|
-
with: string;
|
|
96
|
-
nullable?: boolean;
|
|
97
|
-
toFilter?: true;
|
|
98
|
-
desc?: string;
|
|
99
|
-
};
|
|
100
|
-
type OneToOneRelationProp = _RelationProp & {
|
|
101
|
-
relationType: "OneToOne";
|
|
102
|
-
customJoinClause?: string;
|
|
103
|
-
} & ({
|
|
104
|
-
hasJoinColumn: true;
|
|
105
|
-
onUpdate: RelationOn;
|
|
106
|
-
onDelete: RelationOn;
|
|
107
|
-
} | {
|
|
108
|
-
hasJoinColumn: false;
|
|
109
|
-
});
|
|
110
|
-
type BelongsToOneRelationProp = _RelationProp & {
|
|
111
|
-
relationType: "BelongsToOne";
|
|
112
|
-
customJoinClause?: string;
|
|
113
|
-
onUpdate: RelationOn;
|
|
114
|
-
onDelete: RelationOn;
|
|
115
|
-
};
|
|
116
|
-
type HasManyRelationProp = _RelationProp & {
|
|
117
|
-
relationType: "HasMany";
|
|
118
|
-
joinColumn: string;
|
|
119
|
-
fromColumn?: string;
|
|
120
|
-
};
|
|
121
|
-
type ManyToManyRelationProp = _RelationProp & {
|
|
122
|
-
relationType: "ManyToMany";
|
|
123
|
-
joinTable: `${string}__${string}`;
|
|
124
|
-
onUpdate: RelationOn;
|
|
125
|
-
onDelete: RelationOn;
|
|
126
|
-
};
|
|
127
|
-
type RelationProp = OneToOneRelationProp | BelongsToOneRelationProp | HasManyRelationProp | ManyToManyRelationProp;
|
|
128
|
-
type EntityProp = IntegerProp | BigIntegerProp | TextProp | StringProp | FloatProp | DoubleProp | DecimalProp | BooleanProp | DateProp | DateTimeProp | TimeProp | TimestampProp | JsonProp | UuidProp | EnumProp | VirtualProp | RelationProp;
|
|
129
|
-
type EntityIndex = {
|
|
130
|
-
type: "index" | "unique";
|
|
131
|
-
columns: string[];
|
|
132
|
-
name?: string;
|
|
133
|
-
};
|
|
134
|
-
type EntityJson = {
|
|
135
|
-
id: string;
|
|
136
|
-
parentId?: string;
|
|
137
|
-
table: string;
|
|
138
|
-
title?: string;
|
|
139
|
-
props: EntityProp[];
|
|
140
|
-
indexes: EntityIndex[];
|
|
141
|
-
subsets: {
|
|
142
|
-
[subset: string]: string[];
|
|
143
|
-
};
|
|
144
|
-
enums: {
|
|
145
|
-
[enumId: string]: {
|
|
146
|
-
[key: string]: string;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
type EntitySubsetRow = {
|
|
151
|
-
field: string;
|
|
152
|
-
has: {
|
|
153
|
-
[key: string]: boolean;
|
|
154
|
-
};
|
|
155
|
-
children: EntitySubsetRow[];
|
|
156
|
-
prefixes: string[];
|
|
157
|
-
relationEntity?: string;
|
|
158
|
-
isOpen?: boolean;
|
|
159
|
-
};
|
|
160
|
-
type FlattenSubsetRow = Omit<EntitySubsetRow, "children">;
|
|
161
|
-
type SMDInput<T extends string> = {
|
|
162
|
-
id: string;
|
|
163
|
-
parentId?: string;
|
|
164
|
-
table?: string;
|
|
165
|
-
title?: string;
|
|
166
|
-
props?: EntityProp[];
|
|
167
|
-
indexes?: EntityIndex[];
|
|
168
|
-
subsets?: {
|
|
169
|
-
[subset: string]: T[];
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
type EntityPropNode = {
|
|
173
|
-
nodeType: "plain";
|
|
174
|
-
prop: EntityProp;
|
|
175
|
-
} | {
|
|
176
|
-
nodeType: "object" | "array";
|
|
177
|
-
prop?: EntityProp;
|
|
178
|
-
children: EntityPropNode[];
|
|
179
|
-
};
|
|
180
|
-
declare function isIntegerProp(p: any): p is IntegerProp;
|
|
181
|
-
declare function isBigIntegerProp(p: any): p is BigIntegerProp;
|
|
182
|
-
declare function isTextProp(p: any): p is TextProp;
|
|
183
|
-
declare function isStringProp(p: any): p is StringProp;
|
|
184
|
-
declare function isEnumProp(p: any): p is EnumProp;
|
|
185
|
-
declare function isFloatProp(p: any): p is FloatProp;
|
|
186
|
-
declare function isDoubleProp(p: any): p is DoubleProp;
|
|
187
|
-
declare function isDecimalProp(p: any): p is DecimalProp;
|
|
188
|
-
declare function isBooleanProp(p: any): p is BooleanProp;
|
|
189
|
-
declare function isDateProp(p: any): p is DateProp;
|
|
190
|
-
declare function isDateTimeProp(p: any): p is DateTimeProp;
|
|
191
|
-
declare function isTimeProp(p: any): p is TimeProp;
|
|
192
|
-
declare function isTimestampProp(p: any): p is TimestampProp;
|
|
193
|
-
declare function isJsonProp(p: any): p is JsonProp;
|
|
194
|
-
declare function isUuidProp(p: any): p is UuidProp;
|
|
195
|
-
declare function isVirtualProp(p: any): p is VirtualProp;
|
|
196
|
-
declare function isRelationProp(p: any): p is RelationProp;
|
|
197
|
-
declare function isOneToOneRelationProp(p: any): p is OneToOneRelationProp;
|
|
198
|
-
declare function isBelongsToOneRelationProp(p: any): p is BelongsToOneRelationProp;
|
|
199
|
-
declare function isHasManyRelationProp(p: any): p is HasManyRelationProp;
|
|
200
|
-
declare function isManyToManyRelationProp(p: any): p is ManyToManyRelationProp;
|
|
201
|
-
type JoinClause = {
|
|
202
|
-
from: string;
|
|
203
|
-
to: string;
|
|
204
|
-
} | {
|
|
205
|
-
custom: string;
|
|
206
|
-
};
|
|
207
|
-
declare function isCustomJoinClause(p: any): p is {
|
|
208
|
-
custom: string;
|
|
209
|
-
};
|
|
210
|
-
type SubsetLoader = {
|
|
211
|
-
as: string;
|
|
212
|
-
table: string;
|
|
213
|
-
manyJoin: {
|
|
214
|
-
fromTable: string;
|
|
215
|
-
fromCol: string;
|
|
216
|
-
idField: string;
|
|
217
|
-
toTable: string;
|
|
218
|
-
toCol: string;
|
|
219
|
-
through?: {
|
|
220
|
-
table: string;
|
|
221
|
-
fromCol: string;
|
|
222
|
-
toCol: string;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
oneJoins: ({
|
|
226
|
-
as: string;
|
|
227
|
-
join: "inner" | "outer";
|
|
228
|
-
table: string;
|
|
229
|
-
} & JoinClause)[];
|
|
230
|
-
select: (string | Knex.Raw)[];
|
|
231
|
-
loaders?: SubsetLoader[];
|
|
232
|
-
};
|
|
233
|
-
type SubsetQuery = {
|
|
234
|
-
select: (string | Knex.Raw)[];
|
|
235
|
-
virtual: string[];
|
|
236
|
-
joins: ({
|
|
237
|
-
as: string;
|
|
238
|
-
join: "inner" | "outer";
|
|
239
|
-
table: string;
|
|
240
|
-
} & JoinClause)[];
|
|
241
|
-
loaders: SubsetLoader[];
|
|
242
|
-
};
|
|
243
|
-
declare const SonamuQueryMode: z.ZodEnum<["both", "list", "count"]>;
|
|
244
|
-
type SonamuQueryMode = z.infer<typeof SonamuQueryMode>;
|
|
245
|
-
type KnexError = {
|
|
246
|
-
code: string;
|
|
247
|
-
errno: number;
|
|
248
|
-
sql: string;
|
|
249
|
-
sqlMessage: string;
|
|
250
|
-
sqlState: string;
|
|
251
|
-
};
|
|
252
|
-
declare function isKnexError(e: any): e is KnexError;
|
|
253
|
-
type KnexColumnType = "string" | "text" | "smalltext" | "mediumtext" | "longtext" | "integer" | "bigInteger" | "decimal" | "timestamp" | "boolean" | "foreign" | "uuid" | "json" | "float" | "date" | "time" | "dateTime";
|
|
254
|
-
type MigrationColumn = {
|
|
255
|
-
name: string;
|
|
256
|
-
type: KnexColumnType;
|
|
257
|
-
nullable: boolean;
|
|
258
|
-
unsigned?: boolean;
|
|
259
|
-
length?: number;
|
|
260
|
-
defaultTo?: string;
|
|
261
|
-
precision?: number;
|
|
262
|
-
scale?: number;
|
|
263
|
-
};
|
|
264
|
-
type MigrationIndex = {
|
|
265
|
-
columns: string[];
|
|
266
|
-
type: "unique" | "index";
|
|
267
|
-
};
|
|
268
|
-
type MigrationForeign = {
|
|
269
|
-
columns: string[];
|
|
270
|
-
to: string;
|
|
271
|
-
onUpdate: RelationOn;
|
|
272
|
-
onDelete: RelationOn;
|
|
273
|
-
};
|
|
274
|
-
type MigrationJoinTable = {
|
|
275
|
-
table: string;
|
|
276
|
-
indexes: MigrationIndex[];
|
|
277
|
-
columns: MigrationColumn[];
|
|
278
|
-
foreigns: MigrationForeign[];
|
|
279
|
-
};
|
|
280
|
-
type MigrationSet = {
|
|
281
|
-
table: string;
|
|
282
|
-
columns: MigrationColumn[];
|
|
283
|
-
indexes: MigrationIndex[];
|
|
284
|
-
foreigns: MigrationForeign[];
|
|
285
|
-
};
|
|
286
|
-
type MigrationSetAndJoinTable = MigrationSet & {
|
|
287
|
-
joinTables: MigrationJoinTable[];
|
|
288
|
-
};
|
|
289
|
-
type GenMigrationCode = {
|
|
290
|
-
title: string;
|
|
291
|
-
table: string;
|
|
292
|
-
type: "normal" | "foreign";
|
|
293
|
-
formatted: string | null;
|
|
294
|
-
};
|
|
295
|
-
type ApiParam = {
|
|
296
|
-
name: string;
|
|
297
|
-
type: ApiParamType;
|
|
298
|
-
optional: boolean;
|
|
299
|
-
defaultDef?: string;
|
|
300
|
-
};
|
|
301
|
-
declare namespace ApiParamType {
|
|
302
|
-
type Object = {
|
|
303
|
-
t: "object";
|
|
304
|
-
props: ApiParam[];
|
|
305
|
-
};
|
|
306
|
-
type Union = {
|
|
307
|
-
t: "union";
|
|
308
|
-
types: ApiParamType[];
|
|
309
|
-
};
|
|
310
|
-
type Intersection = {
|
|
311
|
-
t: "intersection";
|
|
312
|
-
types: ApiParamType[];
|
|
313
|
-
};
|
|
314
|
-
type StringLiteral = {
|
|
315
|
-
t: "string-literal";
|
|
316
|
-
value: string;
|
|
317
|
-
};
|
|
318
|
-
type NumericLiteral = {
|
|
319
|
-
t: "numeric-literal";
|
|
320
|
-
value: number;
|
|
321
|
-
};
|
|
322
|
-
type Array = {
|
|
323
|
-
t: "array";
|
|
324
|
-
elementsType: ApiParamType;
|
|
325
|
-
};
|
|
326
|
-
type Ref = {
|
|
327
|
-
t: "ref";
|
|
328
|
-
id: string;
|
|
329
|
-
args?: ApiParamType[];
|
|
330
|
-
};
|
|
331
|
-
type IndexedAccess = {
|
|
332
|
-
t: "indexed-access";
|
|
333
|
-
object: ApiParamType;
|
|
334
|
-
index: ApiParamType;
|
|
335
|
-
};
|
|
336
|
-
type TupleType = {
|
|
337
|
-
t: "tuple-type";
|
|
338
|
-
elements: ApiParamType[];
|
|
339
|
-
};
|
|
340
|
-
type Pick = Ref & {
|
|
341
|
-
t: "ref";
|
|
342
|
-
id: "Pick";
|
|
343
|
-
};
|
|
344
|
-
type Omit = Ref & {
|
|
345
|
-
t: "ref";
|
|
346
|
-
id: "Omit";
|
|
347
|
-
};
|
|
348
|
-
type Partial = Ref & {
|
|
349
|
-
t: "ref";
|
|
350
|
-
id: "Partial";
|
|
351
|
-
};
|
|
352
|
-
type Promise = Ref & {
|
|
353
|
-
t: "ref";
|
|
354
|
-
id: "Promise";
|
|
355
|
-
};
|
|
356
|
-
type Context = Ref & {
|
|
357
|
-
t: "ref";
|
|
358
|
-
id: "Context";
|
|
359
|
-
};
|
|
360
|
-
type TypeParam = {
|
|
361
|
-
t: "type-param";
|
|
362
|
-
id: string;
|
|
363
|
-
constraint?: ApiParamType;
|
|
364
|
-
};
|
|
365
|
-
function isObject(v: any): v is ApiParamType.Object;
|
|
366
|
-
function isUnion(v: any): v is ApiParamType.Union;
|
|
367
|
-
function isIntersection(v: any): v is ApiParamType.Intersection;
|
|
368
|
-
function isStringLiteral(v: any): v is ApiParamType.StringLiteral;
|
|
369
|
-
function isNumericLiteral(v: any): v is ApiParamType.NumericLiteral;
|
|
370
|
-
function isArray(v: any): v is ApiParamType.Array;
|
|
371
|
-
function isRef(v: any): v is ApiParamType.Ref;
|
|
372
|
-
function isIndexedAccess(v: any): v is ApiParamType.IndexedAccess;
|
|
373
|
-
function isTupleType(v: any): v is ApiParamType.TupleType;
|
|
374
|
-
function isPick(v: any): v is ApiParamType.Pick;
|
|
375
|
-
function isOmit(v: any): v is ApiParamType.Omit;
|
|
376
|
-
function isPartial(v: any): v is ApiParamType.Partial;
|
|
377
|
-
function isPromise(v: any): v is ApiParamType.Promise;
|
|
378
|
-
function isContext(v: any): v is ApiParamType.Context;
|
|
379
|
-
function isRefKnex(v: any): v is ApiParamType.Ref;
|
|
380
|
-
function isTypeParam(v: any): v is ApiParamType.TypeParam;
|
|
381
|
-
}
|
|
382
|
-
type ApiParamType = "string" | "number" | "boolean" | "null" | "undefined" | "void" | "any" | "unknown" | "true" | "false" | ApiParamType.StringLiteral | ApiParamType.NumericLiteral | ApiParamType.Object | ApiParamType.Union | ApiParamType.Intersection | ApiParamType.Array | ApiParamType.Ref | ApiParamType.IndexedAccess | ApiParamType.TypeParam | ApiParamType.TupleType;
|
|
383
|
-
declare const RenderingNode: z.ZodAny;
|
|
384
|
-
type RenderingNode = {
|
|
385
|
-
name: string;
|
|
386
|
-
label: string;
|
|
387
|
-
renderType: "string-plain" | "string-image" | "string-datetime" | "string-date" | "number-plain" | "number-id" | "number-fk_id" | "boolean" | "enums" | "array" | "array-images" | "object" | "object-pick" | "record";
|
|
388
|
-
zodType: z.ZodTypeAny;
|
|
389
|
-
element?: RenderingNode;
|
|
390
|
-
children?: RenderingNode[];
|
|
391
|
-
config?: {
|
|
392
|
-
picked: string;
|
|
393
|
-
};
|
|
394
|
-
optional?: boolean;
|
|
395
|
-
nullable?: boolean;
|
|
396
|
-
};
|
|
397
|
-
declare const TemplateOptions: z.ZodObject<{
|
|
398
|
-
entity: z.ZodObject<{
|
|
399
|
-
entityId: z.ZodString;
|
|
400
|
-
parentId: z.ZodOptional<z.ZodString>;
|
|
401
|
-
title: z.ZodString;
|
|
402
|
-
table: z.ZodOptional<z.ZodString>;
|
|
403
|
-
props: z.ZodOptional<z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">>;
|
|
404
|
-
indexes: z.ZodOptional<z.ZodArray<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>, "many">>;
|
|
405
|
-
subsets: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
406
|
-
enums: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
407
|
-
}, "strip", z.ZodTypeAny, {
|
|
408
|
-
entityId: string;
|
|
409
|
-
title: string;
|
|
410
|
-
parentId?: string | undefined;
|
|
411
|
-
table?: string | undefined;
|
|
412
|
-
props?: {}[] | undefined;
|
|
413
|
-
indexes?: {}[] | undefined;
|
|
414
|
-
subsets?: {} | undefined;
|
|
415
|
-
enums?: {} | undefined;
|
|
416
|
-
}, {
|
|
417
|
-
entityId: string;
|
|
418
|
-
title: string;
|
|
419
|
-
parentId?: string | undefined;
|
|
420
|
-
table?: string | undefined;
|
|
421
|
-
props?: {}[] | undefined;
|
|
422
|
-
indexes?: {}[] | undefined;
|
|
423
|
-
subsets?: {} | undefined;
|
|
424
|
-
enums?: {} | undefined;
|
|
425
|
-
}>;
|
|
426
|
-
init_types: z.ZodObject<{
|
|
427
|
-
entityId: z.ZodString;
|
|
428
|
-
}, "strip", z.ZodTypeAny, {
|
|
429
|
-
entityId: string;
|
|
430
|
-
}, {
|
|
431
|
-
entityId: string;
|
|
432
|
-
}>;
|
|
433
|
-
generated: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
434
|
-
generated_sso: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
435
|
-
generated_http: z.ZodObject<{
|
|
436
|
-
entityId: z.ZodString;
|
|
437
|
-
}, "strip", z.ZodTypeAny, {
|
|
438
|
-
entityId: string;
|
|
439
|
-
}, {
|
|
440
|
-
entityId: string;
|
|
441
|
-
}>;
|
|
442
|
-
model: z.ZodObject<{
|
|
443
|
-
entityId: z.ZodString;
|
|
444
|
-
defaultSearchField: z.ZodString;
|
|
445
|
-
defaultOrderBy: z.ZodString;
|
|
446
|
-
}, "strip", z.ZodTypeAny, {
|
|
447
|
-
entityId: string;
|
|
448
|
-
defaultSearchField: string;
|
|
449
|
-
defaultOrderBy: string;
|
|
450
|
-
}, {
|
|
451
|
-
entityId: string;
|
|
452
|
-
defaultSearchField: string;
|
|
453
|
-
defaultOrderBy: string;
|
|
454
|
-
}>;
|
|
455
|
-
model_test: z.ZodObject<{
|
|
456
|
-
entityId: z.ZodString;
|
|
457
|
-
}, "strip", z.ZodTypeAny, {
|
|
458
|
-
entityId: string;
|
|
459
|
-
}, {
|
|
460
|
-
entityId: string;
|
|
461
|
-
}>;
|
|
462
|
-
bridge: z.ZodObject<{
|
|
463
|
-
entityId: z.ZodString;
|
|
464
|
-
}, "strip", z.ZodTypeAny, {
|
|
465
|
-
entityId: string;
|
|
466
|
-
}, {
|
|
467
|
-
entityId: string;
|
|
468
|
-
}>;
|
|
469
|
-
service: z.ZodObject<{
|
|
470
|
-
entityId: z.ZodString;
|
|
471
|
-
}, "strip", z.ZodTypeAny, {
|
|
472
|
-
entityId: string;
|
|
473
|
-
}, {
|
|
474
|
-
entityId: string;
|
|
475
|
-
}>;
|
|
476
|
-
view_list: z.ZodObject<{
|
|
477
|
-
entityId: z.ZodString;
|
|
478
|
-
extra: z.ZodUnknown;
|
|
479
|
-
}, "strip", z.ZodTypeAny, {
|
|
480
|
-
entityId: string;
|
|
481
|
-
extra?: unknown;
|
|
482
|
-
}, {
|
|
483
|
-
entityId: string;
|
|
484
|
-
extra?: unknown;
|
|
485
|
-
}>;
|
|
486
|
-
view_list_columns: z.ZodObject<{
|
|
487
|
-
entityId: z.ZodString;
|
|
488
|
-
columns: z.ZodArray<z.ZodObject<{
|
|
489
|
-
name: z.ZodString;
|
|
490
|
-
label: z.ZodString;
|
|
491
|
-
tc: z.ZodString;
|
|
492
|
-
}, "strip", z.ZodTypeAny, {
|
|
493
|
-
name: string;
|
|
494
|
-
label: string;
|
|
495
|
-
tc: string;
|
|
496
|
-
}, {
|
|
497
|
-
name: string;
|
|
498
|
-
label: string;
|
|
499
|
-
tc: string;
|
|
500
|
-
}>, "many">;
|
|
501
|
-
columnImports: z.ZodString;
|
|
502
|
-
}, "strip", z.ZodTypeAny, {
|
|
503
|
-
entityId: string;
|
|
504
|
-
columns: {
|
|
505
|
-
name: string;
|
|
506
|
-
label: string;
|
|
507
|
-
tc: string;
|
|
508
|
-
}[];
|
|
509
|
-
columnImports: string;
|
|
510
|
-
}, {
|
|
511
|
-
entityId: string;
|
|
512
|
-
columns: {
|
|
513
|
-
name: string;
|
|
514
|
-
label: string;
|
|
515
|
-
tc: string;
|
|
516
|
-
}[];
|
|
517
|
-
columnImports: string;
|
|
518
|
-
}>;
|
|
519
|
-
view_search_input: z.ZodObject<{
|
|
520
|
-
entityId: z.ZodString;
|
|
521
|
-
}, "strip", z.ZodTypeAny, {
|
|
522
|
-
entityId: string;
|
|
523
|
-
}, {
|
|
524
|
-
entityId: string;
|
|
525
|
-
}>;
|
|
526
|
-
view_form: z.ZodObject<{
|
|
527
|
-
entityId: z.ZodString;
|
|
528
|
-
}, "strip", z.ZodTypeAny, {
|
|
529
|
-
entityId: string;
|
|
530
|
-
}, {
|
|
531
|
-
entityId: string;
|
|
532
|
-
}>;
|
|
533
|
-
view_id_all_select: z.ZodObject<{
|
|
534
|
-
entityId: z.ZodString;
|
|
535
|
-
}, "strip", z.ZodTypeAny, {
|
|
536
|
-
entityId: string;
|
|
537
|
-
}, {
|
|
538
|
-
entityId: string;
|
|
539
|
-
}>;
|
|
540
|
-
view_id_async_select: z.ZodObject<{
|
|
541
|
-
entityId: z.ZodString;
|
|
542
|
-
textField: z.ZodString;
|
|
543
|
-
}, "strip", z.ZodTypeAny, {
|
|
544
|
-
entityId: string;
|
|
545
|
-
textField: string;
|
|
546
|
-
}, {
|
|
547
|
-
entityId: string;
|
|
548
|
-
textField: string;
|
|
549
|
-
}>;
|
|
550
|
-
view_enums_select: z.ZodObject<{
|
|
551
|
-
entityId: z.ZodString;
|
|
552
|
-
enumId: z.ZodString;
|
|
553
|
-
}, "strip", z.ZodTypeAny, {
|
|
554
|
-
entityId: string;
|
|
555
|
-
enumId: string;
|
|
556
|
-
}, {
|
|
557
|
-
entityId: string;
|
|
558
|
-
enumId: string;
|
|
559
|
-
}>;
|
|
560
|
-
view_enums_dropdown: z.ZodObject<{
|
|
561
|
-
entityId: z.ZodString;
|
|
562
|
-
enumId: z.ZodString;
|
|
563
|
-
}, "strip", z.ZodTypeAny, {
|
|
564
|
-
entityId: string;
|
|
565
|
-
enumId: string;
|
|
566
|
-
}, {
|
|
567
|
-
entityId: string;
|
|
568
|
-
enumId: string;
|
|
569
|
-
}>;
|
|
570
|
-
view_enums_buttonset: z.ZodObject<{
|
|
571
|
-
entityId: z.ZodString;
|
|
572
|
-
enumId: z.ZodString;
|
|
573
|
-
}, "strip", z.ZodTypeAny, {
|
|
574
|
-
entityId: string;
|
|
575
|
-
enumId: string;
|
|
576
|
-
}, {
|
|
577
|
-
entityId: string;
|
|
578
|
-
enumId: string;
|
|
579
|
-
}>;
|
|
580
|
-
}, "strip", z.ZodTypeAny, {
|
|
581
|
-
entity: {
|
|
582
|
-
entityId: string;
|
|
583
|
-
title: string;
|
|
584
|
-
parentId?: string | undefined;
|
|
585
|
-
table?: string | undefined;
|
|
586
|
-
props?: {}[] | undefined;
|
|
587
|
-
indexes?: {}[] | undefined;
|
|
588
|
-
subsets?: {} | undefined;
|
|
589
|
-
enums?: {} | undefined;
|
|
590
|
-
};
|
|
591
|
-
init_types: {
|
|
592
|
-
entityId: string;
|
|
593
|
-
};
|
|
594
|
-
generated: {};
|
|
595
|
-
generated_sso: {};
|
|
596
|
-
generated_http: {
|
|
597
|
-
entityId: string;
|
|
598
|
-
};
|
|
599
|
-
model: {
|
|
600
|
-
entityId: string;
|
|
601
|
-
defaultSearchField: string;
|
|
602
|
-
defaultOrderBy: string;
|
|
603
|
-
};
|
|
604
|
-
model_test: {
|
|
605
|
-
entityId: string;
|
|
606
|
-
};
|
|
607
|
-
bridge: {
|
|
608
|
-
entityId: string;
|
|
609
|
-
};
|
|
610
|
-
service: {
|
|
611
|
-
entityId: string;
|
|
612
|
-
};
|
|
613
|
-
view_list: {
|
|
614
|
-
entityId: string;
|
|
615
|
-
extra?: unknown;
|
|
616
|
-
};
|
|
617
|
-
view_list_columns: {
|
|
618
|
-
entityId: string;
|
|
619
|
-
columns: {
|
|
620
|
-
name: string;
|
|
621
|
-
label: string;
|
|
622
|
-
tc: string;
|
|
623
|
-
}[];
|
|
624
|
-
columnImports: string;
|
|
625
|
-
};
|
|
626
|
-
view_search_input: {
|
|
627
|
-
entityId: string;
|
|
628
|
-
};
|
|
629
|
-
view_form: {
|
|
630
|
-
entityId: string;
|
|
631
|
-
};
|
|
632
|
-
view_id_all_select: {
|
|
633
|
-
entityId: string;
|
|
634
|
-
};
|
|
635
|
-
view_id_async_select: {
|
|
636
|
-
entityId: string;
|
|
637
|
-
textField: string;
|
|
638
|
-
};
|
|
639
|
-
view_enums_select: {
|
|
640
|
-
entityId: string;
|
|
641
|
-
enumId: string;
|
|
642
|
-
};
|
|
643
|
-
view_enums_dropdown: {
|
|
644
|
-
entityId: string;
|
|
645
|
-
enumId: string;
|
|
646
|
-
};
|
|
647
|
-
view_enums_buttonset: {
|
|
648
|
-
entityId: string;
|
|
649
|
-
enumId: string;
|
|
650
|
-
};
|
|
651
|
-
}, {
|
|
652
|
-
entity: {
|
|
653
|
-
entityId: string;
|
|
654
|
-
title: string;
|
|
655
|
-
parentId?: string | undefined;
|
|
656
|
-
table?: string | undefined;
|
|
657
|
-
props?: {}[] | undefined;
|
|
658
|
-
indexes?: {}[] | undefined;
|
|
659
|
-
subsets?: {} | undefined;
|
|
660
|
-
enums?: {} | undefined;
|
|
661
|
-
};
|
|
662
|
-
init_types: {
|
|
663
|
-
entityId: string;
|
|
664
|
-
};
|
|
665
|
-
generated: {};
|
|
666
|
-
generated_sso: {};
|
|
667
|
-
generated_http: {
|
|
668
|
-
entityId: string;
|
|
669
|
-
};
|
|
670
|
-
model: {
|
|
671
|
-
entityId: string;
|
|
672
|
-
defaultSearchField: string;
|
|
673
|
-
defaultOrderBy: string;
|
|
674
|
-
};
|
|
675
|
-
model_test: {
|
|
676
|
-
entityId: string;
|
|
677
|
-
};
|
|
678
|
-
bridge: {
|
|
679
|
-
entityId: string;
|
|
680
|
-
};
|
|
681
|
-
service: {
|
|
682
|
-
entityId: string;
|
|
683
|
-
};
|
|
684
|
-
view_list: {
|
|
685
|
-
entityId: string;
|
|
686
|
-
extra?: unknown;
|
|
687
|
-
};
|
|
688
|
-
view_list_columns: {
|
|
689
|
-
entityId: string;
|
|
690
|
-
columns: {
|
|
691
|
-
name: string;
|
|
692
|
-
label: string;
|
|
693
|
-
tc: string;
|
|
694
|
-
}[];
|
|
695
|
-
columnImports: string;
|
|
696
|
-
};
|
|
697
|
-
view_search_input: {
|
|
698
|
-
entityId: string;
|
|
699
|
-
};
|
|
700
|
-
view_form: {
|
|
701
|
-
entityId: string;
|
|
702
|
-
};
|
|
703
|
-
view_id_all_select: {
|
|
704
|
-
entityId: string;
|
|
705
|
-
};
|
|
706
|
-
view_id_async_select: {
|
|
707
|
-
entityId: string;
|
|
708
|
-
textField: string;
|
|
709
|
-
};
|
|
710
|
-
view_enums_select: {
|
|
711
|
-
entityId: string;
|
|
712
|
-
enumId: string;
|
|
713
|
-
};
|
|
714
|
-
view_enums_dropdown: {
|
|
715
|
-
entityId: string;
|
|
716
|
-
enumId: string;
|
|
717
|
-
};
|
|
718
|
-
view_enums_buttonset: {
|
|
719
|
-
entityId: string;
|
|
720
|
-
enumId: string;
|
|
721
|
-
};
|
|
722
|
-
}>;
|
|
723
|
-
type TemplateOptions = z.infer<typeof TemplateOptions>;
|
|
724
|
-
declare const TemplateKey: z.ZodEnum<["entity", "init_types", "generated", "generated_sso", "generated_http", "model", "model_test", "bridge", "service", "view_list", "view_list_columns", "view_search_input", "view_form", "view_id_all_select", "view_id_async_select", "view_enums_select", "view_enums_dropdown", "view_enums_buttonset"]>;
|
|
725
|
-
type TemplateKey = z.infer<typeof TemplateKey>;
|
|
726
|
-
declare const GenerateOptions: z.ZodObject<{
|
|
727
|
-
overwrite: z.ZodOptional<z.ZodBoolean>;
|
|
728
|
-
}, "strip", z.ZodTypeAny, {
|
|
729
|
-
overwrite?: boolean | undefined;
|
|
730
|
-
}, {
|
|
731
|
-
overwrite?: boolean | undefined;
|
|
732
|
-
}>;
|
|
733
|
-
type GenerateOptions = z.infer<typeof GenerateOptions>;
|
|
734
|
-
declare const PathAndCode: z.ZodObject<{
|
|
735
|
-
path: z.ZodString;
|
|
736
|
-
code: z.ZodString;
|
|
737
|
-
}, "strip", z.ZodTypeAny, {
|
|
738
|
-
path: string;
|
|
739
|
-
code: string;
|
|
740
|
-
}, {
|
|
741
|
-
path: string;
|
|
742
|
-
code: string;
|
|
743
|
-
}>;
|
|
744
|
-
type PathAndCode = z.infer<typeof PathAndCode>;
|
|
745
|
-
type FixtureSearchOptions = {
|
|
746
|
-
entityId: string;
|
|
747
|
-
field: string;
|
|
748
|
-
value: string;
|
|
749
|
-
searchType: "equals" | "like";
|
|
750
|
-
};
|
|
751
|
-
type FixtureRecord = {
|
|
752
|
-
fixtureId: string;
|
|
753
|
-
entityId: string;
|
|
754
|
-
id: number;
|
|
755
|
-
columns: {
|
|
756
|
-
[key: string]: {
|
|
757
|
-
prop: EntityProp;
|
|
758
|
-
value: any;
|
|
759
|
-
};
|
|
760
|
-
};
|
|
761
|
-
fetchedRecords: string[];
|
|
762
|
-
belongsRecords: string[];
|
|
763
|
-
target?: FixtureRecord;
|
|
764
|
-
unique?: FixtureRecord;
|
|
765
|
-
override?: boolean;
|
|
766
|
-
};
|
|
767
|
-
type FixtureImportResult = {
|
|
768
|
-
entityId: string;
|
|
769
|
-
data: {
|
|
770
|
-
[key: string]: any;
|
|
771
|
-
};
|
|
772
|
-
};
|
|
8
|
+
import knex, { Knex } from 'knex';
|
|
9
|
+
import * as kysely from 'kysely';
|
|
10
|
+
import { Kysely } from 'kysely';
|
|
11
|
+
import 'mysql2';
|
|
773
12
|
|
|
774
13
|
type ServiceClient = "axios" | "axios-multipart" | "swr" | "socketio" | "window-fetch";
|
|
775
14
|
type ApiDecoratorOptions = {
|
|
@@ -951,6 +190,7 @@ declare class Syncer {
|
|
|
951
190
|
models: {
|
|
952
191
|
[modelName: string]: unknown;
|
|
953
192
|
};
|
|
193
|
+
isSyncing: boolean;
|
|
954
194
|
get checksumsPath(): string;
|
|
955
195
|
constructor();
|
|
956
196
|
sync(): Promise<void>;
|
|
@@ -1023,27 +263,8 @@ declare class Syncer {
|
|
|
1023
263
|
}>;
|
|
1024
264
|
}
|
|
1025
265
|
|
|
1026
|
-
type DBPreset = "w" | "r";
|
|
1027
|
-
|
|
1028
|
-
type SonamuDBConfig = {
|
|
1029
|
-
development_master: Knex.Config;
|
|
1030
|
-
development_slave: Knex.Config;
|
|
1031
|
-
test: Knex.Config;
|
|
1032
|
-
fixture_local: Knex.Config;
|
|
1033
|
-
fixture_remote: Knex.Config;
|
|
1034
|
-
production_master: Knex.Config;
|
|
1035
|
-
production_slave: Knex.Config;
|
|
1036
|
-
};
|
|
1037
|
-
declare class DBClass {
|
|
1038
|
-
private wdb?;
|
|
1039
|
-
private rdb?;
|
|
1040
|
-
readKnexfile(): Promise<SonamuDBConfig>;
|
|
1041
|
-
getDB(which: DBPreset): Knex;
|
|
1042
|
-
destroy(): Promise<void>;
|
|
1043
|
-
}
|
|
1044
|
-
declare const DB: DBClass;
|
|
1045
|
-
|
|
1046
266
|
type SonamuConfig = {
|
|
267
|
+
projectName?: string;
|
|
1047
268
|
api: {
|
|
1048
269
|
dir: string;
|
|
1049
270
|
};
|
|
@@ -1091,6 +312,9 @@ declare class SonamuClass {
|
|
|
1091
312
|
private _dbConfig;
|
|
1092
313
|
set dbConfig(dbConfig: SonamuDBConfig);
|
|
1093
314
|
get dbConfig(): SonamuDBConfig;
|
|
315
|
+
private _dbClient;
|
|
316
|
+
set dbClient(_dbClient: DatabaseDriver);
|
|
317
|
+
get dbClient(): DatabaseDriver;
|
|
1094
318
|
private _syncer;
|
|
1095
319
|
set syncer(syncer: Syncer);
|
|
1096
320
|
get syncer(): Syncer;
|
|
@@ -1109,88 +333,208 @@ declare class SonamuClass {
|
|
|
1109
333
|
}
|
|
1110
334
|
declare const Sonamu: SonamuClass;
|
|
1111
335
|
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
keyword?: string;
|
|
1126
|
-
queryMode?: "list" | "count" | "both";
|
|
336
|
+
declare abstract class DBClass {
|
|
337
|
+
_fullConfig?: SonamuDBConfig;
|
|
338
|
+
set fullConfig(config: SonamuDBConfig);
|
|
339
|
+
get fullConfig(): SonamuDBConfig;
|
|
340
|
+
abstract tdb: KnexClient | KyselyClient;
|
|
341
|
+
abstract fdb: KnexClient | KyselyClient;
|
|
342
|
+
abstract testInit(): Promise<void>;
|
|
343
|
+
abstract getDB(which: DBPreset): Knex | Kysely<Database>;
|
|
344
|
+
abstract destroy(): Promise<void>;
|
|
345
|
+
abstract raw(db: Knex | Kysely<Database>, query: string): any;
|
|
346
|
+
getBaseConfig(rootPath: string): Promise<SonamuDBBaseConfig>;
|
|
347
|
+
getCurrentConfig(which?: DBPreset): KnexConfig | KyselyConfig;
|
|
348
|
+
toClient(db: Knex | Kysely<Database>): KnexClient | KyselyClient;
|
|
1127
349
|
}
|
|
1128
350
|
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
351
|
+
declare class DBKnexClass extends DBClass {
|
|
352
|
+
migrationTable: string;
|
|
353
|
+
generator: KnexGenerator;
|
|
354
|
+
baseConfig?: KnexBaseConfig;
|
|
355
|
+
_fullConfig?: SonamuKnexDBConfig;
|
|
356
|
+
set fullConfig(config: SonamuKnexDBConfig);
|
|
357
|
+
get fullConfig(): SonamuKnexDBConfig;
|
|
358
|
+
private wdb?;
|
|
359
|
+
private rdb?;
|
|
360
|
+
private _tdb;
|
|
361
|
+
set tdb(tdb: KnexClient);
|
|
362
|
+
get tdb(): KnexClient;
|
|
363
|
+
private _fdb;
|
|
364
|
+
set fdb(fdb: KnexClient);
|
|
365
|
+
get fdb(): KnexClient;
|
|
366
|
+
get connectionInfo(): {
|
|
367
|
+
development_master: {
|
|
368
|
+
host: string;
|
|
369
|
+
port: number;
|
|
370
|
+
database: string | undefined;
|
|
371
|
+
user: string | undefined;
|
|
372
|
+
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
373
|
+
};
|
|
374
|
+
development_slave: {
|
|
375
|
+
host: string;
|
|
376
|
+
port: number;
|
|
377
|
+
database: string | undefined;
|
|
378
|
+
user: string | undefined;
|
|
379
|
+
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
380
|
+
};
|
|
381
|
+
test: {
|
|
382
|
+
host: string;
|
|
383
|
+
port: number;
|
|
384
|
+
database: string | undefined;
|
|
385
|
+
user: string | undefined;
|
|
386
|
+
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
387
|
+
};
|
|
388
|
+
fixture_local: {
|
|
389
|
+
host: string;
|
|
390
|
+
port: number;
|
|
391
|
+
database: string | undefined;
|
|
392
|
+
user: string | undefined;
|
|
393
|
+
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
394
|
+
};
|
|
395
|
+
fixture_remote: {
|
|
396
|
+
host: string;
|
|
397
|
+
port: number;
|
|
398
|
+
database: string | undefined;
|
|
399
|
+
user: string | undefined;
|
|
400
|
+
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
401
|
+
};
|
|
402
|
+
production_master: {
|
|
403
|
+
host: string;
|
|
404
|
+
port: number;
|
|
405
|
+
database: string | undefined;
|
|
406
|
+
user: string | undefined;
|
|
407
|
+
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
408
|
+
};
|
|
409
|
+
production_slave: {
|
|
410
|
+
host: string;
|
|
411
|
+
port: number;
|
|
412
|
+
database: string | undefined;
|
|
413
|
+
user: string | undefined;
|
|
414
|
+
password: string | ((() => string | Promise<string>) & string) | undefined;
|
|
415
|
+
};
|
|
416
|
+
};
|
|
1146
417
|
constructor();
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
418
|
+
init(config: KnexBaseConfig): void;
|
|
419
|
+
testInit(): Promise<void>;
|
|
420
|
+
getDB(which: DBPreset): knex.Knex<any, any[]>;
|
|
421
|
+
getClient(mode: keyof SonamuKnexDBConfig): KnexClient;
|
|
422
|
+
destroy(): Promise<void>;
|
|
423
|
+
testDestroy(): Promise<void>;
|
|
424
|
+
raw(db: Knex, query: string): Knex.Raw<any>;
|
|
425
|
+
private generateDBConfig;
|
|
426
|
+
/**
|
|
427
|
+
* keys에 해당하는 설정들을 중복없이 가져옵니다. (host/port/database가 같은 설정은 중복으로 처리합니다.)
|
|
428
|
+
*/
|
|
429
|
+
getUniqueConfigs(keys: (keyof SonamuKnexDBConfig)[]): {
|
|
430
|
+
connKey: keyof SonamuKnexDBConfig;
|
|
431
|
+
options: KnexConfig;
|
|
432
|
+
}[];
|
|
1159
433
|
}
|
|
1160
434
|
|
|
1161
|
-
declare class
|
|
1162
|
-
|
|
1163
|
-
|
|
435
|
+
declare class KyselyGenerator extends CodeGenerator {
|
|
436
|
+
generateCreateCode_ColumnAndIndexes(table: string, columns: MigrationColumn[], indexes: MigrationIndex[]): Promise<GenMigrationCode>;
|
|
437
|
+
generateCreateCode_Foreign(table: string, foreigns: MigrationForeign[]): Promise<GenMigrationCode[]>;
|
|
438
|
+
generateAlterCode_ColumnAndIndexes(table: string, entityColumns: MigrationColumn[], entityIndexes: MigrationIndex[], dbColumns: MigrationColumn[], dbIndexes: MigrationIndex[]): Promise<GenMigrationCode[]>;
|
|
439
|
+
generateAlterCode_Foreigns(table: string, entityForeigns: MigrationForeign[], dbForeigns: MigrationForeign[]): Promise<GenMigrationCode[]>;
|
|
440
|
+
generateModelTemplate(entityId: string, def: {
|
|
441
|
+
orderBy: string;
|
|
442
|
+
search: string;
|
|
443
|
+
}): string;
|
|
444
|
+
private genColumnDefinitions;
|
|
445
|
+
private genIndexDefinitions;
|
|
446
|
+
private genForeignDefinitions;
|
|
447
|
+
private getAlterColumnLinesTo;
|
|
448
|
+
private getAlterIndexLinesTo;
|
|
449
|
+
private createIndexName;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
declare class DBKyselyClass extends DBClass {
|
|
453
|
+
migrationTable: string;
|
|
454
|
+
generator: KyselyGenerator;
|
|
455
|
+
baseConfig?: KyselyBaseConfig;
|
|
456
|
+
_fullConfig?: SonamuKyselyDBConfig;
|
|
457
|
+
set fullConfig(config: SonamuKyselyDBConfig);
|
|
458
|
+
get fullConfig(): SonamuKyselyDBConfig;
|
|
459
|
+
private wdb?;
|
|
460
|
+
private rdb?;
|
|
461
|
+
private _tdb;
|
|
462
|
+
set tdb(tdb: KyselyClient);
|
|
463
|
+
get tdb(): KyselyClient;
|
|
464
|
+
private _fdb;
|
|
465
|
+
set fdb(fdb: KyselyClient);
|
|
466
|
+
get fdb(): KyselyClient;
|
|
467
|
+
get connectionInfo(): {
|
|
468
|
+
development_master: {
|
|
469
|
+
host: string;
|
|
470
|
+
port: number;
|
|
471
|
+
database: string | undefined;
|
|
472
|
+
user: string | undefined;
|
|
473
|
+
password: string | undefined;
|
|
474
|
+
};
|
|
475
|
+
development_slave: {
|
|
476
|
+
host: string;
|
|
477
|
+
port: number;
|
|
478
|
+
database: string | undefined;
|
|
479
|
+
user: string | undefined;
|
|
480
|
+
password: string | undefined;
|
|
481
|
+
};
|
|
482
|
+
test: {
|
|
483
|
+
host: string;
|
|
484
|
+
port: number;
|
|
485
|
+
database: string | undefined;
|
|
486
|
+
user: string | undefined;
|
|
487
|
+
password: string | undefined;
|
|
488
|
+
};
|
|
489
|
+
fixture_local: {
|
|
490
|
+
host: string;
|
|
491
|
+
port: number;
|
|
492
|
+
database: string | undefined;
|
|
493
|
+
user: string | undefined;
|
|
494
|
+
password: string | undefined;
|
|
495
|
+
};
|
|
496
|
+
fixture_remote: {
|
|
497
|
+
host: string;
|
|
498
|
+
port: number;
|
|
499
|
+
database: string | undefined;
|
|
500
|
+
user: string | undefined;
|
|
501
|
+
password: string | undefined;
|
|
502
|
+
};
|
|
503
|
+
production_master: {
|
|
504
|
+
host: string;
|
|
505
|
+
port: number;
|
|
506
|
+
database: string | undefined;
|
|
507
|
+
user: string | undefined;
|
|
508
|
+
password: string | undefined;
|
|
509
|
+
};
|
|
510
|
+
production_slave: {
|
|
511
|
+
host: string;
|
|
512
|
+
port: number;
|
|
513
|
+
database: string | undefined;
|
|
514
|
+
user: string | undefined;
|
|
515
|
+
password: string | undefined;
|
|
516
|
+
};
|
|
517
|
+
};
|
|
518
|
+
constructor();
|
|
519
|
+
init(config: KyselyBaseConfig): void;
|
|
520
|
+
testInit(): Promise<void>;
|
|
521
|
+
get config(): SonamuKyselyDBConfig;
|
|
522
|
+
getDB(which: DBPreset): Kysely<DatabaseExtend>;
|
|
523
|
+
getClient(mode: keyof SonamuKyselyDBConfig): KyselyClient;
|
|
1164
524
|
destroy(): Promise<void>;
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
db: Knex;
|
|
1176
|
-
select: (string | Knex.Raw)[];
|
|
1177
|
-
joins: SubsetQuery["joins"];
|
|
1178
|
-
virtual: string[];
|
|
1179
|
-
}) => Knex.QueryBuilder;
|
|
1180
|
-
baseTable?: string;
|
|
1181
|
-
debug?: boolean | "list" | "count";
|
|
1182
|
-
db?: Knex;
|
|
1183
|
-
optimizeCountQuery?: boolean;
|
|
1184
|
-
}): Promise<{
|
|
1185
|
-
rows: any[];
|
|
1186
|
-
total?: number | undefined;
|
|
1187
|
-
subsetQuery: SubsetQuery;
|
|
1188
|
-
qb: Knex.QueryBuilder;
|
|
1189
|
-
}>;
|
|
1190
|
-
getJoinClause(db: Knex<any, unknown>, join: SubsetQuery["joins"][number]): Knex.Raw<any>;
|
|
1191
|
-
getUpsertBuilder(): UpsertBuilder;
|
|
525
|
+
testDestroy(): Promise<void>;
|
|
526
|
+
raw(db: Kysely<Database>, query: string): Promise<kysely.QueryResult<unknown>>;
|
|
527
|
+
private generateDBConfig;
|
|
528
|
+
/**
|
|
529
|
+
* keys에 해당하는 설정들을 중복없이 가져옵니다. (host/port/database가 같은 설정은 중복으로 처리합니다.)
|
|
530
|
+
*/
|
|
531
|
+
getUniqueConfigs(keys: (keyof SonamuKyselyDBConfig)[]): {
|
|
532
|
+
connKey: keyof SonamuKyselyDBConfig;
|
|
533
|
+
options: KyselyConfig;
|
|
534
|
+
}[];
|
|
1192
535
|
}
|
|
1193
|
-
|
|
536
|
+
|
|
537
|
+
declare const DB: DBKnexClass | DBKyselyClass;
|
|
1194
538
|
|
|
1195
539
|
declare function setupErrorHandler(server: FastifyInstance): void;
|
|
1196
540
|
|
|
@@ -1325,10 +669,10 @@ type MigrationStatus = {
|
|
|
1325
669
|
declare class Migrator {
|
|
1326
670
|
readonly mode: MigratorMode;
|
|
1327
671
|
targets: {
|
|
1328
|
-
compare?:
|
|
1329
|
-
pending:
|
|
1330
|
-
shadow:
|
|
1331
|
-
apply:
|
|
672
|
+
compare?: KnexClient | KyselyClient;
|
|
673
|
+
pending: KnexClient | KyselyClient;
|
|
674
|
+
shadow: KnexClient | KyselyClient;
|
|
675
|
+
apply: (KnexClient | KyselyClient)[];
|
|
1332
676
|
};
|
|
1333
677
|
constructor(options: MigratorOptions);
|
|
1334
678
|
getMigrationCodes(): Promise<{
|
|
@@ -1355,55 +699,12 @@ declare class Migrator {
|
|
|
1355
699
|
applied: string[];
|
|
1356
700
|
}[]>;
|
|
1357
701
|
resetAll(): Promise<void>;
|
|
1358
|
-
compareMigrations(compareDB:
|
|
1359
|
-
getMigrationSetFromDB(compareDB:
|
|
702
|
+
compareMigrations(compareDB: KnexClient | KyselyClient): Promise<GenMigrationCode[]>;
|
|
703
|
+
getMigrationSetFromDB(compareDB: KnexClient | KyselyClient, table: string): Promise<MigrationSet | null>;
|
|
1360
704
|
resolveDBColType(colType: string, colField: string): Pick<MigrationColumn, "type" | "unsigned" | "length" | "precision" | "scale">;
|
|
1361
|
-
readTable(compareDB:
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
genIndexDefinitions(indexes: MigrationIndex[]): string[];
|
|
1365
|
-
genForeignDefinitions(table: string, foreigns: MigrationForeign[]): {
|
|
1366
|
-
up: string[];
|
|
1367
|
-
down: string[];
|
|
1368
|
-
};
|
|
1369
|
-
generateCreateCode_ColumnAndIndexes(table: string, columns: MigrationColumn[], indexes: MigrationIndex[]): Promise<GenMigrationCode>;
|
|
1370
|
-
generateCreateCode_Foreign(table: string, foreigns: MigrationForeign[]): Promise<GenMigrationCode[]>;
|
|
1371
|
-
showMigrationSet(which: string, migrationSet: MigrationSet): void;
|
|
1372
|
-
generateAlterCode_ColumnAndIndexes(table: string, entityColumns: MigrationColumn[], entityIndexes: MigrationIndex[], dbColumns: MigrationColumn[], dbIndexes: MigrationIndex[]): Promise<GenMigrationCode[]>;
|
|
1373
|
-
getAlterColumnsTo(entityColumns: MigrationColumn[], dbColumns: MigrationColumn[]): {
|
|
1374
|
-
add: MigrationColumn[];
|
|
1375
|
-
drop: MigrationColumn[];
|
|
1376
|
-
alter: MigrationColumn[];
|
|
1377
|
-
};
|
|
1378
|
-
getAlterColumnLinesTo(columnsTo: ReturnType<Migrator["getAlterColumnsTo"]>, entityColumns: MigrationColumn[]): {
|
|
1379
|
-
add: {
|
|
1380
|
-
up: string[];
|
|
1381
|
-
down: string[];
|
|
1382
|
-
};
|
|
1383
|
-
drop: {
|
|
1384
|
-
up: string[];
|
|
1385
|
-
down: string[];
|
|
1386
|
-
};
|
|
1387
|
-
alter: {
|
|
1388
|
-
up: string[];
|
|
1389
|
-
down: string[];
|
|
1390
|
-
};
|
|
1391
|
-
};
|
|
1392
|
-
getAlterIndexesTo(entityIndexes: MigrationIndex[], dbIndexes: MigrationIndex[]): {
|
|
1393
|
-
add: MigrationIndex[];
|
|
1394
|
-
drop: MigrationIndex[];
|
|
1395
|
-
};
|
|
1396
|
-
getAlterIndexLinesTo(indexesTo: ReturnType<Migrator["getAlterIndexesTo"]>, columnsTo: ReturnType<Migrator["getAlterColumnsTo"]>): {
|
|
1397
|
-
add: {
|
|
1398
|
-
up: string[];
|
|
1399
|
-
down: string[];
|
|
1400
|
-
};
|
|
1401
|
-
drop: {
|
|
1402
|
-
up: string[];
|
|
1403
|
-
down: string[];
|
|
1404
|
-
};
|
|
1405
|
-
};
|
|
1406
|
-
generateAlterCode_Foreigns(table: string, entityForeigns: MigrationForeign[], dbForeigns: MigrationForeign[]): Promise<GenMigrationCode[]>;
|
|
705
|
+
readTable(compareDB: KnexClient | KyselyClient, tableName: string): Promise<[DBColumn[], DBIndex[], DBForeign[]]>;
|
|
706
|
+
getMigrationSetFromEntity(entity: Entity): MigrationSetAndJoinTable;
|
|
707
|
+
showMigrationSet(which: "Entity" | "DB", migrationSet: MigrationSet): void;
|
|
1407
708
|
destroy(): Promise<void>;
|
|
1408
709
|
}
|
|
1409
710
|
type DBColumn = {
|
|
@@ -1441,16 +742,10 @@ type DBForeign = {
|
|
|
1441
742
|
};
|
|
1442
743
|
|
|
1443
744
|
declare class FixtureManagerClass {
|
|
1444
|
-
private
|
|
1445
|
-
set tdb(tdb: Knex);
|
|
1446
|
-
get tdb(): Knex;
|
|
1447
|
-
private _fdb;
|
|
1448
|
-
set fdb(fdb: Knex);
|
|
1449
|
-
get fdb(): Knex;
|
|
1450
|
-
private dependencyGraph;
|
|
745
|
+
private relationGraph;
|
|
1451
746
|
init(): void;
|
|
1452
747
|
cleanAndSeed(usingTables?: string[]): Promise<void>;
|
|
1453
|
-
getChecksum(db:
|
|
748
|
+
getChecksum(db: KnexClient | KyselyClient, tableName: string): Promise<string>;
|
|
1454
749
|
sync(): Promise<void>;
|
|
1455
750
|
importFixture(entityId: string, ids: number[]): Promise<void>;
|
|
1456
751
|
getImportQueries(entityId: string, field: string, id: number): Promise<string[]>;
|
|
@@ -1458,12 +753,10 @@ declare class FixtureManagerClass {
|
|
|
1458
753
|
getFixtures(sourceDBName: keyof SonamuDBConfig, targetDBName: keyof SonamuDBConfig, searchOptions: FixtureSearchOptions): Promise<FixtureRecord[]>;
|
|
1459
754
|
createFixtureRecord(entity: Entity, row: any, options?: {
|
|
1460
755
|
singleRecord?: boolean;
|
|
1461
|
-
_db?:
|
|
1462
|
-
}
|
|
756
|
+
_db?: KnexClient | KyselyClient;
|
|
757
|
+
}): Promise<FixtureRecord[]>;
|
|
1463
758
|
insertFixtures(dbName: keyof SonamuDBConfig, _fixtures: FixtureRecord[]): Promise<FixtureImportResult[]>;
|
|
1464
|
-
private getInsertionOrder;
|
|
1465
759
|
private prepareInsertData;
|
|
1466
|
-
private buildDependencyGraph;
|
|
1467
760
|
private insertFixture;
|
|
1468
761
|
private handleManyToManyRelations;
|
|
1469
762
|
addFixtureLoader(code: string): Promise<void>;
|
|
@@ -1486,7 +779,8 @@ declare function importMultiple(filePaths: string[], doRefresh?: boolean): Promi
|
|
|
1486
779
|
imported: any;
|
|
1487
780
|
}[]>;
|
|
1488
781
|
declare function findAppRootPath(): Promise<string>;
|
|
1489
|
-
declare function findApiRootPath():
|
|
782
|
+
declare function findApiRootPath(): string;
|
|
1490
783
|
declare function nonNullable<T>(value: T): value is NonNullable<T>;
|
|
784
|
+
declare function hydrate<T>(rows: T[]): T[];
|
|
1491
785
|
|
|
1492
|
-
export { AlreadyProcessedException, type ApiDecoratorOptions,
|
|
786
|
+
export { AlreadyProcessedException, type ApiDecoratorOptions, ApiParam, ApiParamType, BadRequestException, BelongsToOneRelationProp, BigIntegerProp, BooleanProp, type Context, type ContextExtend, DB, DBPreset, Database, DatabaseDriver, DatabaseExtend, DateProp, DateTimeProp, DecimalProp, DistributiveOmit, DoubleProp, DuplicateRowException, Entity, EntityIndex, EntityJson, EntityManager, type EntityNamesRecord, EntityProp, EntityPropNode, EntitySubsetRow, EnumProp, type ExtendedApi, FixtureImportResult, FixtureManager, FixtureManagerClass, FixtureRecord, FixtureSearchOptions, FloatProp, GenMigrationCode, GenerateOptions, HasManyRelationProp, IntegerProp, InternalServerErrorException, JsonProp, KnexBaseConfig, KnexConfig, KyselyBaseConfig, KyselyConfig, ManyToManyRelationProp, MigrationColumn, MigrationForeign, MigrationIndex, MigrationSet, MigrationSetAndJoinTable, type MigrationStatus, Migrator, type MigratorOptions, NotFoundException, OneToOneRelationProp, PathAndCode, RelationProp, type RenderedTemplate, RenderingNode, type ServiceClient, ServiceUnavailableException, SoException, Sonamu, type SonamuConfig, SonamuDBBaseConfig, SonamuDBConfig, SonamuKnexDBConfig, SonamuKyselyDBConfig, type SonamuSecrets, StringProp, SubsetQuery, Syncer, TargetNotFoundException, TemplateKey, TemplateOptions, TextProp, TimeProp, TimestampProp, UnauthorizedException, UuidProp, VirtualProp, api, apiParamToTsCode, apiParamTypeToTsType, findApiRootPath, findAppRootPath, getTextTypeLength, getZodObjectFromApi, getZodObjectFromApiParams, getZodTypeFromApiParamType, globAsync, hydrate, i, importMultiple, isDaemonServer, isDevelopment, isInDocker, isLocal, isProduction, isRemote, isSoException, isStaging, isTest, nonNullable, p, propNodeToZodTypeDef, propToZodTypeDef, registeredApis, serializeZodType, setupErrorHandler, unwrapPromiseOnce, zodTypeToTsTypeDef, zodTypeToZodCode };
|