sonamu 0.0.42 → 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.
Files changed (208) hide show
  1. package/.pnp.cjs +1963 -951
  2. package/.pnp.loader.mjs +1816 -54
  3. package/.yarnrc.yml +1 -1
  4. package/dist/api/code-converters.d.ts +3 -3
  5. package/dist/api/code-converters.d.ts.map +1 -1
  6. package/dist/api/code-converters.js +5 -15
  7. package/dist/api/code-converters.js.map +1 -1
  8. package/dist/api/context.d.ts +1 -1
  9. package/dist/api/context.d.ts.map +1 -1
  10. package/dist/api/decorators.d.ts +3 -3
  11. package/dist/api/decorators.d.ts.map +1 -1
  12. package/dist/api/sonamu.d.ts +3 -3
  13. package/dist/api/sonamu.d.ts.map +1 -1
  14. package/dist/api/sonamu.js +6 -6
  15. package/dist/api/sonamu.js.map +1 -1
  16. package/dist/bin/cli.js +132 -33
  17. package/dist/bin/cli.js.map +1 -1
  18. package/dist/database/db.d.ts +2 -2
  19. package/dist/database/db.d.ts.map +1 -1
  20. package/dist/database/db.js +1 -1
  21. package/dist/database/db.js.map +1 -1
  22. package/dist/database/upsert-builder.d.ts +2 -2
  23. package/dist/database/upsert-builder.d.ts.map +1 -1
  24. package/dist/database/upsert-builder.js +10 -8
  25. package/dist/database/upsert-builder.js.map +1 -1
  26. package/dist/entity/entity-manager.d.ts +29 -0
  27. package/dist/entity/entity-manager.d.ts.map +1 -0
  28. package/dist/entity/entity-manager.js +128 -0
  29. package/dist/entity/entity-manager.js.map +1 -0
  30. package/dist/entity/entity-utils.d.ts +61 -0
  31. package/dist/entity/entity-utils.d.ts.map +1 -0
  32. package/dist/entity/entity-utils.js +121 -0
  33. package/dist/entity/entity-utils.js.map +1 -0
  34. package/dist/entity/entity.d.ts +49 -0
  35. package/dist/entity/entity.d.ts.map +1 -0
  36. package/dist/entity/entity.js +504 -0
  37. package/dist/entity/entity.js.map +1 -0
  38. package/dist/entity/migrator.d.ts +143 -0
  39. package/dist/entity/migrator.d.ts.map +1 -0
  40. package/dist/entity/migrator.js +1385 -0
  41. package/dist/entity/migrator.js.map +1 -0
  42. package/dist/entity/smd-utils.d.ts +61 -0
  43. package/dist/entity/smd-utils.d.ts.map +1 -0
  44. package/dist/entity/smd-utils.js +121 -0
  45. package/dist/entity/smd-utils.js.map +1 -0
  46. package/dist/index.d.ts +3 -3
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +3 -3
  49. package/dist/index.js.map +1 -1
  50. package/dist/smd/entity-manager.d.ts +28 -0
  51. package/dist/smd/entity-manager.d.ts.map +1 -0
  52. package/dist/smd/entity-manager.js +119 -0
  53. package/dist/smd/entity-manager.js.map +1 -0
  54. package/dist/smd/entity.d.ts +40 -0
  55. package/dist/smd/entity.d.ts.map +1 -0
  56. package/dist/smd/entity.js +430 -0
  57. package/dist/smd/entity.js.map +1 -0
  58. package/dist/smd/migrator.d.ts +2 -2
  59. package/dist/smd/migrator.d.ts.map +1 -1
  60. package/dist/smd/migrator.js +5 -5
  61. package/dist/smd/migrator.js.map +1 -1
  62. package/dist/smd/smd-manager.d.ts +3 -3
  63. package/dist/smd/smd-manager.d.ts.map +1 -1
  64. package/dist/smd/smd-manager.js +2 -2
  65. package/dist/smd/smd-manager.js.map +1 -1
  66. package/dist/smd/smd-utils.d.ts +3 -3
  67. package/dist/smd/smd-utils.d.ts.map +1 -1
  68. package/dist/smd/smd.d.ts +5 -6
  69. package/dist/smd/smd.d.ts.map +1 -1
  70. package/dist/smd/smd.js +3 -3
  71. package/dist/smd/smd.js.map +1 -1
  72. package/dist/syncer/syncer.d.ts +15 -11
  73. package/dist/syncer/syncer.d.ts.map +1 -1
  74. package/dist/syncer/syncer.js +134 -74
  75. package/dist/syncer/syncer.js.map +1 -1
  76. package/dist/templates/base-template.d.ts +2 -2
  77. package/dist/templates/base-template.d.ts.map +1 -1
  78. package/dist/templates/entity.template.d.ts +17 -0
  79. package/dist/templates/entity.template.d.ts.map +1 -0
  80. package/dist/templates/entity.template.js +46 -0
  81. package/dist/templates/entity.template.js.map +1 -0
  82. package/dist/templates/generated.template.d.ts +11 -7
  83. package/dist/templates/generated.template.d.ts.map +1 -1
  84. package/dist/templates/generated.template.js +72 -43
  85. package/dist/templates/generated.template.js.map +1 -1
  86. package/dist/templates/generated_http.template.d.ts +3 -3
  87. package/dist/templates/generated_http.template.d.ts.map +1 -1
  88. package/dist/templates/generated_http.template.js +3 -3
  89. package/dist/templates/generated_http.template.js.map +1 -1
  90. package/dist/templates/init_enums.template.d.ts +2 -2
  91. package/dist/templates/init_enums.template.d.ts.map +1 -1
  92. package/dist/templates/init_enums.template.js +2 -2
  93. package/dist/templates/init_enums.template.js.map +1 -1
  94. package/dist/templates/init_generated.template.d.ts +3 -3
  95. package/dist/templates/init_generated.template.d.ts.map +1 -1
  96. package/dist/templates/init_generated.template.js +13 -14
  97. package/dist/templates/init_generated.template.js.map +1 -1
  98. package/dist/templates/init_types.template.d.ts +3 -3
  99. package/dist/templates/init_types.template.d.ts.map +1 -1
  100. package/dist/templates/init_types.template.js +10 -10
  101. package/dist/templates/init_types.template.js.map +1 -1
  102. package/dist/templates/model.template.d.ts +3 -3
  103. package/dist/templates/model.template.d.ts.map +1 -1
  104. package/dist/templates/model.template.js +28 -28
  105. package/dist/templates/model.template.js.map +1 -1
  106. package/dist/templates/model_test.template.d.ts +3 -3
  107. package/dist/templates/model_test.template.d.ts.map +1 -1
  108. package/dist/templates/model_test.template.js +4 -4
  109. package/dist/templates/model_test.template.js.map +1 -1
  110. package/dist/templates/service.template.d.ts +3 -3
  111. package/dist/templates/service.template.d.ts.map +1 -1
  112. package/dist/templates/service.template.js +3 -3
  113. package/dist/templates/service.template.js.map +1 -1
  114. package/dist/templates/smd.template.d.ts +2 -2
  115. package/dist/templates/smd.template.d.ts.map +1 -1
  116. package/dist/templates/smd.template.js +2 -2
  117. package/dist/templates/smd.template.js.map +1 -1
  118. package/dist/templates/view_enums_buttonset.template.d.ts +3 -3
  119. package/dist/templates/view_enums_buttonset.template.d.ts.map +1 -1
  120. package/dist/templates/view_enums_buttonset.template.js +4 -4
  121. package/dist/templates/view_enums_buttonset.template.js.map +1 -1
  122. package/dist/templates/view_enums_dropdown.template.d.ts +3 -3
  123. package/dist/templates/view_enums_dropdown.template.d.ts.map +1 -1
  124. package/dist/templates/view_enums_dropdown.template.js +3 -3
  125. package/dist/templates/view_enums_dropdown.template.js.map +1 -1
  126. package/dist/templates/view_enums_select.template.d.ts +3 -3
  127. package/dist/templates/view_enums_select.template.d.ts.map +1 -1
  128. package/dist/templates/view_enums_select.template.js +3 -3
  129. package/dist/templates/view_enums_select.template.js.map +1 -1
  130. package/dist/templates/view_form.template.d.ts +25 -29
  131. package/dist/templates/view_form.template.d.ts.map +1 -1
  132. package/dist/templates/view_form.template.js +19 -19
  133. package/dist/templates/view_form.template.js.map +1 -1
  134. package/dist/templates/view_id_all_select.template.d.ts +3 -3
  135. package/dist/templates/view_id_all_select.template.d.ts.map +1 -1
  136. package/dist/templates/view_id_all_select.template.js +4 -4
  137. package/dist/templates/view_id_all_select.template.js.map +1 -1
  138. package/dist/templates/view_id_async_select.template.d.ts +3 -3
  139. package/dist/templates/view_id_async_select.template.d.ts.map +1 -1
  140. package/dist/templates/view_id_async_select.template.js +6 -6
  141. package/dist/templates/view_id_async_select.template.js.map +1 -1
  142. package/dist/templates/view_list.template.d.ts +30 -34
  143. package/dist/templates/view_list.template.d.ts.map +1 -1
  144. package/dist/templates/view_list.template.js +40 -40
  145. package/dist/templates/view_list.template.js.map +1 -1
  146. package/dist/templates/view_list_columns.template.d.ts +3 -3
  147. package/dist/templates/view_list_columns.template.d.ts.map +1 -1
  148. package/dist/templates/view_list_columns.template.js +3 -3
  149. package/dist/templates/view_list_columns.template.js.map +1 -1
  150. package/dist/templates/view_search_input.template.d.ts +3 -3
  151. package/dist/templates/view_search_input.template.d.ts.map +1 -1
  152. package/dist/templates/view_search_input.template.js +3 -3
  153. package/dist/templates/view_search_input.template.js.map +1 -1
  154. package/dist/testing/fixture-manager.d.ts +2 -2
  155. package/dist/testing/fixture-manager.d.ts.map +1 -1
  156. package/dist/testing/fixture-manager.js +18 -16
  157. package/dist/testing/fixture-manager.js.map +1 -1
  158. package/dist/types/smd.types.d.ts +741 -0
  159. package/dist/types/smd.types.d.ts.map +1 -0
  160. package/dist/types/smd.types.js +292 -0
  161. package/dist/types/smd.types.js.map +1 -0
  162. package/dist/types/types.d.ts +185 -188
  163. package/dist/types/types.d.ts.map +1 -1
  164. package/dist/types/types.js +22 -30
  165. package/dist/types/types.js.map +1 -1
  166. package/dist/utils/model.d.ts +2 -2
  167. package/dist/utils/model.d.ts.map +1 -1
  168. package/dist/utils/utils.d.ts +1 -0
  169. package/dist/utils/utils.d.ts.map +1 -1
  170. package/dist/utils/utils.js +6 -2
  171. package/dist/utils/utils.js.map +1 -1
  172. package/package.json +11 -8
  173. package/src/api/code-converters.ts +9 -17
  174. package/src/api/sonamu.ts +10 -6
  175. package/src/bin/cli.ts +156 -27
  176. package/src/database/upsert-builder.ts +2 -2
  177. package/src/entity/entity-manager.ts +150 -0
  178. package/src/{smd/smd-utils.ts → entity/entity-utils.ts} +3 -3
  179. package/src/entity/entity.ts +666 -0
  180. package/src/{smd → entity}/migrator.ts +426 -106
  181. package/src/index.ts +3 -3
  182. package/src/smd/smd-manager.ts +3 -13
  183. package/src/smd/smd.ts +13 -10
  184. package/src/syncer/syncer.ts +125 -73
  185. package/src/templates/base-template.ts +2 -2
  186. package/src/templates/entity.template.ts +50 -0
  187. package/src/templates/generated.template.ts +93 -57
  188. package/src/templates/generated_http.template.ts +4 -4
  189. package/src/templates/init_types.template.ts +11 -11
  190. package/src/templates/model.template.ts +29 -29
  191. package/src/templates/model_test.template.ts +5 -5
  192. package/src/templates/service.template.ts +4 -4
  193. package/src/templates/view_enums_buttonset.template.ts +5 -5
  194. package/src/templates/view_enums_dropdown.template.ts +4 -4
  195. package/src/templates/view_enums_select.template.ts +8 -4
  196. package/src/templates/view_form.template.ts +21 -21
  197. package/src/templates/view_id_all_select.template.ts +5 -5
  198. package/src/templates/view_id_async_select.template.ts +9 -7
  199. package/src/templates/view_list.template.ts +54 -44
  200. package/src/templates/view_list_columns.template.ts +4 -4
  201. package/src/templates/view_search_input.template.ts +4 -4
  202. package/src/testing/fixture-manager.ts +12 -12
  203. package/src/types/types.ts +59 -39
  204. package/src/utils/utils.ts +4 -0
  205. package/tsconfig.json +4 -1
  206. package/src/templates/init_enums.template.ts +0 -71
  207. package/src/templates/init_generated.template.ts +0 -51
  208. package/src/templates/smd.template.ts +0 -53
@@ -1,15 +1,15 @@
1
1
  import { z } from "zod";
2
- export declare type EnumsLabel<T extends string, L extends "ko" | "en"> = {
2
+ export type EnumsLabel<T extends string, L extends "ko" | "en"> = {
3
3
  [key in T]: {
4
4
  [lang in L]: string;
5
5
  };
6
6
  };
7
- export declare type EnumsLabelKo<T extends string> = EnumsLabel<T, "ko">;
7
+ export type EnumsLabelKo<T extends string> = EnumsLabel<T, "ko">;
8
8
  export declare const SQLDateTimeString: z.ZodString;
9
- export declare type SQLDateTimeString = z.infer<typeof SQLDateTimeString>;
9
+ export type SQLDateTimeString = z.infer<typeof SQLDateTimeString>;
10
10
  export declare function zArrayable<T extends z.ZodTypeAny>(shape: T): z.ZodUnion<[T, z.ZodArray<T, "many">]>;
11
- export declare type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
12
- export declare type CommonProp = {
11
+ export type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
12
+ export type CommonProp = {
13
13
  name: string;
14
14
  nullable?: boolean;
15
15
  toFilter?: true;
@@ -18,76 +18,72 @@ export declare type CommonProp = {
18
18
  raw: string;
19
19
  };
20
20
  };
21
- export declare type IntegerProp = CommonProp & {
21
+ export type IntegerProp = CommonProp & {
22
22
  type: "integer";
23
23
  unsigned?: true;
24
24
  };
25
- export declare type BigIntegerProp = CommonProp & {
25
+ export type BigIntegerProp = CommonProp & {
26
26
  type: "bigInteger";
27
27
  unsigned?: true;
28
28
  };
29
- export declare type TextProp = CommonProp & {
29
+ export type TextProp = CommonProp & {
30
30
  type: "text";
31
31
  textType: "text" | "mediumtext" | "longtext";
32
32
  };
33
- export declare type StringProp = CommonProp & {
33
+ export type StringProp = CommonProp & {
34
34
  type: "string";
35
35
  length: number;
36
36
  };
37
- export declare type EnumProp = CommonProp & {
37
+ export type EnumProp = CommonProp & {
38
38
  type: "enum";
39
39
  length: number;
40
40
  id: string;
41
41
  };
42
- export declare type FloatProp = CommonProp & {
42
+ export type FloatProp = CommonProp & {
43
43
  type: "float";
44
44
  unsigned?: true;
45
45
  precision: number;
46
46
  scale: number;
47
47
  };
48
- export declare type DoubleProp = CommonProp & {
48
+ export type DoubleProp = CommonProp & {
49
49
  type: "double";
50
50
  unsigned?: true;
51
51
  };
52
- export declare type DecimalProp = CommonProp & {
52
+ export type DecimalProp = CommonProp & {
53
53
  type: "decimal";
54
54
  unsigned?: true;
55
55
  precision: number;
56
56
  scale: number;
57
57
  };
58
- export declare type BooleanProp = CommonProp & {
58
+ export type BooleanProp = CommonProp & {
59
59
  type: "boolean";
60
60
  };
61
- export declare type DateProp = CommonProp & {
61
+ export type DateProp = CommonProp & {
62
62
  type: "date";
63
63
  };
64
- export declare type DateTimeProp = CommonProp & {
64
+ export type DateTimeProp = CommonProp & {
65
65
  type: "dateTime";
66
66
  };
67
- export declare type TimeProp = CommonProp & {
67
+ export type TimeProp = CommonProp & {
68
68
  type: "time";
69
69
  };
70
- export declare type TimestampProp = CommonProp & {
70
+ export type TimestampProp = CommonProp & {
71
71
  type: "timestamp";
72
72
  };
73
- export declare type JsonProp = CommonProp & {
73
+ export type JsonProp = CommonProp & {
74
74
  type: "json";
75
- as: {
76
- ref: string;
77
- } | z.ZodTypeAny;
75
+ id: string;
78
76
  };
79
- export declare type UuidProp = CommonProp & {
77
+ export type UuidProp = CommonProp & {
80
78
  type: "uuid";
81
79
  };
82
- export declare type VirtualProp = CommonProp & {
80
+ export type VirtualProp = CommonProp & {
83
81
  type: "virtual";
84
- as: {
85
- ref: string;
86
- } | z.ZodTypeAny;
82
+ id: string;
87
83
  };
88
- export declare type RelationType = "HasMany" | "BelongsToOne" | "ManyToMany" | "OneToOne";
89
- export declare type RelationOn = "UPDATE" | "CASCADE" | "SET NULL" | "NO ACTION" | "SET DEFAULT" | "RESTRICT";
90
- declare type _RelationProp = {
84
+ export type RelationType = "HasMany" | "BelongsToOne" | "ManyToMany" | "OneToOne";
85
+ export type RelationOn = "UPDATE" | "CASCADE" | "SET NULL" | "NO ACTION" | "SET DEFAULT" | "RESTRICT";
86
+ type _RelationProp = {
91
87
  type: "relation";
92
88
  name: string;
93
89
  with: string;
@@ -95,7 +91,7 @@ declare type _RelationProp = {
95
91
  toFilter?: true;
96
92
  desc?: string;
97
93
  };
98
- export declare type OneToOneRelationProp = _RelationProp & {
94
+ export type OneToOneRelationProp = _RelationProp & {
99
95
  relationType: "OneToOne";
100
96
  customJoinClause?: string;
101
97
  } & ({
@@ -105,47 +101,74 @@ export declare type OneToOneRelationProp = _RelationProp & {
105
101
  } | {
106
102
  hasJoinColumn: false;
107
103
  });
108
- export declare type BelongsToOneRelationProp = _RelationProp & {
104
+ export type BelongsToOneRelationProp = _RelationProp & {
109
105
  relationType: "BelongsToOne";
110
106
  customJoinClause?: string;
111
107
  onUpdate: RelationOn;
112
108
  onDelete: RelationOn;
113
109
  };
114
- export declare type HasManyRelationProp = _RelationProp & {
110
+ export type HasManyRelationProp = _RelationProp & {
115
111
  relationType: "HasMany";
116
112
  joinColumn: string;
117
113
  };
118
- export declare type ManyToManyRelationProp = _RelationProp & {
114
+ export type ManyToManyRelationProp = _RelationProp & {
119
115
  relationType: "ManyToMany";
120
116
  joinTable: `${string}__${string}`;
121
117
  onUpdate: RelationOn;
122
118
  onDelete: RelationOn;
123
119
  };
124
- export declare type RelationProp = OneToOneRelationProp | BelongsToOneRelationProp | HasManyRelationProp | ManyToManyRelationProp;
125
- export declare type SMDProp = IntegerProp | BigIntegerProp | TextProp | StringProp | FloatProp | DoubleProp | DecimalProp | BooleanProp | DateProp | DateTimeProp | TimeProp | TimestampProp | JsonProp | UuidProp | EnumProp | VirtualProp | RelationProp;
126
- export declare type SMDIndex = {
120
+ export type RelationProp = OneToOneRelationProp | BelongsToOneRelationProp | HasManyRelationProp | ManyToManyRelationProp;
121
+ export type EntityProp = IntegerProp | BigIntegerProp | TextProp | StringProp | FloatProp | DoubleProp | DecimalProp | BooleanProp | DateProp | DateTimeProp | TimeProp | TimestampProp | JsonProp | UuidProp | EnumProp | VirtualProp | RelationProp;
122
+ export type EntityIndex = {
127
123
  type: "index" | "unique";
128
124
  columns: string[];
129
125
  name?: string;
130
126
  };
131
- export declare type SMDInput<T extends string> = {
127
+ export type EntityJson = {
128
+ id: string;
129
+ parentId?: string;
130
+ table: string;
131
+ title?: string;
132
+ props: EntityProp[];
133
+ indexes: EntityIndex[];
134
+ subsets: {
135
+ [subset: string]: string[];
136
+ };
137
+ enums: {
138
+ [enumId: string]: {
139
+ [key: string]: string;
140
+ };
141
+ };
142
+ };
143
+ export type EntitySubsetRow = {
144
+ field: string;
145
+ has: {
146
+ [key: string]: boolean;
147
+ };
148
+ children: EntitySubsetRow[];
149
+ prefixes: string[];
150
+ relationEntity?: string;
151
+ isOpen?: boolean;
152
+ };
153
+ export type FlattenSubsetRow = Omit<EntitySubsetRow, "children">;
154
+ export type SMDInput<T extends string> = {
132
155
  id: string;
133
156
  parentId?: string;
134
157
  table?: string;
135
158
  title?: string;
136
- props?: SMDProp[];
137
- indexes?: SMDIndex[];
159
+ props?: EntityProp[];
160
+ indexes?: EntityIndex[];
138
161
  subsets?: {
139
162
  [subset: string]: T[];
140
163
  };
141
164
  };
142
- export declare type SMDPropNode = {
165
+ export type EntityPropNode = {
143
166
  nodeType: "plain";
144
- prop: SMDProp;
167
+ prop: EntityProp;
145
168
  } | {
146
169
  nodeType: "object" | "array";
147
- prop?: SMDProp;
148
- children: SMDPropNode[];
170
+ prop?: EntityProp;
171
+ children: EntityPropNode[];
149
172
  };
150
173
  export declare function isIntegerProp(p: any): p is IntegerProp;
151
174
  export declare function isBigIntegerProp(p: any): p is BigIntegerProp;
@@ -168,7 +191,7 @@ export declare function isOneToOneRelationProp(p: any): p is OneToOneRelationPro
168
191
  export declare function isBelongsToOneRelationProp(p: any): p is BelongsToOneRelationProp;
169
192
  export declare function isHasManyRelationProp(p: any): p is HasManyRelationProp;
170
193
  export declare function isManyToManyRelationProp(p: any): p is ManyToManyRelationProp;
171
- declare type JoinClause = {
194
+ type JoinClause = {
172
195
  from: string;
173
196
  to: string;
174
197
  } | {
@@ -177,7 +200,7 @@ declare type JoinClause = {
177
200
  export declare function isCustomJoinClause(p: any): p is {
178
201
  custom: string;
179
202
  };
180
- declare type SubsetLoader = {
203
+ type SubsetLoader = {
181
204
  as: string;
182
205
  table: string;
183
206
  manyJoin: {
@@ -200,7 +223,7 @@ declare type SubsetLoader = {
200
223
  select: string[];
201
224
  loaders?: SubsetLoader[];
202
225
  };
203
- export declare type SubsetQuery = {
226
+ export type SubsetQuery = {
204
227
  select: string[];
205
228
  virtual: string[];
206
229
  joins: ({
@@ -210,7 +233,7 @@ export declare type SubsetQuery = {
210
233
  } & JoinClause)[];
211
234
  loaders: SubsetLoader[];
212
235
  };
213
- export declare type KnexError = {
236
+ export type KnexError = {
214
237
  code: string;
215
238
  errno: number;
216
239
  sql: string;
@@ -218,8 +241,8 @@ export declare type KnexError = {
218
241
  sqlState: string;
219
242
  };
220
243
  export declare function isKnexError(e: any): e is KnexError;
221
- export declare type KnexColumnType = "string" | "text" | "smalltext" | "mediumtext" | "longtext" | "integer" | "bigInteger" | "decimal" | "timestamp" | "boolean" | "foreign" | "uuid" | "json" | "float" | "date" | "time" | "dateTime";
222
- export declare type MigrationColumn = {
244
+ export type KnexColumnType = "string" | "text" | "smalltext" | "mediumtext" | "longtext" | "integer" | "bigInteger" | "decimal" | "timestamp" | "boolean" | "foreign" | "uuid" | "json" | "float" | "date" | "time" | "dateTime";
245
+ export type MigrationColumn = {
223
246
  name: string;
224
247
  type: KnexColumnType;
225
248
  nullable: boolean;
@@ -229,38 +252,38 @@ export declare type MigrationColumn = {
229
252
  precision?: number;
230
253
  scale?: number;
231
254
  };
232
- export declare type MigrationIndex = {
255
+ export type MigrationIndex = {
233
256
  columns: string[];
234
257
  type: "unique" | "index";
235
258
  };
236
- export declare type MigrationForeign = {
259
+ export type MigrationForeign = {
237
260
  columns: string[];
238
261
  to: string;
239
262
  onUpdate: RelationOn;
240
263
  onDelete: RelationOn;
241
264
  };
242
- export declare type MigrationJoinTable = {
265
+ export type MigrationJoinTable = {
243
266
  table: string;
244
267
  indexes: MigrationIndex[];
245
268
  columns: MigrationColumn[];
246
269
  foreigns: MigrationForeign[];
247
270
  };
248
- export declare type MigrationSet = {
271
+ export type MigrationSet = {
249
272
  table: string;
250
273
  columns: MigrationColumn[];
251
274
  indexes: MigrationIndex[];
252
275
  foreigns: MigrationForeign[];
253
276
  };
254
- export declare type MigrationSetAndJoinTable = MigrationSet & {
277
+ export type MigrationSetAndJoinTable = MigrationSet & {
255
278
  joinTables: MigrationJoinTable[];
256
279
  };
257
- export declare type GenMigrationCode = {
280
+ export type GenMigrationCode = {
258
281
  title: string;
259
282
  table: string;
260
283
  type: "normal" | "foreign";
261
284
  formatted: string | null;
262
285
  };
263
- export declare type ApiParam = {
286
+ export type ApiParam = {
264
287
  name: string;
265
288
  type: ApiParamType;
266
289
  optional: boolean;
@@ -346,9 +369,9 @@ export declare namespace ApiParamType {
346
369
  function isContext(v: any): v is ApiParamType.Context;
347
370
  function isTypeParam(v: any): v is ApiParamType.TypeParam;
348
371
  }
349
- export declare 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;
372
+ export 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;
350
373
  export declare const RenderingNode: z.ZodAny;
351
- export declare type RenderingNode = {
374
+ export type RenderingNode = {
352
375
  name: string;
353
376
  label: string;
354
377
  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";
@@ -362,103 +385,89 @@ export declare type RenderingNode = {
362
385
  nullable?: boolean;
363
386
  };
364
387
  export declare const TemplateOptions: z.ZodObject<{
365
- smd: z.ZodObject<{
366
- smdId: z.ZodString;
388
+ entity: z.ZodObject<{
389
+ entityId: z.ZodString;
390
+ parentId: z.ZodOptional<z.ZodString>;
367
391
  title: z.ZodString;
368
- refCode: z.ZodOptional<z.ZodString>;
392
+ table: z.ZodOptional<z.ZodString>;
369
393
  }, "strip", z.ZodTypeAny, {
370
- smdId: string;
394
+ entityId: string;
371
395
  title: string;
372
- refCode?: string | undefined;
396
+ parentId?: string | undefined;
397
+ table?: string | undefined;
373
398
  }, {
374
- smdId: string;
399
+ entityId: string;
375
400
  title: string;
376
- refCode?: string | undefined;
377
- }>;
378
- init_enums: z.ZodObject<{
379
- smdId: z.ZodString;
380
- def: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
381
- }, "strip", z.ZodTypeAny, {
382
- smdId: string;
383
- def?: Record<string, Record<string, string>> | undefined;
384
- }, {
385
- smdId: string;
386
- def?: Record<string, Record<string, string>> | undefined;
401
+ parentId?: string | undefined;
402
+ table?: string | undefined;
387
403
  }>;
388
404
  init_types: z.ZodObject<{
389
- smdId: z.ZodString;
390
- }, "strip", z.ZodTypeAny, {
391
- smdId: string;
392
- }, {
393
- smdId: string;
394
- }>;
395
- init_generated: z.ZodObject<{
396
- smdId: z.ZodString;
405
+ entityId: z.ZodString;
397
406
  }, "strip", z.ZodTypeAny, {
398
- smdId: string;
407
+ entityId: string;
399
408
  }, {
400
- smdId: string;
409
+ entityId: string;
401
410
  }>;
402
411
  generated: z.ZodObject<{
403
- smdId: z.ZodString;
412
+ entityId: z.ZodString;
404
413
  }, "strip", z.ZodTypeAny, {
405
- smdId: string;
414
+ entityId: string;
406
415
  }, {
407
- smdId: string;
416
+ entityId: string;
408
417
  }>;
409
418
  generated_http: z.ZodObject<{
410
- smdId: z.ZodString;
419
+ entityId: z.ZodString;
411
420
  }, "strip", z.ZodTypeAny, {
412
- smdId: string;
421
+ entityId: string;
413
422
  }, {
414
- smdId: string;
423
+ entityId: string;
415
424
  }>;
416
425
  model: z.ZodObject<{
417
- smdId: z.ZodString;
426
+ entityId: z.ZodString;
418
427
  defaultSearchField: z.ZodString;
419
428
  defaultOrderBy: z.ZodString;
420
429
  }, "strip", z.ZodTypeAny, {
421
- smdId: string;
430
+ entityId: string;
422
431
  defaultSearchField: string;
423
432
  defaultOrderBy: string;
424
433
  }, {
425
- smdId: string;
434
+ entityId: string;
426
435
  defaultSearchField: string;
427
436
  defaultOrderBy: string;
428
437
  }>;
429
438
  model_test: z.ZodObject<{
430
- smdId: z.ZodString;
439
+ entityId: z.ZodString;
431
440
  }, "strip", z.ZodTypeAny, {
432
- smdId: string;
441
+ entityId: string;
433
442
  }, {
434
- smdId: string;
443
+ entityId: string;
435
444
  }>;
436
445
  bridge: z.ZodObject<{
437
- smdId: z.ZodString;
446
+ entityId: z.ZodString;
438
447
  }, "strip", z.ZodTypeAny, {
439
- smdId: string;
448
+ entityId: string;
440
449
  }, {
441
- smdId: string;
450
+ entityId: string;
442
451
  }>;
443
452
  service: z.ZodObject<{
444
- smdId: z.ZodString;
453
+ entityId: z.ZodString;
445
454
  }, "strip", z.ZodTypeAny, {
446
- smdId: string;
455
+ entityId: string;
447
456
  }, {
448
- smdId: string;
457
+ entityId: string;
449
458
  }>;
450
459
  view_list: z.ZodObject<{
451
- smdId: z.ZodString;
460
+ entityId: z.ZodString;
452
461
  extra: z.ZodUnknown;
453
462
  }, "strip", z.ZodTypeAny, {
454
- smdId: string;
463
+ entityId: string;
455
464
  extra?: unknown;
456
465
  }, {
457
- smdId: string;
466
+ entityId: string;
458
467
  extra?: unknown;
459
468
  }>;
460
469
  view_list_columns: z.ZodObject<{
461
- smdId: z.ZodString;
470
+ entityId: z.ZodString;
462
471
  columns: z.ZodArray<z.ZodObject<{
463
472
  name: z.ZodString;
464
473
  label: z.ZodString;
@@ -474,7 +483,7 @@ export declare const TemplateOptions: z.ZodObject<{
474
483
  }>, "many">;
475
484
  columnImports: z.ZodString;
476
485
  }, "strip", z.ZodTypeAny, {
477
- smdId: string;
486
+ entityId: string;
478
487
  columns: {
479
488
  name: string;
480
489
  label: string;
@@ -482,7 +491,7 @@ export declare const TemplateOptions: z.ZodObject<{
482
491
  }[];
483
492
  columnImports: string;
484
493
  }, {
485
- smdId: string;
494
+ entityId: string;
486
495
  columns: {
487
496
  name: string;
488
497
  label: string;
@@ -491,117 +500,111 @@ export declare const TemplateOptions: z.ZodObject<{
491
500
  columnImports: string;
492
501
  }>;
493
502
  view_search_input: z.ZodObject<{
494
- smdId: z.ZodString;
503
+ entityId: z.ZodString;
495
504
  }, "strip", z.ZodTypeAny, {
496
- smdId: string;
505
+ entityId: string;
497
506
  }, {
498
- smdId: string;
507
+ entityId: string;
499
508
  }>;
500
509
  view_form: z.ZodObject<{
501
- smdId: z.ZodString;
510
+ entityId: z.ZodString;
502
511
  }, "strip", z.ZodTypeAny, {
503
- smdId: string;
512
+ entityId: string;
504
513
  }, {
505
- smdId: string;
514
+ entityId: string;
506
515
  }>;
507
516
  view_id_all_select: z.ZodObject<{
508
- smdId: z.ZodString;
517
+ entityId: z.ZodString;
509
518
  }, "strip", z.ZodTypeAny, {
510
- smdId: string;
519
+ entityId: string;
511
520
  }, {
512
- smdId: string;
521
+ entityId: string;
513
522
  }>;
514
523
  view_id_async_select: z.ZodObject<{
515
- smdId: z.ZodString;
524
+ entityId: z.ZodString;
516
525
  textField: z.ZodString;
517
526
  }, "strip", z.ZodTypeAny, {
518
- smdId: string;
527
+ entityId: string;
519
528
  textField: string;
520
529
  }, {
521
- smdId: string;
530
+ entityId: string;
522
531
  textField: string;
523
532
  }>;
524
533
  view_enums_select: z.ZodObject<{
525
- smdId: z.ZodString;
534
+ entityId: z.ZodString;
526
535
  enumId: z.ZodString;
527
536
  idConstant: z.ZodString;
528
537
  }, "strip", z.ZodTypeAny, {
529
- smdId: string;
538
+ entityId: string;
530
539
  enumId: string;
531
540
  idConstant: string;
532
541
  }, {
533
- smdId: string;
542
+ entityId: string;
534
543
  enumId: string;
535
544
  idConstant: string;
536
545
  }>;
537
546
  view_enums_dropdown: z.ZodObject<{
538
- smdId: z.ZodString;
547
+ entityId: z.ZodString;
539
548
  enumId: z.ZodString;
540
549
  idConstant: z.ZodString;
541
550
  }, "strip", z.ZodTypeAny, {
542
- smdId: string;
551
+ entityId: string;
543
552
  enumId: string;
544
553
  idConstant: string;
545
554
  }, {
546
- smdId: string;
555
+ entityId: string;
547
556
  enumId: string;
548
557
  idConstant: string;
549
558
  }>;
550
559
  view_enums_buttonset: z.ZodObject<{
551
- smdId: z.ZodString;
560
+ entityId: z.ZodString;
552
561
  enumId: z.ZodString;
553
562
  idConstant: z.ZodString;
554
563
  }, "strip", z.ZodTypeAny, {
555
- smdId: string;
564
+ entityId: string;
556
565
  enumId: string;
557
566
  idConstant: string;
558
567
  }, {
559
- smdId: string;
568
+ entityId: string;
560
569
  enumId: string;
561
570
  idConstant: string;
562
571
  }>;
563
572
  }, "strip", z.ZodTypeAny, {
564
- smd: {
565
- smdId: string;
573
+ entity: {
574
+ entityId: string;
566
575
  title: string;
567
- refCode?: string | undefined;
568
- };
569
- init_enums: {
570
- smdId: string;
571
- def?: Record<string, Record<string, string>> | undefined;
576
+ parentId?: string | undefined;
577
+ table?: string | undefined;
572
578
  };
573
579
  init_types: {
574
- smdId: string;
575
- };
576
- init_generated: {
577
- smdId: string;
580
+ entityId: string;
578
581
  };
579
582
  generated: {
580
- smdId: string;
583
+ entityId: string;
581
584
  };
582
585
  generated_http: {
583
- smdId: string;
586
+ entityId: string;
584
587
  };
585
588
  model: {
586
- smdId: string;
589
+ entityId: string;
587
590
  defaultSearchField: string;
588
591
  defaultOrderBy: string;
589
592
  };
590
593
  model_test: {
591
- smdId: string;
594
+ entityId: string;
592
595
  };
593
596
  bridge: {
594
- smdId: string;
597
+ entityId: string;
595
598
  };
596
599
  service: {
597
- smdId: string;
600
+ entityId: string;
598
601
  };
599
602
  view_list: {
600
- smdId: string;
603
+ entityId: string;
601
604
  extra?: unknown;
602
605
  };
603
606
  view_list_columns: {
604
- smdId: string;
607
+ entityId: string;
605
608
  columns: {
606
609
  name: string;
607
610
  label: string;
@@ -610,75 +613,69 @@ export declare const TemplateOptions: z.ZodObject<{
610
613
  columnImports: string;
611
614
  };
612
615
  view_search_input: {
613
- smdId: string;
616
+ entityId: string;
614
617
  };
615
618
  view_form: {
616
- smdId: string;
619
+ entityId: string;
617
620
  };
618
621
  view_id_all_select: {
619
- smdId: string;
622
+ entityId: string;
620
623
  };
621
624
  view_id_async_select: {
622
- smdId: string;
625
+ entityId: string;
623
626
  textField: string;
624
627
  };
625
628
  view_enums_select: {
626
- smdId: string;
629
+ entityId: string;
627
630
  enumId: string;
628
631
  idConstant: string;
629
632
  };
630
633
  view_enums_dropdown: {
631
- smdId: string;
634
+ entityId: string;
632
635
  enumId: string;
633
636
  idConstant: string;
634
637
  };
635
638
  view_enums_buttonset: {
636
- smdId: string;
639
+ entityId: string;
637
640
  enumId: string;
638
641
  idConstant: string;
639
642
  };
640
643
  }, {
641
- smd: {
642
- smdId: string;
644
+ entity: {
645
+ entityId: string;
643
646
  title: string;
644
- refCode?: string | undefined;
645
- };
646
- init_enums: {
647
- smdId: string;
648
- def?: Record<string, Record<string, string>> | undefined;
647
+ parentId?: string | undefined;
648
+ table?: string | undefined;
649
649
  };
650
650
  init_types: {
651
- smdId: string;
652
- };
653
- init_generated: {
654
- smdId: string;
651
+ entityId: string;
655
652
  };
656
653
  generated: {
657
- smdId: string;
654
+ entityId: string;
658
655
  };
659
656
  generated_http: {
660
- smdId: string;
657
+ entityId: string;
661
658
  };
662
659
  model: {
663
- smdId: string;
660
+ entityId: string;
664
661
  defaultSearchField: string;
665
662
  defaultOrderBy: string;
666
663
  };
667
664
  model_test: {
668
- smdId: string;
665
+ entityId: string;
669
666
  };
670
667
  bridge: {
671
- smdId: string;
668
+ entityId: string;
672
669
  };
673
670
  service: {
674
- smdId: string;
671
+ entityId: string;
675
672
  };
676
673
  view_list: {
677
- smdId: string;
674
+ entityId: string;
678
675
  extra?: unknown;
679
676
  };
680
677
  view_list_columns: {
681
- smdId: string;
678
+ entityId: string;
682
679
  columns: {
683
680
  name: string;
684
681
  label: string;
@@ -687,37 +684,37 @@ export declare const TemplateOptions: z.ZodObject<{
687
684
  columnImports: string;
688
685
  };
689
686
  view_search_input: {
690
- smdId: string;
687
+ entityId: string;
691
688
  };
692
689
  view_form: {
693
- smdId: string;
690
+ entityId: string;
694
691
  };
695
692
  view_id_all_select: {
696
- smdId: string;
693
+ entityId: string;
697
694
  };
698
695
  view_id_async_select: {
699
- smdId: string;
696
+ entityId: string;
700
697
  textField: string;
701
698
  };
702
699
  view_enums_select: {
703
- smdId: string;
700
+ entityId: string;
704
701
  enumId: string;
705
702
  idConstant: string;
706
703
  };
707
704
  view_enums_dropdown: {
708
- smdId: string;
705
+ entityId: string;
709
706
  enumId: string;
710
707
  idConstant: string;
711
708
  };
712
709
  view_enums_buttonset: {
713
- smdId: string;
710
+ entityId: string;
714
711
  enumId: string;
715
712
  idConstant: string;
716
713
  };
717
714
  }>;
718
- export declare type TemplateOptions = z.infer<typeof TemplateOptions>;
719
- export declare const TemplateKey: z.ZodEnum<["smd", "init_enums", "init_types", "init_generated", "generated", "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"]>;
720
- export declare type TemplateKey = z.infer<typeof TemplateKey>;
715
+ export type TemplateOptions = z.infer<typeof TemplateOptions>;
716
+ export declare const TemplateKey: z.ZodEnum<["entity", "init_types", "generated", "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"]>;
717
+ export type TemplateKey = z.infer<typeof TemplateKey>;
721
718
  export declare const GenerateOptions: z.ZodObject<{
722
719
  overwrite: z.ZodOptional<z.ZodBoolean>;
723
720
  }, "strip", z.ZodTypeAny, {
@@ -725,7 +722,7 @@ export declare const GenerateOptions: z.ZodObject<{
725
722
  }, {
726
723
  overwrite?: boolean | undefined;
727
724
  }>;
728
- export declare type GenerateOptions = z.infer<typeof GenerateOptions>;
725
+ export type GenerateOptions = z.infer<typeof GenerateOptions>;
729
726
  export declare const PathAndCode: z.ZodObject<{
730
727
  path: z.ZodString;
731
728
  code: z.ZodString;
@@ -736,6 +733,6 @@ export declare const PathAndCode: z.ZodObject<{
736
733
  path: string;
737
734
  code: string;
738
735
  }>;
739
- export declare type PathAndCode = z.infer<typeof PathAndCode>;
736
+ export type PathAndCode = z.infer<typeof PathAndCode>;
740
737
  export {};
741
738
  //# sourceMappingURL=types.d.ts.map