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