sonamu 0.2.38 → 0.2.40

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