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