sonamu 0.6.0 → 0.7.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 (406) hide show
  1. package/.swcrc.project-default +18 -0
  2. package/bin/cli.js +24 -0
  3. package/dist/ai/agents/agent.d.ts +11 -0
  4. package/dist/ai/agents/agent.d.ts.map +1 -0
  5. package/dist/ai/agents/agent.js +65 -0
  6. package/dist/ai/agents/index.d.ts +3 -0
  7. package/dist/ai/agents/index.d.ts.map +1 -0
  8. package/dist/ai/agents/index.js +4 -0
  9. package/dist/ai/agents/types.d.ts +43 -0
  10. package/dist/ai/agents/types.d.ts.map +1 -0
  11. package/dist/ai/agents/types.js +3 -0
  12. package/dist/ai/index.d.ts +2 -0
  13. package/dist/ai/index.d.ts.map +1 -0
  14. package/dist/ai/index.js +3 -0
  15. package/dist/ai/providers/rtzr/api.d.ts +22 -0
  16. package/dist/ai/providers/rtzr/api.d.ts.map +1 -0
  17. package/dist/ai/providers/rtzr/api.js +28 -0
  18. package/dist/ai/providers/rtzr/error.d.ts +18 -0
  19. package/dist/ai/providers/rtzr/error.d.ts.map +1 -0
  20. package/dist/ai/providers/rtzr/error.js +29 -0
  21. package/dist/ai/providers/rtzr/index.d.ts +5 -0
  22. package/dist/ai/providers/rtzr/index.d.ts.map +1 -0
  23. package/dist/ai/providers/rtzr/index.js +6 -0
  24. package/dist/ai/providers/rtzr/model.d.ts +52 -0
  25. package/dist/ai/providers/rtzr/model.d.ts.map +1 -0
  26. package/dist/ai/providers/rtzr/model.js +137 -0
  27. package/dist/ai/providers/rtzr/options.d.ts +7 -0
  28. package/dist/ai/providers/rtzr/options.d.ts.map +1 -0
  29. package/dist/ai/providers/rtzr/options.js +47 -0
  30. package/dist/ai/providers/rtzr/provider.d.ts +18 -0
  31. package/dist/ai/providers/rtzr/provider.d.ts.map +1 -0
  32. package/dist/ai/providers/rtzr/provider.js +54 -0
  33. package/dist/ai/providers/rtzr/utils.d.ts +19 -0
  34. package/dist/ai/providers/rtzr/utils.d.ts.map +1 -0
  35. package/dist/ai/providers/rtzr/utils.js +88 -0
  36. package/dist/api/base-frame.d.ts +2 -2
  37. package/dist/api/base-frame.d.ts.map +1 -1
  38. package/dist/api/base-frame.js +2 -1
  39. package/dist/api/caster.d.ts.map +1 -1
  40. package/dist/api/caster.js +6 -1
  41. package/dist/api/code-converters.d.ts +58 -14
  42. package/dist/api/code-converters.d.ts.map +1 -1
  43. package/dist/api/code-converters.js +178 -409
  44. package/dist/api/config.d.ts +27 -13
  45. package/dist/api/config.d.ts.map +1 -1
  46. package/dist/api/config.js +19 -26
  47. package/dist/api/context.d.ts +4 -3
  48. package/dist/api/context.d.ts.map +1 -1
  49. package/dist/api/context.js +1 -1
  50. package/dist/api/decorators.d.ts +20 -6
  51. package/dist/api/decorators.d.ts.map +1 -1
  52. package/dist/api/decorators.js +111 -18
  53. package/dist/api/index.d.ts +2 -2
  54. package/dist/api/index.d.ts.map +1 -1
  55. package/dist/api/index.js +3 -3
  56. package/dist/api/sonamu.d.ts +7 -7
  57. package/dist/api/sonamu.d.ts.map +1 -1
  58. package/dist/api/sonamu.js +83 -51
  59. package/dist/api/validator.d.ts +6 -0
  60. package/dist/api/validator.d.ts.map +1 -0
  61. package/dist/api/validator.js +81 -0
  62. package/dist/bin/build-config.d.ts +5 -1
  63. package/dist/bin/build-config.d.ts.map +1 -1
  64. package/dist/bin/build-config.js +5 -2
  65. package/dist/bin/cli.js +165 -64
  66. package/dist/bin/loader-register.d.ts +2 -0
  67. package/dist/bin/loader-register.d.ts.map +1 -0
  68. package/dist/bin/loader-register.js +34 -0
  69. package/dist/database/_batch_update.d.ts +5 -3
  70. package/dist/database/_batch_update.d.ts.map +1 -1
  71. package/dist/database/_batch_update.js +30 -13
  72. package/dist/database/base-model.d.ts +96 -10
  73. package/dist/database/base-model.d.ts.map +1 -1
  74. package/dist/database/base-model.js +232 -89
  75. package/dist/database/base-model.types.d.ts +93 -0
  76. package/dist/database/base-model.types.d.ts.map +1 -0
  77. package/dist/database/base-model.types.js +10 -0
  78. package/dist/database/code-generator.d.ts +1 -1
  79. package/dist/database/code-generator.d.ts.map +1 -1
  80. package/dist/database/code-generator.js +11 -10
  81. package/dist/database/db.d.ts +5 -6
  82. package/dist/database/db.d.ts.map +1 -1
  83. package/dist/database/db.js +22 -25
  84. package/dist/database/puri-subset.test-d.js +81 -0
  85. package/dist/database/puri-subset.types.d.ts +123 -0
  86. package/dist/database/puri-subset.types.d.ts.map +1 -0
  87. package/dist/database/puri-subset.types.js +16 -0
  88. package/dist/database/puri-wrapper.d.ts +13 -11
  89. package/dist/database/puri-wrapper.d.ts.map +1 -1
  90. package/dist/database/puri-wrapper.js +2 -2
  91. package/dist/database/puri.d.ts +25 -14
  92. package/dist/database/puri.d.ts.map +1 -1
  93. package/dist/database/puri.js +83 -21
  94. package/dist/database/puri.types.d.ts +21 -7
  95. package/dist/database/puri.types.d.ts.map +1 -1
  96. package/dist/database/puri.types.js +4 -1
  97. package/dist/database/transaction-context.d.ts +1 -1
  98. package/dist/database/transaction-context.d.ts.map +1 -1
  99. package/dist/database/transaction-context.js +1 -1
  100. package/dist/database/upsert-builder.d.ts +9 -3
  101. package/dist/database/upsert-builder.d.ts.map +1 -1
  102. package/dist/database/upsert-builder.js +228 -78
  103. package/dist/entity/entity-manager.d.ts +165 -2
  104. package/dist/entity/entity-manager.d.ts.map +1 -1
  105. package/dist/entity/entity-manager.js +26 -10
  106. package/dist/entity/entity.d.ts +5 -3
  107. package/dist/entity/entity.d.ts.map +1 -1
  108. package/dist/entity/entity.js +153 -54
  109. package/dist/exceptions/error-handler.d.ts +1 -1
  110. package/dist/exceptions/error-handler.d.ts.map +1 -1
  111. package/dist/exceptions/error-handler.js +1 -1
  112. package/dist/exceptions/so-exceptions.d.ts +1 -1
  113. package/dist/exceptions/so-exceptions.d.ts.map +1 -1
  114. package/dist/exceptions/so-exceptions.js +1 -1
  115. package/dist/file-storage/driver.d.ts +1 -1
  116. package/dist/file-storage/driver.d.ts.map +1 -1
  117. package/dist/file-storage/driver.js +1 -1
  118. package/dist/file-storage/file-storage.js +2 -2
  119. package/dist/index.d.ts +18 -11
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +19 -13
  122. package/dist/migration/code-generation.d.ts +1 -1
  123. package/dist/migration/code-generation.d.ts.map +1 -1
  124. package/dist/migration/code-generation.js +123 -67
  125. package/dist/migration/migration-set.d.ts +2 -10
  126. package/dist/migration/migration-set.d.ts.map +1 -1
  127. package/dist/migration/migration-set.js +67 -218
  128. package/dist/migration/migrator.d.ts +24 -73
  129. package/dist/migration/migrator.d.ts.map +1 -1
  130. package/dist/migration/migrator.js +121 -301
  131. package/dist/migration/postgresql-schema-reader.d.ts +51 -0
  132. package/dist/migration/postgresql-schema-reader.d.ts.map +1 -0
  133. package/dist/migration/postgresql-schema-reader.js +245 -0
  134. package/dist/migration/types.d.ts +6 -38
  135. package/dist/migration/types.d.ts.map +1 -1
  136. package/dist/migration/types.js +1 -1
  137. package/dist/naite/messaging-types.d.ts +43 -0
  138. package/dist/naite/messaging-types.d.ts.map +1 -0
  139. package/dist/naite/messaging-types.js +7 -0
  140. package/dist/naite/naite-reporter.d.ts +41 -0
  141. package/dist/naite/naite-reporter.d.ts.map +1 -0
  142. package/dist/naite/naite-reporter.js +102 -0
  143. package/dist/naite/naite.d.ts +91 -8
  144. package/dist/naite/naite.d.ts.map +1 -1
  145. package/dist/naite/naite.js +285 -41
  146. package/dist/stream/sse.d.ts +2 -2
  147. package/dist/stream/sse.d.ts.map +1 -1
  148. package/dist/stream/sse.js +1 -1
  149. package/dist/syncer/api-parser.d.ts +3 -13
  150. package/dist/syncer/api-parser.d.ts.map +1 -1
  151. package/dist/syncer/api-parser.js +67 -56
  152. package/dist/syncer/checksum.d.ts +2 -2
  153. package/dist/syncer/checksum.d.ts.map +1 -1
  154. package/dist/syncer/checksum.js +11 -11
  155. package/dist/syncer/code-generator.d.ts +3 -3
  156. package/dist/syncer/code-generator.d.ts.map +1 -1
  157. package/dist/syncer/code-generator.js +37 -17
  158. package/dist/syncer/entity-operations.d.ts +2 -2
  159. package/dist/syncer/entity-operations.d.ts.map +1 -1
  160. package/dist/syncer/entity-operations.js +9 -8
  161. package/dist/syncer/file-patterns.d.ts +1 -1
  162. package/dist/syncer/file-patterns.d.ts.map +1 -1
  163. package/dist/syncer/file-patterns.js +1 -1
  164. package/dist/syncer/index.d.ts +4 -4
  165. package/dist/syncer/index.d.ts.map +1 -1
  166. package/dist/syncer/index.js +5 -5
  167. package/dist/syncer/module-loader.d.ts +4 -4
  168. package/dist/syncer/module-loader.d.ts.map +1 -1
  169. package/dist/syncer/module-loader.js +17 -12
  170. package/dist/syncer/syncer.d.ts +31 -24
  171. package/dist/syncer/syncer.d.ts.map +1 -1
  172. package/dist/syncer/syncer.js +92 -45
  173. package/dist/template/entity-converter.d.ts +1 -1
  174. package/dist/template/entity-converter.d.ts.map +1 -1
  175. package/dist/template/entity-converter.js +15 -8
  176. package/dist/template/helpers.d.ts +2 -2
  177. package/dist/template/helpers.d.ts.map +1 -1
  178. package/dist/template/helpers.js +3 -3
  179. package/dist/template/implementations/entity.template.d.ts +2 -2
  180. package/dist/template/implementations/entity.template.d.ts.map +1 -1
  181. package/dist/template/implementations/entity.template.js +4 -5
  182. package/dist/template/implementations/generated.template.d.ts +2 -3
  183. package/dist/template/implementations/generated.template.d.ts.map +1 -1
  184. package/dist/template/implementations/generated.template.js +46 -29
  185. package/dist/template/implementations/generated_http.template.d.ts +2 -3
  186. package/dist/template/implementations/generated_http.template.d.ts.map +1 -1
  187. package/dist/template/implementations/generated_http.template.js +9 -9
  188. package/dist/template/implementations/generated_sso.template.d.ts +3 -4
  189. package/dist/template/implementations/generated_sso.template.d.ts.map +1 -1
  190. package/dist/template/implementations/generated_sso.template.js +54 -25
  191. package/dist/template/implementations/init_types.template.d.ts +2 -2
  192. package/dist/template/implementations/init_types.template.d.ts.map +1 -1
  193. package/dist/template/implementations/init_types.template.js +2 -2
  194. package/dist/template/implementations/model.template.d.ts +2 -2
  195. package/dist/template/implementations/model.template.d.ts.map +1 -1
  196. package/dist/template/implementations/model.template.js +47 -37
  197. package/dist/template/implementations/model_test.template.d.ts +2 -2
  198. package/dist/template/implementations/model_test.template.d.ts.map +1 -1
  199. package/dist/template/implementations/model_test.template.js +2 -2
  200. package/dist/template/implementations/service.template.d.ts +4 -4
  201. package/dist/template/implementations/service.template.d.ts.map +1 -1
  202. package/dist/template/implementations/service.template.js +24 -16
  203. package/dist/template/implementations/view_enums_buttonset.template.d.ts +2 -2
  204. package/dist/template/implementations/view_enums_buttonset.template.d.ts.map +1 -1
  205. package/dist/template/implementations/view_enums_buttonset.template.js +1 -1
  206. package/dist/template/implementations/view_enums_dropdown.template.d.ts +2 -2
  207. package/dist/template/implementations/view_enums_dropdown.template.d.ts.map +1 -1
  208. package/dist/template/implementations/view_enums_dropdown.template.js +2 -2
  209. package/dist/template/implementations/view_enums_select.template.d.ts +2 -2
  210. package/dist/template/implementations/view_enums_select.template.d.ts.map +1 -1
  211. package/dist/template/implementations/view_enums_select.template.js +2 -2
  212. package/dist/template/implementations/view_form.template.d.ts +2 -2
  213. package/dist/template/implementations/view_form.template.d.ts.map +1 -1
  214. package/dist/template/implementations/view_form.template.js +4 -4
  215. package/dist/template/implementations/view_id_all_select.template.d.ts +2 -2
  216. package/dist/template/implementations/view_id_all_select.template.d.ts.map +1 -1
  217. package/dist/template/implementations/view_id_all_select.template.js +1 -1
  218. package/dist/template/implementations/view_id_async_select.template.d.ts +2 -2
  219. package/dist/template/implementations/view_id_async_select.template.d.ts.map +1 -1
  220. package/dist/template/implementations/view_id_async_select.template.js +1 -1
  221. package/dist/template/implementations/view_list.template.d.ts +2 -2
  222. package/dist/template/implementations/view_list.template.d.ts.map +1 -1
  223. package/dist/template/implementations/view_list.template.js +29 -19
  224. package/dist/template/implementations/view_list_columns.template.d.ts +3 -3
  225. package/dist/template/implementations/view_list_columns.template.d.ts.map +1 -1
  226. package/dist/template/implementations/view_list_columns.template.js +1 -1
  227. package/dist/template/implementations/view_search_input.template.d.ts +2 -2
  228. package/dist/template/implementations/view_search_input.template.d.ts.map +1 -1
  229. package/dist/template/implementations/view_search_input.template.js +1 -1
  230. package/dist/template/index.d.ts +4 -2
  231. package/dist/template/index.d.ts.map +1 -1
  232. package/dist/template/index.js +5 -3
  233. package/dist/template/template-manager.d.ts +56 -0
  234. package/dist/template/template-manager.d.ts.map +1 -0
  235. package/dist/template/template-manager.js +125 -0
  236. package/dist/template/template-types.d.ts +16 -0
  237. package/dist/template/template-types.d.ts.map +1 -0
  238. package/dist/template/template-types.js +7 -0
  239. package/dist/template/template.d.ts +12 -2
  240. package/dist/template/template.d.ts.map +1 -1
  241. package/dist/template/template.js +19 -6
  242. package/dist/template/zod-converter.d.ts +40 -7
  243. package/dist/template/zod-converter.d.ts.map +1 -1
  244. package/dist/template/zod-converter.js +341 -58
  245. package/dist/testing/_relation-graph.d.ts +1 -1
  246. package/dist/testing/_relation-graph.d.ts.map +1 -1
  247. package/dist/testing/_relation-graph.js +12 -3
  248. package/dist/testing/fixture-manager.d.ts +42 -11
  249. package/dist/testing/fixture-manager.d.ts.map +1 -1
  250. package/dist/testing/fixture-manager.js +338 -236
  251. package/dist/types/types.d.ts +709 -104
  252. package/dist/types/types.d.ts.map +1 -1
  253. package/dist/types/types.js +309 -52
  254. package/dist/typings/knex.d.js +2 -2
  255. package/dist/utils/async-utils.d.ts.map +1 -1
  256. package/dist/utils/async-utils.js +3 -3
  257. package/dist/utils/console-util.js +1 -1
  258. package/dist/utils/controller.d.ts +1 -0
  259. package/dist/utils/controller.d.ts.map +1 -1
  260. package/dist/utils/controller.js +4 -1
  261. package/dist/utils/esm-utils.d.ts +0 -6
  262. package/dist/utils/esm-utils.d.ts.map +1 -1
  263. package/dist/utils/esm-utils.js +2 -9
  264. package/dist/utils/formatter.d.ts +3 -0
  265. package/dist/utils/formatter.d.ts.map +1 -0
  266. package/dist/utils/formatter.js +110 -0
  267. package/dist/utils/fs-utils.d.ts +1 -1
  268. package/dist/utils/fs-utils.d.ts.map +1 -1
  269. package/dist/utils/fs-utils.js +1 -1
  270. package/dist/utils/lodash-able.d.ts.map +1 -1
  271. package/dist/utils/lodash-able.js +1 -1
  272. package/dist/utils/object-utils.d.ts +44 -0
  273. package/dist/utils/object-utils.d.ts.map +1 -0
  274. package/dist/utils/object-utils.js +191 -0
  275. package/dist/utils/path-utils.d.ts +1 -1
  276. package/dist/utils/path-utils.d.ts.map +1 -1
  277. package/dist/utils/path-utils.js +3 -3
  278. package/dist/utils/process-utils.js +1 -1
  279. package/dist/utils/sql-parser.d.ts +5 -1
  280. package/dist/utils/sql-parser.d.ts.map +1 -1
  281. package/dist/utils/sql-parser.js +14 -3
  282. package/dist/utils/type-utils.d.ts +23 -0
  283. package/dist/utils/type-utils.d.ts.map +1 -0
  284. package/dist/utils/type-utils.js +45 -0
  285. package/dist/utils/utils.d.ts +7 -1
  286. package/dist/utils/utils.d.ts.map +1 -1
  287. package/dist/utils/utils.js +44 -5
  288. package/dist/utils/zod-error.d.ts +1 -1
  289. package/dist/utils/zod-error.d.ts.map +1 -1
  290. package/dist/utils/zod-error.js +1 -1
  291. package/package.json +54 -29
  292. package/src/ai/agents/agent.ts +87 -0
  293. package/src/ai/agents/index.ts +2 -0
  294. package/src/ai/agents/types.ts +47 -0
  295. package/src/ai/index.ts +1 -0
  296. package/src/ai/providers/rtzr/api.ts +37 -0
  297. package/src/ai/providers/rtzr/error.ts +34 -0
  298. package/src/ai/providers/rtzr/index.ts +4 -0
  299. package/src/ai/providers/rtzr/model.ts +201 -0
  300. package/src/ai/providers/rtzr/options.ts +49 -0
  301. package/src/ai/providers/rtzr/provider.ts +91 -0
  302. package/src/ai/providers/rtzr/utils.ts +127 -0
  303. package/src/api/base-frame.ts +4 -2
  304. package/src/api/caster.ts +17 -23
  305. package/src/api/code-converters.ts +176 -533
  306. package/src/api/config.ts +39 -56
  307. package/src/api/context.ts +7 -18
  308. package/src/api/decorators.ts +175 -46
  309. package/src/api/index.ts +2 -2
  310. package/src/api/sonamu.ts +133 -124
  311. package/src/api/validator.ts +83 -0
  312. package/src/bin/build-config.ts +7 -1
  313. package/src/bin/cli.ts +192 -110
  314. package/src/bin/loader-register.ts +38 -0
  315. package/src/database/_batch_update.ts +46 -31
  316. package/src/database/base-model.ts +390 -182
  317. package/src/database/base-model.types.ts +155 -0
  318. package/src/database/code-generator.ts +13 -32
  319. package/src/database/db.ts +36 -50
  320. package/src/database/puri-subset.test-d.ts +471 -0
  321. package/src/database/puri-subset.types.ts +195 -0
  322. package/src/database/puri-wrapper.ts +58 -67
  323. package/src/database/puri.ts +182 -126
  324. package/src/database/puri.types.ts +64 -31
  325. package/src/database/transaction-context.ts +1 -1
  326. package/src/database/upsert-builder.ts +262 -132
  327. package/src/entity/entity-manager.ts +36 -28
  328. package/src/entity/entity.ts +330 -249
  329. package/src/exceptions/error-handler.ts +3 -3
  330. package/src/exceptions/so-exceptions.ts +11 -11
  331. package/src/file-storage/driver.ts +5 -5
  332. package/src/file-storage/file-storage.ts +2 -2
  333. package/src/index.ts +18 -12
  334. package/src/migration/code-generation.ts +185 -172
  335. package/src/migration/migration-set.ts +80 -293
  336. package/src/migration/migrator.ts +182 -425
  337. package/src/migration/mysql-schema-reader.ts.txt +272 -0
  338. package/src/migration/postgresql-schema-reader.ts +310 -0
  339. package/src/migration/types.ts +6 -39
  340. package/src/naite/messaging-types.ts +51 -0
  341. package/src/naite/naite-reporter.ts +128 -0
  342. package/src/naite/naite.ts +378 -33
  343. package/src/shared/web.shared.ts.txt +20 -24
  344. package/src/stream/sse.ts +5 -5
  345. package/src/syncer/api-parser.ts +52 -69
  346. package/src/syncer/checksum.ts +25 -37
  347. package/src/syncer/code-generator.ts +58 -62
  348. package/src/syncer/entity-operations.ts +12 -15
  349. package/src/syncer/file-patterns.ts +2 -2
  350. package/src/syncer/index.ts +4 -4
  351. package/src/syncer/module-loader.ts +28 -25
  352. package/src/syncer/syncer.ts +155 -162
  353. package/src/template/entity-converter.ts +18 -27
  354. package/src/template/helpers.ts +8 -11
  355. package/src/template/implementations/entity.template.ts +6 -6
  356. package/src/template/implementations/generated.template.ts +99 -99
  357. package/src/template/implementations/generated_http.template.ts +21 -54
  358. package/src/template/implementations/generated_sso.template.ts +78 -65
  359. package/src/template/implementations/init_types.template.ts +4 -6
  360. package/src/template/implementations/model.template.ts +47 -38
  361. package/src/template/implementations/model_test.template.ts +3 -3
  362. package/src/template/implementations/service.template.ts +56 -80
  363. package/src/template/implementations/view_enums_buttonset.template.ts +2 -2
  364. package/src/template/implementations/view_enums_dropdown.template.ts +4 -4
  365. package/src/template/implementations/view_enums_select.template.ts +3 -3
  366. package/src/template/implementations/view_form.template.ts +34 -75
  367. package/src/template/implementations/view_id_all_select.template.ts +2 -2
  368. package/src/template/implementations/view_id_async_select.template.ts +9 -23
  369. package/src/template/implementations/view_list.template.ts +54 -95
  370. package/src/template/implementations/view_list_columns.template.ts +4 -10
  371. package/src/template/implementations/view_search_input.template.ts +2 -2
  372. package/src/template/index.ts +4 -2
  373. package/src/template/template-manager.ts +166 -0
  374. package/src/template/template-types.ts +16 -0
  375. package/src/template/template.ts +29 -10
  376. package/src/template/zod-converter.ts +407 -101
  377. package/src/testing/_relation-graph.ts +18 -11
  378. package/src/testing/fixture-manager.ts +468 -362
  379. package/src/types/types.ts +516 -248
  380. package/src/typings/knex.d.ts +7 -9
  381. package/src/utils/async-utils.ts +8 -12
  382. package/src/utils/console-util.ts +1 -1
  383. package/src/utils/controller.ts +3 -0
  384. package/src/utils/esm-utils.ts +8 -18
  385. package/src/utils/formatter.ts +109 -0
  386. package/src/utils/fs-utils.ts +1 -1
  387. package/src/utils/lodash-able.ts +1 -4
  388. package/src/utils/object-utils.ts +217 -0
  389. package/src/utils/path-utils.ts +3 -6
  390. package/src/utils/process-utils.ts +1 -1
  391. package/src/utils/sql-parser.ts +23 -5
  392. package/src/utils/type-utils.ts +83 -0
  393. package/src/utils/utils.ts +58 -9
  394. package/src/utils/zod-error.ts +3 -3
  395. package/dist/bin/cli-wrapper.d.ts +0 -3
  396. package/dist/bin/cli-wrapper.d.ts.map +0 -1
  397. package/dist/bin/cli-wrapper.js +0 -72
  398. package/dist/database/knex-plugins/knex-on-duplicate-update.d.ts +0 -2
  399. package/dist/database/knex-plugins/knex-on-duplicate-update.d.ts.map +0 -1
  400. package/dist/database/knex-plugins/knex-on-duplicate-update.js +0 -39
  401. package/dist/entity/entity-utils.d.ts +0 -61
  402. package/dist/entity/entity-utils.d.ts.map +0 -1
  403. package/dist/entity/entity-utils.js +0 -210
  404. package/src/bin/cli-wrapper.ts +0 -82
  405. package/src/database/knex-plugins/knex-on-duplicate-update.ts +0 -45
  406. package/src/entity/entity-utils.ts +0 -291
package/src/api/config.ts CHANGED
@@ -1,30 +1,18 @@
1
- import { transformFile } from "@swc/core";
2
- import { Knex } from "knex";
3
- import path from "path";
4
- import { exists } from "../utils/fs-utils";
5
- import { unlink, writeFile } from "fs/promises";
6
- import { Driver } from "../file-storage/driver";
7
- import {
8
- FastifyInstance,
9
- FastifyReply,
10
- FastifyRequest,
11
- FastifyServerOptions,
12
- } from "fastify";
13
- import { SonamuFastifyConfig } from "../types/types";
14
- import { FastifyCorsOptions } from "@fastify/cors";
15
- import { FastifyFormbodyOptions } from "@fastify/formbody";
16
- import { FastifyMultipartOptions } from "@fastify/multipart";
17
- import { SecureSessionPluginOptions } from "@fastify/secure-session";
18
- import { FastifyStaticOptions } from "@fastify/static";
19
- import { QsPluginOptions } from "fastify-qs";
20
- import { SsePluginOptions } from "fastify-sse-v2/lib/types";
21
- import {
22
- DeserializeFunction,
23
- SerializeFunction,
24
- } from "@fastify/passport/dist/Authenticator";
1
+ import type { FastifyCorsOptions } from "@fastify/cors";
2
+ import type { FastifyFormbodyOptions } from "@fastify/formbody";
3
+ import type { FastifyMultipartOptions } from "@fastify/multipart";
4
+ import type { DeserializeFunction, SerializeFunction } from "@fastify/passport/dist/Authenticator";
5
+ import type { SecureSessionPluginOptions } from "@fastify/secure-session";
6
+ import type { FastifyStaticOptions } from "@fastify/static";
7
+ import type { FastifyInstance, FastifyReply, FastifyRequest, FastifyServerOptions } from "fastify";
8
+ import type { QsPluginOptions } from "fastify-qs";
9
+ import type { SsePluginOptions } from "fastify-sse-v2/lib/types";
10
+ import type { Knex } from "knex";
11
+ import type { Driver } from "../file-storage/driver";
12
+ import type { SonamuFastifyConfig } from "../types/types";
25
13
 
26
14
  export type DatabaseConfig = Omit<Knex.Config, "connection"> & {
27
- connection?: Knex.MySql2ConnectionConfig;
15
+ connection?: Knex.PgConnectionConfig;
28
16
  };
29
17
 
30
18
  export type SonamuConfig = {
@@ -45,6 +33,8 @@ export type SonamuConfig = {
45
33
  };
46
34
 
47
35
  database: {
36
+ // 데이터베이스
37
+ database?: "postgresql";
48
38
  // 기본 데이터베이스 이름
49
39
  name: string;
50
40
  // 모든 환경에 적용될 기본 Knex 옵션
@@ -96,47 +86,40 @@ export type SonamuServerOptions = {
96
86
  lifecycle?: {
97
87
  onStart?: (server: FastifyInstance) => Promise<void> | void;
98
88
  onShutdown?: (server: FastifyInstance) => Promise<void> | void;
99
- onError?: (
100
- error: Error,
101
- request: FastifyRequest,
102
- reply: FastifyReply
103
- ) => Promise<void> | void;
89
+ onError?: (error: Error, request: FastifyRequest, reply: FastifyReply) => Promise<void> | void;
104
90
  };
105
91
  };
106
92
 
107
93
  export type SonamuConfigExport = SonamuConfig | Promise<SonamuConfig>;
108
94
 
109
95
  export function defineConfig(config: SonamuConfig): SonamuConfig;
110
- export function defineConfig(
111
- config: Promise<SonamuConfig>
112
- ): Promise<SonamuConfig>;
96
+ export function defineConfig(config: Promise<SonamuConfig>): Promise<SonamuConfig>;
113
97
  export function defineConfig(config: SonamuConfigExport): SonamuConfigExport {
114
98
  return config;
115
99
  }
116
100
 
101
+ /**
102
+ * sonamu.config.ts 파일을 로드합니다.
103
+ * 이 설정 파일은 환경에 따라 다른 경로에 있을 수 있습니다.
104
+ * dist를 빌드하는 환경이라면 dist 바로 아래에 있을 것이고(cli-wrapper.ts에서 빌드),
105
+ * 그렇지 않은 환경이라면 프로젝트 루트에 있을 것입니다.
106
+ *
107
+ * 이 함수는 의도적으로 다른 의존성의 사용을 최대한 배제하였습니다.
108
+ * 이는 실행 초기에 최대한 빠르게 설정을 읽어올 수 있도록 하기 위함입니다.
109
+ * 따라서 경로 concat과 URL scheme 추가도 단순한 문자열 조작으로 처리하였습니다.
110
+ *
111
+ * @param rootPath
112
+ * @returns
113
+ */
117
114
  export async function loadConfig(rootPath: string): Promise<SonamuConfig> {
118
- const configPath = path.join(rootPath, "sonamu.config.ts");
119
- if (!(await exists(configPath))) {
120
- throw new Error(`Cannot find sonamu.config.ts in ${configPath}`);
121
- }
122
-
123
- const { code: configCode } = await transformFile(configPath, {
124
- module: {
125
- type: "es6",
126
- },
127
- jsc: {
128
- parser: {
129
- syntax: "typescript",
130
- decorators: true,
131
- },
132
- },
133
- });
134
-
135
- const tempDir = path.join(rootPath, "dist");
136
- const outputPath = path.join(tempDir, "sonamu.config.js");
137
- await writeFile(outputPath, configCode);
138
- const { default: config } = await import(outputPath);
139
- await unlink(outputPath);
140
-
115
+ const start = performance.now();
116
+ const configPath =
117
+ process.env.HOT === "yes" || process.env.VITEST === "true"
118
+ ? `${rootPath}/sonamu.config.ts`
119
+ : `${rootPath}/dist/sonamu.config.js`;
120
+ const { default: config } = await import(`file://${configPath}`);
121
+ const importTime = performance.now() - start;
122
+ process.env.NODE_ENV !== "test" &&
123
+ console.log(`[TIMING] loadConfig took ${importTime.toFixed(2)}ms`);
141
124
  return config;
142
125
  }
@@ -1,30 +1,19 @@
1
1
  import type { FastifyReply, FastifyRequest, PassportUser } from "fastify";
2
2
  import type { RouteGenericInterface } from "fastify/types/route";
3
- import type {
4
- Server,
5
- IncomingMessage,
6
- ServerResponse,
7
- IncomingHttpHeaders,
8
- } from "http";
9
- import type { FileStorage } from "../file-storage/file-storage";
3
+ import type { IncomingHttpHeaders, IncomingMessage, Server, ServerResponse } from "http";
10
4
  import type { ZodObject } from "zod";
5
+ import type { FileStorage } from "../file-storage/file-storage";
6
+ import type { NaiteStore } from "../naite/naite";
11
7
  import type { createSSEFactory } from "../stream/sse";
12
8
 
9
+ // biome-ignore lint/suspicious/noEmptyInterface: Context 확장 타입
13
10
  export interface ContextExtend {}
14
11
  export type Context = {
15
12
  request: FastifyRequest;
16
- reply: FastifyReply<
17
- Server,
18
- IncomingMessage,
19
- ServerResponse,
20
- RouteGenericInterface,
21
- unknown
22
- >;
13
+ reply: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>;
23
14
  headers: IncomingHttpHeaders;
24
- createSSE: <T extends ZodObject>(
25
- events: T
26
- ) => ReturnType<typeof createSSEFactory<T>>;
27
- naiteStore: Map<string, any>;
15
+ createSSE: <T extends ZodObject>(events: T) => ReturnType<typeof createSSEFactory<T>>;
16
+ naiteStore: NaiteStore;
28
17
  } & AuthContext &
29
18
  ContextExtend;
30
19
 
@@ -1,15 +1,18 @@
1
+ import assert from "assert";
1
2
  import type { HTTPMethods } from "fastify";
2
3
  import inflection from "inflection";
3
- import type { ApiParam, ApiParamType } from "../types/types";
4
- import { z } from "zod";
4
+ import { isEqual } from "radashi";
5
+ import type { z } from "zod";
6
+ import type { BaseModelClass } from "../database/base-model";
7
+ import { DB } from "../database/db";
5
8
  import {
6
9
  PuriTransactionWrapper,
7
- PuriWrapper,
8
- TransactionalOptions,
10
+ type PuriWrapper,
11
+ type TransactionalOptions,
9
12
  } from "../database/puri-wrapper";
10
- import { DB } from "../database/db";
11
- import { Sonamu } from "./sonamu";
13
+ import type { ApiParam, ApiParamType } from "../types/types";
12
14
  import type { UploadContext } from "./context";
15
+ import { Sonamu } from "./sonamu";
13
16
 
14
17
  export interface GuardKeys {
15
18
  query: true;
@@ -17,11 +20,7 @@ export interface GuardKeys {
17
20
  user: true;
18
21
  }
19
22
  export type GuardKey = keyof GuardKeys;
20
- export type ServiceClient =
21
- | "axios"
22
- | "axios-multipart"
23
- | "swr"
24
- | "window-fetch";
23
+ export type ServiceClient = "axios" | "axios-multipart" | "swr" | "window-fetch";
25
24
  export type ApiDecoratorOptions = {
26
25
  httpMethod?: HTTPMethods;
27
26
  contentType?:
@@ -39,6 +38,7 @@ export type ApiDecoratorOptions = {
39
38
  };
40
39
  export type StreamDecoratorOptions = {
41
40
  type: "sse"; // | 'ws
41
+ // biome-ignore lint/suspicious/noExplicitAny: 이벤트 키별로 넘겨주는 값이므로 어떤 타입이든 상관없음
42
42
  events: z.ZodObject<any>;
43
43
  path?: string;
44
44
  resourceName?: string;
@@ -49,6 +49,9 @@ export type UploadDecoratorOptions = {
49
49
  mode?: "single" | "multiple";
50
50
  };
51
51
  export const registeredApis: {
52
+ /**
53
+ * modelName은 모델 클래스 이름입니다. (ex. "UserModel")
54
+ */
52
55
  modelName: string;
53
56
  methodName: string;
54
57
  path: string;
@@ -67,6 +70,23 @@ export type ExtendedApi = {
67
70
  parameters: ApiParam[];
68
71
  returnType: ApiParamType;
69
72
  };
73
+ type DecoratorTarget = { constructor: { name: string } };
74
+
75
+ const DECORATOR_TYPES = {
76
+ API: Symbol("api"),
77
+ STREAM: Symbol("stream"),
78
+ } as const;
79
+
80
+ function checkSingleDecorator(target: DecoratorTarget, propertyKey: string, decoratorType: symbol) {
81
+ const method = target[propertyKey as keyof typeof target] as { __decoratorType?: symbol };
82
+ if (method?.__decoratorType && method?.__decoratorType !== decoratorType) {
83
+ throw new Error(
84
+ `@${String(decoratorType)} decorator can only be used once on ${target.constructor.name}.${propertyKey}. You can use only one of @api or @stream decorator on the same method.`,
85
+ );
86
+ } else {
87
+ method.__decoratorType = decoratorType;
88
+ }
89
+ }
70
90
 
71
91
  export function api(options: ApiDecoratorOptions = {}) {
72
92
  options = {
@@ -76,26 +96,43 @@ export function api(options: ApiDecoratorOptions = {}) {
76
96
  ...options,
77
97
  };
78
98
 
79
- return function (target: Object, propertyKey: string) {
80
- const modelName = target.constructor.name.match(/(.+)Class$/)![1];
99
+ return (target: DecoratorTarget, propertyKey: string) => {
100
+ const modelName = target.constructor.name.match(/(.+)Class$/)?.[1];
101
+ assert(
102
+ modelName,
103
+ `modelName is required on @api decorator on ${target.constructor.name}.${propertyKey}`,
104
+ );
81
105
  const methodName = propertyKey;
82
106
 
107
+ // 메서드에 걸린 데코레이터 중복 체크
108
+ checkSingleDecorator(target, propertyKey, DECORATOR_TYPES.API);
109
+
83
110
  const defaultPath = `/${inflection.camelize(
84
111
  modelName.replace(/Model$/, "").replace(/Frame$/, ""),
85
- true
112
+ true,
86
113
  )}/${inflection.camelize(propertyKey, true)}`;
114
+ const path = options.path ?? defaultPath;
87
115
 
88
116
  // 기존 동일한 메서드가 있는지 확인 후 있는 경우 override
89
117
  const existingApi = registeredApis.find(
90
- (api) => api.modelName === modelName && api.methodName === methodName
118
+ (api) => api.modelName === modelName && api.methodName === methodName,
91
119
  );
92
120
  if (existingApi) {
93
- existingApi.options = options;
121
+ // 기존의 path와 새로운 path가 다르다면(=빈 스트링이 아니었는데 다른 스트링으로 바뀌게 된다면) 에러를 터뜨려줍니다.
122
+ assertNoConflictingPath("api", modelName, methodName, existingApi.path, path);
123
+ existingApi.path = path;
124
+
125
+ // 기존의 옵션과 새로운 옵션이 겹치는 부분이 있다면 에러를 터뜨려줍니다.
126
+ assertNoConflictingOptions("api", modelName, methodName, existingApi.options, options);
127
+ existingApi.options = {
128
+ ...existingApi.options, // 기존의 옵션을 존중하되
129
+ ...options, // @api 데코레이터의 옵션을 추가합니다.
130
+ };
94
131
  } else {
95
132
  registeredApis.push({
96
133
  modelName,
97
134
  methodName,
98
- path: options.path ?? defaultPath,
135
+ path,
99
136
  options,
100
137
  });
101
138
  }
@@ -103,29 +140,55 @@ export function api(options: ApiDecoratorOptions = {}) {
103
140
  }
104
141
 
105
142
  export function stream(options: StreamDecoratorOptions) {
106
- return function (target: Object, propertyKey: string) {
107
- const modelName = target.constructor.name.match(/(.+)Class$/)![1];
143
+ return (target: DecoratorTarget, propertyKey: string) => {
144
+ const modelName = target.constructor.name.match(/(.+)Class$/)?.[1];
145
+ assert(
146
+ modelName,
147
+ `modelName is required on @stream decorator on ${target.constructor.name}.${propertyKey}`,
148
+ );
108
149
  const methodName = propertyKey;
109
150
 
151
+ // 메서드에 걸린 데코레이터 중복 체크
152
+ checkSingleDecorator(target, propertyKey, DECORATOR_TYPES.STREAM);
153
+
110
154
  const defaultPath = `/${inflection.camelize(
111
155
  modelName.replace(/Model$/, "").replace(/Frame$/, ""),
112
- true
156
+ true,
113
157
  )}/${inflection.camelize(propertyKey, true)}`;
158
+ const path = options.path ?? defaultPath;
159
+ const optionsWithDefaults = {
160
+ ...options,
161
+ httpMethod: "GET" as HTTPMethods,
162
+ };
114
163
 
115
164
  const existingApi = registeredApis.find(
116
- (api) => api.modelName === modelName && api.methodName === methodName
165
+ (api) => api.modelName === modelName && api.methodName === methodName,
117
166
  );
118
167
  if (existingApi) {
119
- existingApi.options = options;
168
+ // 기존의 path와 새로운 path가 다르다면(=빈 스트링이 아니었는데 다른 스트링으로 바뀌게 된다면) 에러를 터뜨려줍니다.
169
+ assertNoConflictingPath("stream", modelName, methodName, existingApi.path, path);
170
+ existingApi.path = path;
171
+
172
+ // 기존의 옵션과 새로운 옵션이 겹치는 부분이 있다면 에러를 터뜨려줍니다.
173
+ assertNoConflictingOptions(
174
+ "stream",
175
+ modelName,
176
+ methodName,
177
+ existingApi.options,
178
+ optionsWithDefaults,
179
+ );
180
+ existingApi.options = {
181
+ ...existingApi.options, // 기존의 옵션을 존중하되
182
+ ...optionsWithDefaults, // @stream 데코레이터의 옵션을 추가합니다.
183
+ };
184
+
185
+ existingApi.streamOptions = options;
120
186
  } else {
121
187
  registeredApis.push({
122
188
  modelName,
123
189
  methodName,
124
- path: options.path ?? defaultPath,
125
- options: {
126
- ...options,
127
- httpMethod: "GET",
128
- },
190
+ path,
191
+ options: optionsWithDefaults,
129
192
  streamOptions: options,
130
193
  });
131
194
  }
@@ -135,14 +198,10 @@ export function stream(options: StreamDecoratorOptions) {
135
198
  export function transactional(options: TransactionalOptions = {}) {
136
199
  const { isolation, readOnly, dbPreset = "w" } = options;
137
200
 
138
- return function (
139
- _target: Object,
140
- _propertyKey: string,
141
- descriptor: PropertyDescriptor
142
- ) {
201
+ return (_target: DecoratorTarget, _propertyKey: string, descriptor: PropertyDescriptor) => {
143
202
  const originalMethod = descriptor.value;
144
203
 
145
- descriptor.value = async function (this: any, ...args: any[]) {
204
+ descriptor.value = async function (this: BaseModelClass, ...args: unknown[]) {
146
205
  const existingContext = DB.transactionStorage.getStore();
147
206
 
148
207
  // 이미 AsyncLocalStorage 컨텍스트 안에 있는지 확인
@@ -159,10 +218,7 @@ export function transactional(options: TransactionalOptions = {}) {
159
218
 
160
219
  return puri.knex.transaction(
161
220
  async (trx) => {
162
- const trxWrapper = new PuriTransactionWrapper(
163
- trx,
164
- this.getUpsertBuilder()
165
- );
221
+ const trxWrapper = new PuriTransactionWrapper(trx, this.getUpsertBuilder());
166
222
  // TransactionContext에 트랜잭션 저장
167
223
  DB.getTransactionContext().setTransaction(dbPreset, trxWrapper);
168
224
 
@@ -173,7 +229,7 @@ export function transactional(options: TransactionalOptions = {}) {
173
229
  DB.getTransactionContext().deleteTransaction(dbPreset);
174
230
  }
175
231
  },
176
- { isolationLevel: isolation, readOnly }
232
+ { isolationLevel: isolation, readOnly },
177
233
  );
178
234
  };
179
235
 
@@ -190,25 +246,42 @@ export function transactional(options: TransactionalOptions = {}) {
190
246
  };
191
247
  }
192
248
 
249
+ /**
250
+ * api 데코레이터와 함께 사용할 수 있습니다.
251
+ * @param options
252
+ * @returns
253
+ */
193
254
  export function upload(options: UploadDecoratorOptions = {}) {
194
- return function (
195
- _target: Object,
196
- _propertyKey: string,
197
- descriptor: PropertyDescriptor
198
- ) {
255
+ return (_target: DecoratorTarget, _propertyKey: string, descriptor: PropertyDescriptor) => {
199
256
  const originalMethod = descriptor.value;
200
- const modelName = _target.constructor.name.match(/(.+)Class$/)![1];
257
+ const modelName = _target.constructor.name.match(/(.+)Class$/)?.[1];
258
+ assert(
259
+ modelName,
260
+ `modelName is required on @upload decorator on ${_target.constructor.name}.${_propertyKey}`,
261
+ );
201
262
  const methodName = _propertyKey;
202
263
 
203
264
  // registeredApis에서 해당 API 찾아서 uploadOptions 추가
204
265
  const existingApi = registeredApis.find(
205
- (api) => api.modelName === modelName && api.methodName === methodName
266
+ (api) => api.modelName === modelName && api.methodName === methodName,
206
267
  );
207
268
  if (existingApi) {
208
269
  existingApi.uploadOptions = options;
270
+ } else {
271
+ // 이 메소드에 붙은 @api 데코레이터가 아직 eval되지 않은 상황입니다. (만약 @api가 안 붙어 있었다면 심각한 상황입니다..!)
272
+ // 여기에서 최초로 modelName과 methodName에 대해 registeredApis에 하나를 추가해주어야 합니다.
273
+ // uploadOptions는 그대로 추가하고, path는 빈 스트링으로 추가해줍니다.
274
+ // 이후 @api 데코레이터가 eval되면 실제 path로 덮어씌워지고, options가 추가됩니다.
275
+ registeredApis.push({
276
+ modelName,
277
+ methodName,
278
+ path: "",
279
+ options: {},
280
+ uploadOptions: options,
281
+ });
209
282
  }
210
283
 
211
- descriptor.value = async function (this: any, ...args: any[]) {
284
+ descriptor.value = async function (this: BaseModelClass, ...args: unknown[]) {
212
285
  const { request } = Sonamu.getContext();
213
286
  const uploadContext: UploadContext = {
214
287
  file: undefined,
@@ -244,3 +317,59 @@ export function upload(options: UploadDecoratorOptions = {}) {
244
317
  return descriptor;
245
318
  };
246
319
  }
320
+
321
+ /**
322
+ * 기존의 path와 새로운 path가 다르다면(=값이 있던 스트링이 다른 값이 있는 스트링으로 바뀌게 된다면) 에러를 터뜨려줍니다.
323
+ * @param decoratorName 데코레이터 이름
324
+ * @param modelName 모델 이름
325
+ * @param methodName 메서드 이름
326
+ * @param existingPath 기존의 path
327
+ * @param newPath 새로운 path
328
+ */
329
+ function assertNoConflictingPath(
330
+ decoratorName: string,
331
+ modelName: string,
332
+ methodName: string,
333
+ existingPath: string,
334
+ newPath: string,
335
+ ) {
336
+ if (existingPath !== "" && newPath !== "" && existingPath !== newPath) {
337
+ // 이것이 무슨 상황이냐면요, api.path가 덮어씌워지는 상황입니다.
338
+ // 가령 @api({ path: "/api/v1/users" }) 데코레이터가 붙어있는 메서드에
339
+ // @stream({ path: "/api/v1/users/stream" }) 같은 것이 붙어 있는 상황입니다.
340
+ // 이렇게 되면 두 데코레이터가 같은 api의 path 필드를 건드리게 되므로, 에러를 터뜨려줍니다.
341
+ throw new Error(
342
+ `@${decoratorName} decorator on ${modelName}.${methodName} has conflicting path: ${newPath}. The decorator is trying to override the existing path(${existingPath}) with the new path(${newPath}).`,
343
+ );
344
+ }
345
+ }
346
+
347
+ /**
348
+ * 기존의 옵션과 새로운 옵션이 겹치는 부분이 있다면 에러를 터뜨려줍니다.
349
+ * @param decoratorName 데코레이터 이름
350
+ * @param modelName 모델 이름
351
+ * @param methodName 메서드 이름
352
+ * @param existingOptions 기존의 옵션
353
+ * @param newOptions 새로운 옵션
354
+ */
355
+ function assertNoConflictingOptions(
356
+ decoratorName: string,
357
+ modelName: string,
358
+ methodName: string,
359
+ // biome-ignore lint/suspicious/noExplicitAny: <아 쉽게쉽게 좀 갑시다>
360
+ existingOptions: Record<string, any>,
361
+ // biome-ignore lint/suspicious/noExplicitAny: <이럴 때 아니면 any 언제 씁니까>
362
+ newOptions: Record<string, any>,
363
+ ) {
364
+ Object.keys(newOptions).forEach((key) => {
365
+ if (existingOptions[key] && !isEqual(existingOptions[key], newOptions[key])) {
366
+ // 이것이 무슨 상황이냐면요, api.options가 덮어씌워지는 상황입니다.
367
+ // 가령 @api({ resourceName: "Users" }) 데코레이터가 붙어있는 메서드에
368
+ // @stream({ resourceName: "Posts" }) 같은 것이 붙어 있는 상황입니다.
369
+ // 이렇게 되면 두 데코레이터가 같은 api의 options 속 같은 필드를 건드리게 되므로, 에러를 터뜨려줍니다.
370
+ throw new Error(
371
+ `@${decoratorName} decorator on ${modelName}.${methodName} has conflicting options: ${key}. The decorator is trying to override the existing option(${JSON.stringify(existingOptions[key])}) with the new option(${JSON.stringify(newOptions[key])}).`,
372
+ );
373
+ }
374
+ });
375
+ }
package/src/api/index.ts CHANGED
@@ -1,7 +1,7 @@
1
+ export * from "../file-storage/driver";
2
+ export * from "../file-storage/file-storage";
1
3
  export * from "./caster";
2
4
  export * from "./code-converters";
3
5
  export * from "./context";
4
6
  export * from "./decorators";
5
- export * from "../file-storage/driver";
6
- export * from "../file-storage/file-storage";
7
7
  export * from "./sonamu";