sonamu 0.8.26 → 0.9.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.
- package/bin/cli.js +60 -13
- package/dist/_virtual/rolldown_runtime.js +39 -0
- package/dist/ai/agents/agent.d.ts +3 -3
- package/dist/ai/agents/agent.d.ts.map +1 -1
- package/dist/ai/agents/agent.js +76 -73
- package/dist/ai/agents/index.js +3 -3
- package/dist/ai/agents/types.d.ts +3 -3
- package/dist/ai/agents/types.d.ts.map +1 -1
- package/dist/ai/agents/types.js +1 -3
- package/dist/ai/index.js +3 -2
- package/dist/ai/providers/rtzr/api.js +25 -25
- package/dist/ai/providers/rtzr/error.js +25 -26
- package/dist/ai/providers/rtzr/index.js +5 -5
- package/dist/ai/providers/rtzr/model.d.ts +1 -1
- package/dist/ai/providers/rtzr/model.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/model.js +117 -133
- package/dist/ai/providers/rtzr/options.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/options.js +35 -41
- package/dist/ai/providers/rtzr/provider.d.ts +1 -1
- package/dist/ai/providers/rtzr/provider.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/provider.js +53 -51
- package/dist/ai/providers/rtzr/utils.d.ts.map +1 -1
- package/dist/ai/providers/rtzr/utils.js +84 -84
- package/dist/api/base-frame.d.ts +2 -2
- package/dist/api/base-frame.d.ts.map +1 -1
- package/dist/api/base-frame.js +29 -19
- package/dist/api/caster.d.ts +1 -1
- package/dist/api/caster.d.ts.map +1 -1
- package/dist/api/caster.js +51 -61
- package/dist/api/code-converters.d.ts +4 -3
- package/dist/api/code-converters.d.ts.map +1 -1
- package/dist/api/code-converters.js +226 -249
- package/dist/api/config.d.ts +17 -17
- package/dist/api/config.d.ts.map +1 -1
- package/dist/api/config.js +37 -30
- package/dist/api/context.d.ts +10 -10
- package/dist/api/context.d.ts.map +1 -1
- package/dist/api/context.js +8 -2
- package/dist/api/decorators.d.ts +8 -8
- package/dist/api/decorators.d.ts.map +1 -1
- package/dist/api/decorators.js +245 -268
- package/dist/api/index.js +39 -7
- package/dist/api/secret.js +22 -15
- package/dist/api/sonamu.d.ts +15 -15
- package/dist/api/sonamu.d.ts.map +1 -1
- package/dist/api/sonamu.js +1012 -1131
- package/dist/api/validator.js +88 -79
- package/dist/auth/auth-generator.d.ts.map +1 -1
- package/dist/auth/auth-generator.js +203 -200
- package/dist/auth/better-auth-entities.d.ts +2 -2
- package/dist/auth/better-auth-entities.d.ts.map +1 -1
- package/dist/auth/better-auth-entities.js +369 -429
- package/dist/auth/index.js +21 -6
- package/dist/auth/knex-adapter.d.ts +2 -2
- package/dist/auth/knex-adapter.d.ts.map +1 -1
- package/dist/auth/knex-adapter.js +153 -157
- package/dist/auth/plugins/entity-definitions/admin.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/admin.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/admin.js +58 -56
- package/dist/auth/plugins/entity-definitions/anonymous.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/anonymous.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/anonymous.js +20 -20
- package/dist/auth/plugins/entity-definitions/api-key.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/api-key.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/api-key.js +185 -196
- package/dist/auth/plugins/entity-definitions/index.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/index.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/index.js +26 -29
- package/dist/auth/plugins/entity-definitions/jwt.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/jwt.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/jwt.js +62 -64
- package/dist/auth/plugins/entity-definitions/organization.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/organization.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/organization.js +362 -421
- package/dist/auth/plugins/entity-definitions/passkey.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/passkey.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/passkey.js +115 -126
- package/dist/auth/plugins/entity-definitions/phone-number.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/phone-number.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/phone-number.js +31 -40
- package/dist/auth/plugins/entity-definitions/sso.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/sso.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/sso.js +94 -107
- package/dist/auth/plugins/entity-definitions/two-factor.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/two-factor.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/two-factor.js +78 -92
- package/dist/auth/plugins/entity-definitions/types.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/types.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/types.js +1 -10
- package/dist/auth/plugins/entity-definitions/username.d.ts +1 -1
- package/dist/auth/plugins/entity-definitions/username.d.ts.map +1 -1
- package/dist/auth/plugins/entity-definitions/username.js +31 -40
- package/dist/auth/plugins/index.js +12 -3
- package/dist/auth/plugins/wrappers/admin.d.ts +2 -2
- package/dist/auth/plugins/wrappers/admin.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/admin.js +28 -29
- package/dist/auth/plugins/wrappers/anonymous.d.ts +2 -1
- package/dist/auth/plugins/wrappers/anonymous.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/anonymous.js +23 -22
- package/dist/auth/plugins/wrappers/api-key.d.ts +2 -1
- package/dist/auth/plugins/wrappers/api-key.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/api-key.js +39 -34
- package/dist/auth/plugins/wrappers/index.js +11 -11
- package/dist/auth/plugins/wrappers/jwt.d.ts +2 -1
- package/dist/auth/plugins/wrappers/jwt.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/jwt.js +31 -26
- package/dist/auth/plugins/wrappers/organization.d.ts +2 -1
- package/dist/auth/plugins/wrappers/organization.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/organization.js +65 -62
- package/dist/auth/plugins/wrappers/passkey.d.ts +2 -1
- package/dist/auth/plugins/wrappers/passkey.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/passkey.js +33 -28
- package/dist/auth/plugins/wrappers/phone-number.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/phone-number.js +26 -23
- package/dist/auth/plugins/wrappers/sso.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/sso.js +37 -31
- package/dist/auth/plugins/wrappers/two-factor.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/two-factor.js +31 -28
- package/dist/auth/plugins/wrappers/username.d.ts.map +1 -1
- package/dist/auth/plugins/wrappers/username.js +23 -23
- package/dist/bin/build-config.js +31 -31
- package/dist/bin/cli.js +1063 -1204
- package/dist/bin/fixture.d.ts.map +1 -1
- package/dist/bin/fixture.js +266 -259
- package/dist/bin/hmr-hook-register.d.ts.map +1 -1
- package/dist/bin/hmr-hook-register.js +19 -18
- package/dist/bin/test-command.d.ts.map +1 -1
- package/dist/bin/test-command.js +180 -177
- package/dist/bin/ts-loader-register.js +13 -6
- package/dist/bin/ts-loader-registration.d.ts.map +1 -1
- package/dist/bin/ts-loader-registration.js +28 -38
- package/dist/cache/cache-manager.d.ts +1 -1
- package/dist/cache/cache-manager.d.ts.map +1 -1
- package/dist/cache/cache-manager.js +20 -15
- package/dist/cache/decorator.d.ts +1 -1
- package/dist/cache/decorator.d.ts.map +1 -1
- package/dist/cache/decorator.js +84 -76
- package/dist/cache/drivers.js +21 -34
- package/dist/cache/index.js +10 -7
- package/dist/cache/types.d.ts +2 -2
- package/dist/cache/types.d.ts.map +1 -1
- package/dist/cache/types.js +1 -6
- package/dist/cache-control/cache-control.d.ts +2 -2
- package/dist/cache-control/cache-control.d.ts.map +1 -1
- package/dist/cache-control/cache-control.js +106 -122
- package/dist/cache-control/types.d.ts +2 -2
- package/dist/cache-control/types.d.ts.map +1 -1
- package/dist/cache-control/types.js +1 -19
- package/dist/compress/compress.d.ts +1 -1
- package/dist/compress/compress.d.ts.map +1 -1
- package/dist/compress/compress.js +58 -56
- package/dist/compress/index.js +7 -2
- package/dist/compress/types.js +1 -11
- package/dist/cone/cone-generator.d.ts +1 -1
- package/dist/cone/cone-generator.d.ts.map +1 -1
- package/dist/cone/cone-generator.js +216 -219
- package/dist/database/_batch_update.d.ts +1 -1
- package/dist/database/_batch_update.d.ts.map +1 -1
- package/dist/database/_batch_update.js +107 -102
- package/dist/database/base-model.d.ts +8 -9
- package/dist/database/base-model.d.ts.map +1 -1
- package/dist/database/base-model.js +371 -392
- package/dist/database/base-model.types.d.ts +5 -5
- package/dist/database/base-model.types.d.ts.map +1 -1
- package/dist/database/base-model.types.js +1 -20
- package/dist/database/db.d.ts +5 -2
- package/dist/database/db.d.ts.map +1 -1
- package/dist/database/db.js +185 -171
- package/dist/database/knex.d.ts +1 -1
- package/dist/database/knex.d.ts.map +1 -1
- package/dist/database/knex.js +48 -42
- package/dist/database/puri-subset.types.d.ts +6 -7
- package/dist/database/puri-subset.types.d.ts.map +1 -1
- package/dist/database/puri-subset.types.js +1 -16
- package/dist/database/puri-wrapper.d.ts +6 -6
- package/dist/database/puri-wrapper.d.ts.map +1 -1
- package/dist/database/puri-wrapper.js +99 -101
- package/dist/database/puri.d.ts +4 -5
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +1021 -1227
- package/dist/database/puri.types.d.ts +6 -6
- package/dist/database/puri.types.d.ts.map +1 -1
- package/dist/database/puri.types.js +15 -6
- package/dist/database/transaction-context.d.ts +2 -2
- package/dist/database/transaction-context.d.ts.map +1 -1
- package/dist/database/transaction-context.js +22 -13
- package/dist/database/upsert-builder.d.ts +3 -3
- package/dist/database/upsert-builder.d.ts.map +1 -1
- package/dist/database/upsert-builder.js +405 -465
- package/dist/dict/en.js +72 -74
- package/dist/dict/index.js +13 -13
- package/dist/dict/ko.js +72 -74
- package/dist/dict/rc-keys.js +150 -168
- package/dist/dict/sd.d.ts +3 -1
- package/dist/dict/sd.d.ts.map +1 -1
- package/dist/dict/sd.js +54 -40
- package/dist/dict/sonamu-dictionary.d.ts +1 -1
- package/dist/dict/sonamu-dictionary.d.ts.map +1 -1
- package/dist/dict/sonamu-dictionary.js +887 -955
- package/dist/dict/types.js +1 -7
- package/dist/dict/utils.js +26 -24
- package/dist/entity/entity-manager.d.ts +9 -9
- package/dist/entity/entity-manager.d.ts.map +1 -1
- package/dist/entity/entity-manager.js +226 -223
- package/dist/entity/entity-template-cone.d.ts +1 -1
- package/dist/entity/entity-template-cone.d.ts.map +1 -1
- package/dist/entity/entity-template-cone.js +152 -151
- package/dist/entity/entity.d.ts.map +1 -1
- package/dist/entity/entity.js +952 -1089
- package/dist/exceptions/error-handler.d.ts +1 -1
- package/dist/exceptions/error-handler.d.ts.map +1 -1
- package/dist/exceptions/error-handler.js +32 -27
- package/dist/exceptions/so-exceptions.d.ts +1 -1
- package/dist/exceptions/so-exceptions.d.ts.map +1 -1
- package/dist/exceptions/so-exceptions.js +61 -68
- package/dist/filter/index.js +9 -3
- package/dist/filter/types.js +92 -88
- package/dist/filter/utils.d.ts +1 -1
- package/dist/filter/utils.d.ts.map +1 -1
- package/dist/filter/utils.js +147 -161
- package/dist/index.js +87 -40
- package/dist/logger/category.d.ts.map +1 -1
- package/dist/logger/category.js +30 -29
- package/dist/logger/configure.d.ts.map +1 -1
- package/dist/logger/configure.js +83 -107
- package/dist/migration/code-generation.d.ts +2 -2
- package/dist/migration/code-generation.d.ts.map +1 -1
- package/dist/migration/code-generation.js +1385 -1578
- package/dist/migration/migration-set.d.ts +1 -1
- package/dist/migration/migration-set.d.ts.map +1 -1
- package/dist/migration/migration-set.js +177 -227
- package/dist/migration/migrator.d.ts +4 -3
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +340 -345
- package/dist/migration/postgresql-schema-reader.d.ts +2 -2
- package/dist/migration/postgresql-schema-reader.d.ts.map +1 -1
- package/dist/migration/postgresql-schema-reader.js +506 -564
- package/dist/migration/slack-confirm.d.ts +2 -2
- package/dist/migration/slack-confirm.d.ts.map +1 -1
- package/dist/migration/slack-confirm.js +205 -193
- package/dist/migration/types.d.ts +2 -2
- package/dist/migration/types.d.ts.map +1 -1
- package/dist/migration/types.js +1 -3
- package/dist/naite/messaging-types.d.ts +1 -0
- package/dist/naite/messaging-types.d.ts.map +1 -1
- package/dist/naite/messaging-types.js +1 -7
- package/dist/naite/naite-reporter.d.ts +2 -2
- package/dist/naite/naite-reporter.d.ts.map +1 -1
- package/dist/naite/naite-reporter.js +127 -120
- package/dist/naite/naite.d.ts +3 -2
- package/dist/naite/naite.d.ts.map +1 -1
- package/dist/naite/naite.js +266 -300
- package/dist/ssr/index.d.ts +2 -2
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +13 -3
- package/dist/ssr/registry.d.ts +1 -1
- package/dist/ssr/registry.d.ts.map +1 -1
- package/dist/ssr/registry.js +45 -37
- package/dist/ssr/renderer.d.ts +4 -4
- package/dist/ssr/renderer.d.ts.map +1 -1
- package/dist/ssr/renderer.js +84 -91
- package/dist/ssr/types.d.ts +2 -2
- package/dist/ssr/types.d.ts.map +1 -1
- package/dist/ssr/types.js +1 -3
- package/dist/storage/base-file.js +54 -41
- package/dist/storage/buffered-file.d.ts +2 -2
- package/dist/storage/buffered-file.d.ts.map +1 -1
- package/dist/storage/buffered-file.js +51 -44
- package/dist/storage/drivers.d.ts +2 -2
- package/dist/storage/drivers.d.ts.map +1 -1
- package/dist/storage/drivers.js +12 -7
- package/dist/storage/index.js +14 -7
- package/dist/storage/s3-driver.d.ts +2 -2
- package/dist/storage/s3-driver.d.ts.map +1 -1
- package/dist/storage/s3-driver.js +52 -48
- package/dist/storage/storage-manager.d.ts +2 -2
- package/dist/storage/storage-manager.d.ts.map +1 -1
- package/dist/storage/storage-manager.js +33 -25
- package/dist/storage/types.d.ts +2 -2
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/types.js +1 -5
- package/dist/storage/uploaded-file.d.ts +1 -1
- package/dist/storage/uploaded-file.d.ts.map +1 -1
- package/dist/storage/uploaded-file.js +45 -35
- package/dist/stream/index.js +7 -2
- package/dist/stream/sse.d.ts +2 -2
- package/dist/stream/sse.d.ts.map +1 -1
- package/dist/stream/sse.js +72 -67
- package/dist/syncer/api-parser.d.ts +1 -1
- package/dist/syncer/api-parser.d.ts.map +1 -1
- package/dist/syncer/api-parser.js +224 -245
- package/dist/syncer/checksum.d.ts +1 -1
- package/dist/syncer/checksum.d.ts.map +1 -1
- package/dist/syncer/checksum.js +86 -72
- package/dist/syncer/code-generator.d.ts +2 -2
- package/dist/syncer/code-generator.d.ts.map +1 -1
- package/dist/syncer/code-generator.js +154 -160
- package/dist/syncer/entity-operations.d.ts +1 -1
- package/dist/syncer/entity-operations.d.ts.map +1 -1
- package/dist/syncer/entity-operations.js +63 -54
- package/dist/syncer/file-patterns.d.ts +1 -1
- package/dist/syncer/file-patterns.d.ts.map +1 -1
- package/dist/syncer/file-patterns.js +38 -38
- package/dist/syncer/index.js +19 -8
- package/dist/syncer/module-loader.d.ts +5 -5
- package/dist/syncer/module-loader.d.ts.map +1 -1
- package/dist/syncer/module-loader.js +83 -78
- package/dist/syncer/syncer-actions.d.ts +2 -2
- package/dist/syncer/syncer-actions.d.ts.map +1 -1
- package/dist/syncer/syncer-actions.js +76 -91
- package/dist/syncer/syncer.d.ts +7 -6
- package/dist/syncer/syncer.d.ts.map +1 -1
- package/dist/syncer/syncer.js +426 -492
- package/dist/tasks/decorator.d.ts +3 -3
- package/dist/tasks/decorator.d.ts.map +1 -1
- package/dist/tasks/decorator.js +32 -28
- package/dist/tasks/step-wrapper.d.ts +1 -1
- package/dist/tasks/step-wrapper.d.ts.map +1 -1
- package/dist/tasks/step-wrapper.js +42 -41
- package/dist/tasks/workflow-manager.d.ts +2 -2
- package/dist/tasks/workflow-manager.d.ts.map +1 -1
- package/dist/tasks/workflow-manager.js +192 -221
- package/dist/template/entity-converter.d.ts +1 -1
- package/dist/template/entity-converter.d.ts.map +1 -1
- package/dist/template/entity-converter.js +103 -103
- package/dist/template/helpers.d.ts.map +1 -1
- package/dist/template/helpers.js +163 -163
- package/dist/template/implementations/entity.template.d.ts +1 -1
- package/dist/template/implementations/entity.template.d.ts.map +1 -1
- package/dist/template/implementations/entity.template.js +76 -85
- package/dist/template/implementations/entry-server.template.d.ts +1 -1
- package/dist/template/implementations/entry-server.template.d.ts.map +1 -1
- package/dist/template/implementations/entry-server.template.js +32 -27
- package/dist/template/implementations/generated.template.d.ts +1 -1
- package/dist/template/implementations/generated.template.d.ts.map +1 -1
- package/dist/template/implementations/generated.template.js +254 -275
- package/dist/template/implementations/generated_http.template.d.ts +2 -2
- package/dist/template/implementations/generated_http.template.d.ts.map +1 -1
- package/dist/template/implementations/generated_http.template.js +114 -133
- package/dist/template/implementations/generated_sso.template.d.ts.map +1 -1
- package/dist/template/implementations/generated_sso.template.js +249 -275
- package/dist/template/implementations/init_types.template.d.ts +1 -1
- package/dist/template/implementations/init_types.template.d.ts.map +1 -1
- package/dist/template/implementations/init_types.template.js +40 -34
- package/dist/template/implementations/model.template.d.ts +1 -1
- package/dist/template/implementations/model.template.d.ts.map +1 -1
- package/dist/template/implementations/model.template.js +56 -53
- package/dist/template/implementations/model_test.template.d.ts +1 -1
- package/dist/template/implementations/model_test.template.d.ts.map +1 -1
- package/dist/template/implementations/model_test.template.js +32 -24
- package/dist/template/implementations/queries.template.d.ts +1 -1
- package/dist/template/implementations/queries.template.d.ts.map +1 -1
- package/dist/template/implementations/queries.template.js +84 -89
- package/dist/template/implementations/sd.template.d.ts +1 -1
- package/dist/template/implementations/sd.template.d.ts.map +1 -1
- package/dist/template/implementations/sd.template.js +137 -144
- package/dist/template/implementations/services.template.d.ts +1 -1
- package/dist/template/implementations/services.template.d.ts.map +1 -1
- package/dist/template/implementations/services.template.js +164 -189
- package/dist/template/implementations/view_form.template.d.ts +1 -1
- package/dist/template/implementations/view_form.template.d.ts.map +1 -1
- package/dist/template/implementations/view_form.template.js +258 -285
- package/dist/template/implementations/view_id_all_select.template.d.ts +1 -1
- package/dist/template/implementations/view_id_all_select.template.d.ts.map +1 -1
- package/dist/template/implementations/view_id_all_select.template.js +31 -25
- package/dist/template/implementations/view_list.template.d.ts +1 -1
- package/dist/template/implementations/view_list.template.d.ts.map +1 -1
- package/dist/template/implementations/view_list.template.js +304 -355
- package/dist/template/implementations/view_search_input.template.d.ts +1 -1
- package/dist/template/implementations/view_search_input.template.d.ts.map +1 -1
- package/dist/template/implementations/view_search_input.template.js +31 -27
- package/dist/template/index.js +21 -7
- package/dist/template/template-manager.d.ts +1 -1
- package/dist/template/template-manager.d.ts.map +1 -1
- package/dist/template/template-manager.js +132 -123
- package/dist/template/template-types.js +8 -6
- package/dist/template/template.d.ts +2 -2
- package/dist/template/template.d.ts.map +1 -1
- package/dist/template/template.js +73 -68
- package/dist/template/zod-converter.d.ts.map +1 -1
- package/dist/template/zod-converter.js +603 -657
- package/dist/testing/_relation-graph.d.ts +1 -1
- package/dist/testing/_relation-graph.d.ts.map +1 -1
- package/dist/testing/_relation-graph.js +93 -88
- package/dist/testing/bootstrap.d.ts +22 -13
- package/dist/testing/bootstrap.d.ts.map +1 -1
- package/dist/testing/bootstrap.js +114 -114
- package/dist/testing/data-explorer.d.ts +3 -3
- package/dist/testing/data-explorer.d.ts.map +1 -1
- package/dist/testing/data-explorer.js +237 -265
- package/dist/testing/dev-test-routes.d.ts +2 -2
- package/dist/testing/dev-test-routes.d.ts.map +1 -1
- package/dist/testing/dev-test-routes.js +258 -249
- package/dist/testing/dev-vitest-manager.d.ts +1 -1
- package/dist/testing/dev-vitest-manager.d.ts.map +1 -1
- package/dist/testing/dev-vitest-manager.js +514 -539
- package/dist/testing/faker-mappings.js +422 -420
- package/dist/testing/fixture-generator.d.ts +3 -3
- package/dist/testing/fixture-generator.d.ts.map +1 -1
- package/dist/testing/fixture-generator.js +1216 -1346
- package/dist/testing/fixture-loader.js +26 -25
- package/dist/testing/fixture-manager.d.ts +3 -3
- package/dist/testing/fixture-manager.d.ts.map +1 -1
- package/dist/testing/fixture-manager.js +706 -776
- package/dist/testing/global-setup.js +53 -49
- package/dist/testing/index.js +19 -11
- package/dist/testing/naite-vitest-reporter.js +18 -13
- package/dist/testing/parallel-db-manager.d.ts +1 -1
- package/dist/testing/parallel-db-manager.d.ts.map +1 -1
- package/dist/testing/parallel-db-manager.js +63 -78
- package/dist/testing/vitest-helpers.d.ts +1 -1
- package/dist/testing/vitest-helpers.d.ts.map +1 -1
- package/dist/testing/vitest-helpers.js +37 -33
- package/dist/types/types.d.ts +28 -28
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +764 -890
- package/dist/ui/ai-api.d.ts +1 -1
- package/dist/ui/ai-api.d.ts.map +1 -1
- package/dist/ui/ai-api.js +52 -42
- package/dist/ui/ai-client.d.ts +1 -2
- package/dist/ui/ai-client.d.ts.map +1 -1
- package/dist/ui/ai-client.js +353 -388
- package/dist/ui/api.d.ts +1 -1
- package/dist/ui/api.d.ts.map +1 -1
- package/dist/ui/api.js +903 -1145
- package/dist/ui/cdd-service.d.ts +1 -1
- package/dist/ui/cdd-service.d.ts.map +1 -1
- package/dist/ui/cdd-service.js +406 -407
- package/dist/ui/cdd-types.js +1 -3
- package/dist/ui-web/assets/index-C-Zz-wYg.css +1 -0
- package/dist/ui-web/assets/index-DejDON8K.js +238 -0
- package/dist/ui-web/index.html +3 -3
- package/dist/utils/async-utils.js +57 -45
- package/dist/utils/console-util.d.ts.map +1 -1
- package/dist/utils/console-util.js +104 -87
- package/dist/utils/controller.js +26 -19
- package/dist/utils/esm-utils.js +49 -38
- package/dist/utils/formatter.d.ts +1 -2
- package/dist/utils/formatter.d.ts.map +1 -1
- package/dist/utils/formatter.js +89 -115
- package/dist/utils/fs-utils.d.ts.map +1 -1
- package/dist/utils/fs-utils.js +68 -65
- package/dist/utils/lodash-able.js +11 -4
- package/dist/utils/model.d.ts +1 -1
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +21 -19
- package/dist/utils/object-utils.js +148 -186
- package/dist/utils/path-utils.js +67 -57
- package/dist/utils/process-utils.d.ts.map +1 -1
- package/dist/utils/process-utils.js +37 -31
- package/dist/utils/sql-parser.d.ts +1 -1
- package/dist/utils/sql-parser.d.ts.map +1 -1
- package/dist/utils/sql-parser.js +40 -40
- package/dist/utils/type-utils.js +44 -43
- package/dist/utils/utils.d.ts +2 -3
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +81 -93
- package/dist/utils/zod-error.d.ts +1 -1
- package/dist/utils/zod-error.d.ts.map +1 -1
- package/dist/utils/zod-error.js +24 -17
- package/dist/vector/chunking.d.ts +1 -1
- package/dist/vector/chunking.d.ts.map +1 -1
- package/dist/vector/chunking.js +100 -94
- package/dist/vector/config.d.ts +1 -1
- package/dist/vector/config.d.ts.map +1 -1
- package/dist/vector/config.js +76 -78
- package/dist/vector/embedding.d.ts +1 -1
- package/dist/vector/embedding.d.ts.map +1 -1
- package/dist/vector/embedding.js +128 -125
- package/dist/vector/index.js +5 -5
- package/dist/vector/types.js +1 -5
- package/package.json +31 -36
- package/src/ai/agents/agent.ts +12 -5
- package/src/ai/agents/types.ts +5 -5
- package/src/ai/providers/rtzr/model.ts +8 -10
- package/src/ai/providers/rtzr/options.ts +2 -1
- package/src/ai/providers/rtzr/provider.ts +5 -3
- package/src/ai/providers/rtzr/utils.ts +2 -7
- package/src/api/__tests__/config.test.ts +15 -8
- package/src/api/base-frame.ts +5 -3
- package/src/api/caster.ts +7 -6
- package/src/api/code-converters.ts +23 -26
- package/src/api/config.ts +23 -17
- package/src/api/context.ts +18 -11
- package/src/api/decorators.ts +17 -18
- package/src/api/sonamu.ts +44 -49
- package/src/auth/auth-generator.ts +4 -6
- package/src/auth/better-auth-entities.ts +3 -2
- package/src/auth/knex-adapter.ts +6 -5
- package/src/auth/plugins/entity-definitions/admin.ts +1 -1
- package/src/auth/plugins/entity-definitions/anonymous.ts +1 -1
- package/src/auth/plugins/entity-definitions/api-key.ts +1 -1
- package/src/auth/plugins/entity-definitions/index.ts +1 -1
- package/src/auth/plugins/entity-definitions/jwt.ts +1 -1
- package/src/auth/plugins/entity-definitions/organization.ts +1 -1
- package/src/auth/plugins/entity-definitions/passkey.ts +1 -1
- package/src/auth/plugins/entity-definitions/phone-number.ts +1 -1
- package/src/auth/plugins/entity-definitions/sso.ts +1 -1
- package/src/auth/plugins/entity-definitions/two-factor.ts +1 -1
- package/src/auth/plugins/entity-definitions/types.ts +1 -1
- package/src/auth/plugins/entity-definitions/username.ts +1 -1
- package/src/auth/plugins/wrappers/admin.ts +3 -1
- package/src/auth/plugins/wrappers/anonymous.ts +3 -1
- package/src/auth/plugins/wrappers/api-key.ts +3 -1
- package/src/auth/plugins/wrappers/jwt.ts +3 -1
- package/src/auth/plugins/wrappers/organization.ts +3 -1
- package/src/auth/plugins/wrappers/passkey.ts +3 -1
- package/src/auth/plugins/wrappers/phone-number.ts +3 -1
- package/src/auth/plugins/wrappers/sso.ts +2 -1
- package/src/auth/plugins/wrappers/two-factor.ts +3 -1
- package/src/auth/plugins/wrappers/username.ts +3 -1
- package/src/bin/__tests__/ts-loader-register.test.ts +7 -12
- package/src/bin/build-config.ts +3 -3
- package/src/bin/cli.ts +27 -25
- package/src/bin/fixture.ts +4 -2
- package/src/bin/hmr-hook-register.ts +1 -0
- package/src/bin/test-command.ts +4 -2
- package/src/bin/ts-loader-registration.ts +6 -22
- package/src/cache/cache-manager.ts +2 -1
- package/src/cache/decorator.ts +2 -2
- package/src/cache/types.ts +3 -3
- package/src/cache-control/cache-control.ts +3 -2
- package/src/cache-control/types.ts +2 -2
- package/src/compress/compress.ts +1 -1
- package/src/cone/cone-generator.ts +5 -3
- package/src/database/_batch_update.ts +1 -1
- package/src/database/base-model.ts +20 -14
- package/src/database/base-model.types.ts +12 -11
- package/src/database/db.ts +56 -21
- package/src/database/knex.ts +2 -2
- package/src/database/puri-subset.test-d.ts +33 -32
- package/src/database/puri-subset.types.ts +6 -7
- package/src/database/puri-wrapper.ts +29 -26
- package/src/database/puri.ts +36 -34
- package/src/database/puri.types.test-d.ts +6 -5
- package/src/database/puri.types.ts +9 -12
- package/src/database/transaction-context.ts +2 -2
- package/src/database/upsert-builder.ts +17 -10
- package/src/dict/sd.ts +17 -4
- package/src/dict/sonamu-dictionary.ts +23 -17
- package/src/entity/entity-manager.ts +9 -7
- package/src/entity/entity-template-cone.ts +10 -3
- package/src/entity/entity.ts +20 -16
- package/src/exceptions/error-handler.ts +2 -1
- package/src/exceptions/so-exceptions.ts +1 -1
- package/src/filter/utils.ts +3 -2
- package/src/logger/category.ts +1 -0
- package/src/logger/configure.ts +5 -5
- package/src/migration/__tests__/code-generation.search-text.test.ts +2 -3
- package/src/migration/code-generation.ts +26 -25
- package/src/migration/migration-set.ts +16 -18
- package/src/migration/migrator.ts +38 -33
- package/src/migration/postgresql-schema-reader.ts +12 -12
- package/src/migration/slack-confirm.ts +5 -4
- package/src/migration/types.ts +2 -2
- package/src/naite/messaging-types.ts +1 -1
- package/src/naite/naite-reporter.ts +5 -3
- package/src/naite/naite.ts +12 -7
- package/src/shared/app.shared.ts.txt +2 -2
- package/src/shared/web.shared.ts.txt +2 -2
- package/src/skills/AGENTS.md +19 -18
- package/src/skills/commands/sonamu-skills.md +9 -9
- package/src/skills/sonamu/SKILL.md +111 -104
- package/src/skills/sonamu/ai-agents.md +27 -26
- package/src/skills/sonamu/api.md +81 -69
- package/src/skills/sonamu/auth-migration.md +13 -27
- package/src/skills/sonamu/auth-plugins.md +41 -31
- package/src/skills/sonamu/auth.md +30 -24
- package/src/skills/sonamu/cdd.md +26 -17
- package/src/skills/sonamu/cone.md +50 -50
- package/src/skills/sonamu/config.md +74 -51
- package/src/skills/sonamu/create-sonamu.md +31 -19
- package/src/skills/sonamu/database.md +43 -26
- package/src/skills/sonamu/entity-basic.md +61 -61
- package/src/skills/sonamu/entity-relations.md +84 -80
- package/src/skills/sonamu/entity-validation-checklist.md +19 -15
- package/src/skills/sonamu/fixture-cli.md +52 -30
- package/src/skills/sonamu/framework-change.md +9 -7
- package/src/skills/sonamu/frontend.md +64 -82
- package/src/skills/sonamu/i18n.md +45 -37
- package/src/skills/sonamu/migration.md +54 -31
- package/src/skills/sonamu/model.md +98 -66
- package/src/skills/sonamu/naite.md +34 -32
- package/src/skills/sonamu/project-init.md +28 -8
- package/src/skills/sonamu/puri.md +82 -91
- package/src/skills/sonamu/scaffolding.md +44 -32
- package/src/skills/sonamu/skill-contribution.md +50 -45
- package/src/skills/sonamu/subset.md +13 -13
- package/src/skills/sonamu/tasks.md +73 -58
- package/src/skills/sonamu/testing-devrunner.md +56 -36
- package/src/skills/sonamu/testing.md +23 -58
- package/src/skills/sonamu/upsert.md +32 -31
- package/src/skills/sonamu/vector.md +37 -36
- package/src/ssr/index.ts +2 -12
- package/src/ssr/registry.ts +1 -1
- package/src/ssr/renderer.ts +7 -5
- package/src/ssr/types.ts +2 -2
- package/src/storage/buffered-file.ts +4 -2
- package/src/storage/drivers.ts +3 -2
- package/src/storage/s3-driver.ts +7 -4
- package/src/storage/storage-manager.ts +3 -2
- package/src/storage/types.ts +3 -2
- package/src/storage/uploaded-file.ts +1 -1
- package/src/stream/sse.ts +2 -2
- package/src/syncer/api-parser.ts +8 -5
- package/src/syncer/checksum.ts +9 -5
- package/src/syncer/code-generator.ts +16 -8
- package/src/syncer/entity-operations.ts +5 -3
- package/src/syncer/file-patterns.ts +2 -1
- package/src/syncer/module-loader.ts +9 -6
- package/src/syncer/syncer-actions.ts +5 -3
- package/src/syncer/syncer.ts +18 -24
- package/src/tasks/decorator.ts +10 -8
- package/src/tasks/step-wrapper.ts +1 -1
- package/src/tasks/workflow-manager.ts +18 -15
- package/src/template/__tests__/generated.template.search-text.test.ts +1 -0
- package/src/template/entity-converter.ts +4 -2
- package/src/template/generated.template.test-d.ts +2 -1
- package/src/template/helpers.ts +5 -2
- package/src/template/implementations/entity.template.ts +9 -8
- package/src/template/implementations/entry-server.template.ts +1 -1
- package/src/template/implementations/generated.template.ts +21 -29
- package/src/template/implementations/generated_http.template.ts +9 -6
- package/src/template/implementations/generated_sso.template.ts +6 -4
- package/src/template/implementations/init_types.template.ts +3 -2
- package/src/template/implementations/model.template.ts +4 -2
- package/src/template/implementations/model_test.template.ts +3 -2
- package/src/template/implementations/queries.template.ts +6 -14
- package/src/template/implementations/sd.template.ts +4 -2
- package/src/template/implementations/services.template.ts +7 -11
- package/src/template/implementations/view_form.template.ts +5 -3
- package/src/template/implementations/view_id_all_select.template.ts +3 -2
- package/src/template/implementations/view_list.template.ts +7 -5
- package/src/template/implementations/view_search_input.template.ts +3 -2
- package/src/template/template-manager.ts +4 -3
- package/src/template/template.ts +4 -3
- package/src/template/zod-converter.ts +10 -7
- package/src/testing/__tests__/dev-test-routes.test.ts +3 -2
- package/src/testing/__tests__/dev-vitest-manager.test.ts +1 -0
- package/src/testing/_relation-graph.ts +2 -2
- package/src/testing/bootstrap.ts +55 -27
- package/src/testing/data-explorer.ts +5 -4
- package/src/testing/dev-test-routes.ts +8 -5
- package/src/testing/dev-vitest-manager.ts +13 -12
- package/src/testing/fixture-generator.ts +11 -17
- package/src/testing/fixture-manager.ts +21 -17
- package/src/testing/parallel-db-manager.ts +2 -1
- package/src/testing/vitest-helpers.ts +2 -1
- package/src/types/__tests__/entity-json-schema-search-text.test.ts +1 -0
- package/src/types/types.ts +8 -8
- package/src/typings/knex.d.ts +4 -4
- package/src/ui/ai-api.ts +5 -3
- package/src/ui/ai-client.ts +6 -5
- package/src/ui/api.ts +25 -23
- package/src/ui/cdd-service.ts +12 -11
- package/src/utils/console-util.ts +3 -1
- package/src/utils/formatter.ts +94 -102
- package/src/utils/fs-utils.ts +2 -1
- package/src/utils/model.ts +2 -2
- package/src/utils/object-utils.ts +3 -3
- package/src/utils/process-utils.ts +2 -1
- package/src/utils/sql-parser.ts +10 -1
- package/src/utils/type-utils.ts +3 -3
- package/src/utils/utils.ts +9 -7
- package/src/utils/zod-error.ts +1 -1
- package/src/vector/chunking.ts +1 -1
- package/src/vector/config.ts +1 -1
- package/src/vector/embedding.ts +11 -9
- package/tsdown.api.config.ts +50 -0
- package/.swcrc.project-default +0 -18
- package/dist/api/__tests__/config.test.js +0 -189
- package/dist/bin/__tests__/test-command.test.js +0 -112
- package/dist/bin/__tests__/ts-loader-register.test.js +0 -45
- package/dist/database/puri-subset.test-d.js +0 -89
- package/dist/database/puri.types.test-d.js +0 -129
- package/dist/migration/__tests__/code-generation.search-text.test.js +0 -435
- package/dist/template/__tests__/generated.template.search-text.test.js +0 -99
- package/dist/template/generated.template.test-d.js +0 -24
- package/dist/testing/__tests__/dev-test-routes.test.js +0 -144
- package/dist/testing/__tests__/dev-vitest-manager.test.js +0 -152
- package/dist/types/__tests__/entity-json-schema-search-text.test.js +0 -256
- package/dist/typings/knex.d.js +0 -3
- package/dist/ui-web/assets/index-CKo0Z2Iu.css +0 -1
- package/dist/ui-web/assets/index-DK-2aacv.js +0 -257
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { describe, expectTypeOf, it } from "vitest";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type AvailableColumns,
|
|
5
|
+
type ExtractColumnType,
|
|
6
|
+
type LeftJoinedMarker,
|
|
7
|
+
type ParseSelectObject,
|
|
7
8
|
} from "./puri.types";
|
|
8
9
|
|
|
9
10
|
// ============================================================================
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/* oxlint-disable @typescript-eslint/no-explicit-any */ // Puri.types.ts는 다양한 타입을 사용하고 있습니다.
|
|
2
2
|
|
|
3
|
-
import type
|
|
4
|
-
|
|
5
|
-
import type
|
|
6
|
-
import type
|
|
3
|
+
import { type QueryResult } from "pg";
|
|
4
|
+
|
|
5
|
+
import { type DatabaseForeignKeys, type DatabaseSchemaExtend } from "../types/types";
|
|
6
|
+
import { type Puri } from "./puri";
|
|
7
|
+
import { type PuriSubsetFn } from "./puri-subset.types";
|
|
7
8
|
|
|
8
9
|
// ============================================
|
|
9
10
|
// 내부 타입 키 (메타데이터)
|
|
@@ -141,12 +142,8 @@ export type IsNullableColumn<
|
|
|
141
142
|
// FK nullable 여부에 따른 마커 타입 결정
|
|
142
143
|
// nullable FK로 leftJoin → LeftJoinedMarker (객체 자체가 null일 수 있음)
|
|
143
144
|
// non-null FK로 leftJoin → 마커 없음 (부모가 있으면 자식도 반드시 있음)
|
|
144
|
-
export type LeftJoinMarkerFor<TTables, Path extends string> =
|
|
145
|
-
TTables,
|
|
146
|
-
Path
|
|
147
|
-
> extends true
|
|
148
|
-
? LeftJoinedMarker
|
|
149
|
-
: {};
|
|
145
|
+
export type LeftJoinMarkerFor<TTables, Path extends string> =
|
|
146
|
+
IsNullableColumn<TTables, Path> extends true ? LeftJoinedMarker : {};
|
|
150
147
|
|
|
151
148
|
// 주어진 테이블이 FK nullable로 leftJoin 된 테이블인지 확인합니다.
|
|
152
149
|
// 사실 LeftJoinMarker가 붙었는지 확인하는게 다입니다.
|
|
@@ -351,7 +348,7 @@ export type InsertData<T> = Omit<
|
|
|
351
348
|
};
|
|
352
349
|
|
|
353
350
|
// Insert Result 타입
|
|
354
|
-
export type InsertResult = Pick<QueryResult
|
|
351
|
+
export type InsertResult = Pick<QueryResult, "command" | "rowCount" | "rows" | "oid">;
|
|
355
352
|
|
|
356
353
|
// SubsetQuery를 위한 타입 유틸리티
|
|
357
354
|
export type ExtractTTables<T extends Puri<any, any, any>> =
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type DBPreset } from "./db";
|
|
2
|
+
import { type PuriTransactionWrapper } from "./puri-wrapper";
|
|
3
3
|
|
|
4
4
|
export class TransactionContext {
|
|
5
5
|
private transactions: Map<DBPreset, PuriTransactionWrapper> = new Map();
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { getLogger } from "@logtape/logtape";
|
|
2
1
|
import { randomUUID } from "crypto";
|
|
3
|
-
|
|
4
|
-
import {
|
|
2
|
+
|
|
3
|
+
import { getLogger } from "@logtape/logtape";
|
|
4
|
+
import { type Knex } from "knex";
|
|
5
|
+
import { cluster, isArray, unique } from "radashi";
|
|
6
|
+
|
|
5
7
|
import { EntityManager } from "../entity/entity-manager";
|
|
6
8
|
import { Naite } from "../naite/naite";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
type DatabaseForeignKeys,
|
|
11
|
+
type DatabaseSchemaExtend,
|
|
12
|
+
type EntityIndex,
|
|
13
|
+
} from "../types/types";
|
|
14
|
+
import { assertDefined, nonNullable } from "../utils/utils";
|
|
15
|
+
import { batchUpdate } from "./_batch_update";
|
|
16
|
+
import { type RowWithId } from "./_batch_update";
|
|
17
|
+
import { type ColumnKeys, type ForeignKeyColumns, type IdType, type TableName } from "./puri.types";
|
|
11
18
|
|
|
12
19
|
const logger = getLogger(["sonamu", "internal", "upsert-builder"]);
|
|
13
20
|
|
|
@@ -207,7 +214,7 @@ export class UpsertBuilder {
|
|
|
207
214
|
mode: "upsert" | "insert",
|
|
208
215
|
options?: UpsertOptions<TTable>,
|
|
209
216
|
): Promise<IdType<DatabaseSchemaExtend, TTable>[]> {
|
|
210
|
-
if (this.hasTable(tableName)
|
|
217
|
+
if (!this.hasTable(tableName)) {
|
|
211
218
|
return [];
|
|
212
219
|
}
|
|
213
220
|
|
|
@@ -290,7 +297,7 @@ export class UpsertBuilder {
|
|
|
290
297
|
|
|
291
298
|
// 현재 레벨 upsert
|
|
292
299
|
const chunkSize = options?.chunkSize;
|
|
293
|
-
const levelChunks = chunkSize ?
|
|
300
|
+
const levelChunks = chunkSize ? cluster(resolvedRows, chunkSize) : [resolvedRows];
|
|
294
301
|
const selectFields = unique(["id", ...extractFields]);
|
|
295
302
|
|
|
296
303
|
for (let index = 0; index < levelChunks.length; index++) {
|
|
@@ -496,7 +503,7 @@ export class UpsertBuilder {
|
|
|
496
503
|
where: options?.where ?? "id",
|
|
497
504
|
};
|
|
498
505
|
|
|
499
|
-
if (this.hasTable(tableName)
|
|
506
|
+
if (!this.hasTable(tableName)) {
|
|
500
507
|
return;
|
|
501
508
|
}
|
|
502
509
|
const table = this.tables.get(tableName);
|
package/src/dict/sd.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* sonamu 코어 내부에서 사용하는 i18n 함수입니다.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { type SonamuConfig } from "../api/config";
|
|
7
7
|
import en from "./en";
|
|
8
8
|
import ko from "./ko";
|
|
9
|
-
import type
|
|
9
|
+
import { type LocalizedString } from "./types";
|
|
10
10
|
|
|
11
11
|
type SonamuDict = typeof ko;
|
|
12
12
|
type DictKey = keyof SonamuDict;
|
|
@@ -20,13 +20,26 @@ const dictionaries: Record<string, MergedDictionary> = {
|
|
|
20
20
|
ko,
|
|
21
21
|
en,
|
|
22
22
|
};
|
|
23
|
+
let currentI18nConfig: SonamuConfig["i18n"] | null = null;
|
|
23
24
|
|
|
24
25
|
type SDReturnType<K extends DictKey> = SonamuDict[K] extends (...args: infer P) => string
|
|
25
26
|
? (...args: P) => LocalizedString
|
|
26
27
|
: LocalizedString;
|
|
27
28
|
|
|
29
|
+
function getCurrentI18nConfig(): SonamuConfig["i18n"] {
|
|
30
|
+
if (currentI18nConfig === null) {
|
|
31
|
+
throw new Error("Sonamu i18n config has not been initialized");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return currentI18nConfig;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function setSDConfig(i18nConfig: SonamuConfig["i18n"]): void {
|
|
38
|
+
currentI18nConfig = i18nConfig;
|
|
39
|
+
}
|
|
40
|
+
|
|
28
41
|
function getDictValue<K extends DictKey>(key: K, locale: string): SDReturnType<K> {
|
|
29
|
-
const { defaultLocale, supportedLocales } =
|
|
42
|
+
const { defaultLocale, supportedLocales } = getCurrentI18nConfig();
|
|
30
43
|
|
|
31
44
|
// 1. 지정된 locale에서 조회
|
|
32
45
|
const dict = dictionaries[locale];
|
|
@@ -61,6 +74,6 @@ function getDictValue<K extends DictKey>(key: K, locale: string): SDReturnType<K
|
|
|
61
74
|
* SD("error.entityNotFound")("User", 1) // → "존재하지 않는 User ID 1" (LocalizedString)
|
|
62
75
|
*/
|
|
63
76
|
export function SD<K extends DictKey>(key: K): SDReturnType<K> {
|
|
64
|
-
const configLocale =
|
|
77
|
+
const configLocale = getCurrentI18nConfig().defaultLocale;
|
|
65
78
|
return getDictValue(key, configLocale);
|
|
66
79
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { Workbook } from "@sheetkit/node";
|
|
2
1
|
import { execSync } from "child_process";
|
|
3
2
|
import fs from "fs";
|
|
4
3
|
import path from "path";
|
|
4
|
+
|
|
5
|
+
import { Workbook } from "@sheetkit/node";
|
|
5
6
|
import ts from "typescript";
|
|
7
|
+
|
|
6
8
|
import { Sonamu } from "../api/sonamu";
|
|
7
9
|
import { EntityManager } from "../entity/entity-manager";
|
|
8
10
|
import { BadRequestException } from "../exceptions/so-exceptions";
|
|
9
11
|
import { formatCode } from "../utils/formatter";
|
|
10
12
|
import { SD } from "./sd";
|
|
11
|
-
import
|
|
12
|
-
DictEntry,
|
|
13
|
-
DictionaryResult,
|
|
14
|
-
DictionaryRow,
|
|
15
|
-
EntityKeyInfo,
|
|
16
|
-
I18nConfig,
|
|
17
|
-
ImportResult,
|
|
18
|
-
UsageResult,
|
|
13
|
+
import {
|
|
14
|
+
type DictEntry,
|
|
15
|
+
type DictionaryResult,
|
|
16
|
+
type DictionaryRow,
|
|
17
|
+
type EntityKeyInfo,
|
|
18
|
+
type I18nConfig,
|
|
19
|
+
type ImportResult,
|
|
20
|
+
type UsageResult,
|
|
19
21
|
} from "./types";
|
|
20
22
|
|
|
21
23
|
/**
|
|
@@ -294,7 +296,7 @@ export class SonamuDictionary {
|
|
|
294
296
|
|
|
295
297
|
// 파일 재생성
|
|
296
298
|
const content = this.generateProjectDict(locale, existingEntries, isDefaultLocale);
|
|
297
|
-
const formatted = formatCode(content, "typescript", filePath);
|
|
299
|
+
const formatted = await formatCode(content, "typescript", filePath);
|
|
298
300
|
fs.writeFileSync(filePath, formatted, "utf-8");
|
|
299
301
|
}
|
|
300
302
|
|
|
@@ -328,7 +330,7 @@ export class SonamuDictionary {
|
|
|
328
330
|
*/
|
|
329
331
|
generateProjectDict(locale: string, entries: DictEntry[], isDefaultLocale: boolean): string {
|
|
330
332
|
// key 알파벳 순 정렬
|
|
331
|
-
const sorted = [...entries].
|
|
333
|
+
const sorted = [...entries].toSorted((a, b) => a.key.localeCompare(b.key));
|
|
332
334
|
|
|
333
335
|
const lines: string[] = [];
|
|
334
336
|
|
|
@@ -408,11 +410,15 @@ export class SonamuDictionary {
|
|
|
408
410
|
/**
|
|
409
411
|
* dict 파일을 저장합니다.
|
|
410
412
|
*/
|
|
411
|
-
private saveDictFile(
|
|
413
|
+
private async saveDictFile(
|
|
414
|
+
locale: string,
|
|
415
|
+
entries: DictEntry[],
|
|
416
|
+
isDefaultLocale: boolean,
|
|
417
|
+
): Promise<void> {
|
|
412
418
|
const i18nDir = this.ensureI18nDir();
|
|
413
419
|
const dictPath = path.join(i18nDir, `${locale}.ts`);
|
|
414
420
|
const content = this.generateProjectDict(locale, entries, isDefaultLocale);
|
|
415
|
-
const formatted = formatCode(content, "typescript", dictPath);
|
|
421
|
+
const formatted = await formatCode(content, "typescript", dictPath);
|
|
416
422
|
fs.writeFileSync(dictPath, formatted, "utf-8");
|
|
417
423
|
}
|
|
418
424
|
|
|
@@ -834,7 +840,7 @@ export class SonamuDictionary {
|
|
|
834
840
|
for (const locale of locales) {
|
|
835
841
|
const entries = projectDictEntries[locale];
|
|
836
842
|
if (entries.length > 0) {
|
|
837
|
-
this.saveDictFile(locale, entries, locale === defaultLocale);
|
|
843
|
+
await this.saveDictFile(locale, entries, locale === defaultLocale);
|
|
838
844
|
updatedLocales++;
|
|
839
845
|
}
|
|
840
846
|
}
|
|
@@ -902,7 +908,7 @@ export class SonamuDictionary {
|
|
|
902
908
|
}
|
|
903
909
|
|
|
904
910
|
// dict 파일 저장
|
|
905
|
-
this.saveDictFile(locale, entries, locale === defaultLocale);
|
|
911
|
+
await this.saveDictFile(locale, entries, locale === defaultLocale);
|
|
906
912
|
}
|
|
907
913
|
}
|
|
908
914
|
|
|
@@ -939,7 +945,7 @@ export class SonamuDictionary {
|
|
|
939
945
|
isFunction: this.isExpressionFunction(cellValue),
|
|
940
946
|
});
|
|
941
947
|
|
|
942
|
-
this.saveDictFile(locale, entries, locale === defaultLocale);
|
|
948
|
+
await this.saveDictFile(locale, entries, locale === defaultLocale);
|
|
943
949
|
}
|
|
944
950
|
}
|
|
945
951
|
|
|
@@ -962,7 +968,7 @@ export class SonamuDictionary {
|
|
|
962
968
|
entries.splice(index, 1);
|
|
963
969
|
deleted = true;
|
|
964
970
|
|
|
965
|
-
this.saveDictFile(locale, entries, locale === defaultLocale);
|
|
971
|
+
await this.saveDictFile(locale, entries, locale === defaultLocale);
|
|
966
972
|
}
|
|
967
973
|
}
|
|
968
974
|
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
|
-
import chalk from "chalk";
|
|
3
2
|
import { glob, readFile } from "fs/promises";
|
|
4
|
-
import inflection from "inflection";
|
|
5
3
|
import path from "path";
|
|
4
|
+
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import inflection from "inflection";
|
|
6
7
|
import { prettifyError, z } from "zod";
|
|
8
|
+
|
|
7
9
|
import { Sonamu } from "../api/sonamu";
|
|
8
10
|
import {
|
|
9
|
-
type EntityIndex,
|
|
10
|
-
type EntityJson,
|
|
11
11
|
EntityJsonSchema,
|
|
12
12
|
isSearchTextJsonSourceZodType,
|
|
13
13
|
isSearchTextProp,
|
|
14
14
|
SonamuFileArraySchema,
|
|
15
15
|
SonamuFileSchema,
|
|
16
16
|
} from "../types/types";
|
|
17
|
+
import { type EntityIndex, type EntityJson } from "../types/types";
|
|
17
18
|
import { globAsync } from "../utils/async-utils";
|
|
18
19
|
import { importMembers } from "../utils/esm-utils";
|
|
19
|
-
import type
|
|
20
|
+
import { type AbsolutePath } from "../utils/path-utils";
|
|
20
21
|
import { runtimePath } from "../utils/path-utils";
|
|
21
|
-
import { Entity } from "./entity";
|
|
22
|
+
import { type Entity } from "./entity";
|
|
22
23
|
|
|
23
24
|
export type EntityNamesRecord = Record<
|
|
24
25
|
"fs" | "fsPlural" | "camel" | "camelPlural" | "capital" | "capitalPlural" | "upper" | "constant",
|
|
@@ -82,6 +83,7 @@ class EntityManagerClass {
|
|
|
82
83
|
json: EntityJson,
|
|
83
84
|
options: { deferSearchTextJsonSourceValidation?: boolean } = {},
|
|
84
85
|
): Promise<void> {
|
|
86
|
+
const { Entity } = await import("./entity");
|
|
85
87
|
const entity = new Entity(json);
|
|
86
88
|
await entity.registerModulePaths();
|
|
87
89
|
if (!options.deferSearchTextJsonSourceValidation) {
|
|
@@ -192,7 +194,7 @@ class EntityManagerClass {
|
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
getAllIds(): string[] {
|
|
195
|
-
return Array.from(EntityManager.entities.keys()).
|
|
197
|
+
return Array.from(EntityManager.entities.keys()).toSorted();
|
|
196
198
|
}
|
|
197
199
|
|
|
198
200
|
getAllEntities(): Entity[] {
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { fakerMappings } from "../testing/faker-mappings";
|
|
2
|
+
import { type FakerMappingConfig } from "../testing/faker-mappings";
|
|
3
|
+
import {
|
|
4
|
+
type Cone,
|
|
5
|
+
type EntityJson,
|
|
6
|
+
type EntityProp,
|
|
7
|
+
type OneToOneRelationProp,
|
|
8
|
+
type SubsetDef,
|
|
9
|
+
} from "../types/types";
|
|
3
10
|
import {
|
|
4
11
|
isBelongsToOneRelationProp,
|
|
5
12
|
isEnumDefWithCone,
|
|
@@ -181,7 +188,7 @@ function shouldHaveDataSource(prop: EntityProp): boolean {
|
|
|
181
188
|
|
|
182
189
|
// OneToOne은 hasJoinColumn: true인 경우에만 dataSource 필요
|
|
183
190
|
if (isOneToOneRelationProp(prop)) {
|
|
184
|
-
return (prop as OneToOneRelationProp).hasJoinColumn
|
|
191
|
+
return (prop as OneToOneRelationProp).hasJoinColumn;
|
|
185
192
|
}
|
|
186
193
|
|
|
187
194
|
return false;
|
package/src/entity/entity.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
2
|
import { writeFile } from "fs/promises";
|
|
3
|
-
import inflection from "inflection";
|
|
4
3
|
import path from "path";
|
|
4
|
+
|
|
5
|
+
import inflection from "inflection";
|
|
5
6
|
import { group, unique } from "radashi";
|
|
6
7
|
import { z } from "zod";
|
|
8
|
+
|
|
7
9
|
import { Sonamu } from "../api/sonamu";
|
|
8
10
|
import {
|
|
9
|
-
type Cone,
|
|
10
|
-
type EntityIndex,
|
|
11
|
-
type EntityJson,
|
|
12
|
-
type EntityProp,
|
|
13
|
-
type EntityPropNode,
|
|
14
|
-
type EntitySubsetRow,
|
|
15
11
|
getEnumDefValues,
|
|
16
12
|
getSubsetFields,
|
|
17
13
|
isBelongsToOneRelationProp,
|
|
@@ -24,6 +20,14 @@ import {
|
|
|
24
20
|
isVirtualCodeProp,
|
|
25
21
|
isVirtualProp,
|
|
26
22
|
normalizeSubsetField,
|
|
23
|
+
} from "../types/types";
|
|
24
|
+
import {
|
|
25
|
+
type Cone,
|
|
26
|
+
type EntityIndex,
|
|
27
|
+
type EntityJson,
|
|
28
|
+
type EntityProp,
|
|
29
|
+
type EntityPropNode,
|
|
30
|
+
type EntitySubsetRow,
|
|
27
31
|
type RelationProp,
|
|
28
32
|
type SubsetField,
|
|
29
33
|
type SubsetQuery,
|
|
@@ -209,7 +213,7 @@ export class Entity {
|
|
|
209
213
|
*/
|
|
210
214
|
private buildNestedSelectObject(
|
|
211
215
|
selectItems: string[],
|
|
212
|
-
//
|
|
216
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 반환 오브젝트의 값은 string일 수도 있고 또다른 오브젝트일 수도 있는데, 이를 재귀 타입으로 나타낼 수 없어 any로 처리합니다.
|
|
213
217
|
): Record<string, any> {
|
|
214
218
|
const result: ReturnType<typeof this.buildNestedSelectObject> = {};
|
|
215
219
|
|
|
@@ -275,7 +279,7 @@ export class Entity {
|
|
|
275
279
|
* @param withBraces true면 중괄호 포함, false면 내용만 반환
|
|
276
280
|
*/
|
|
277
281
|
private stringifyNestedSelectObject(
|
|
278
|
-
//
|
|
282
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- 중첩 오브젝트의 값은 string일 수도 있고 또다른 오브젝트일 수도 있는데, 이를 재귀 타입으로 나타낼 수 없어 any로 처리합니다.
|
|
279
283
|
obj: Record<string, any>,
|
|
280
284
|
indent: number = 0,
|
|
281
285
|
withBraces: boolean = true,
|
|
@@ -498,7 +502,7 @@ export class Entity {
|
|
|
498
502
|
}
|
|
499
503
|
|
|
500
504
|
if (isOneToOneRelationProp(relation)) {
|
|
501
|
-
if (relation.hasJoinColumn
|
|
505
|
+
if (relation.hasJoinColumn && !(relation.nullable ?? false)) {
|
|
502
506
|
return "inner";
|
|
503
507
|
} else {
|
|
504
508
|
return "outer";
|
|
@@ -736,7 +740,7 @@ export class Entity {
|
|
|
736
740
|
}
|
|
737
741
|
return propName;
|
|
738
742
|
})
|
|
739
|
-
.filter((f) => f !== null)
|
|
743
|
+
.filter((f) => f !== null);
|
|
740
744
|
}
|
|
741
745
|
|
|
742
746
|
/**
|
|
@@ -746,7 +750,7 @@ export class Entity {
|
|
|
746
750
|
private hasForeignKey(prop: RelationProp): boolean {
|
|
747
751
|
return (
|
|
748
752
|
prop.relationType === "BelongsToOne" ||
|
|
749
|
-
(prop.relationType === "OneToOne" && prop.hasJoinColumn
|
|
753
|
+
(prop.relationType === "OneToOne" && prop.hasJoinColumn)
|
|
750
754
|
);
|
|
751
755
|
}
|
|
752
756
|
|
|
@@ -939,7 +943,7 @@ export class Entity {
|
|
|
939
943
|
`src/application/${this.names.parentFs}/${this.names.fs}.entity.json`,
|
|
940
944
|
);
|
|
941
945
|
const json = this.toJson();
|
|
942
|
-
await writeFile(jsonPath, formatCode(JSON.stringify(json), "json", jsonPath));
|
|
946
|
+
await writeFile(jsonPath, await formatCode(JSON.stringify(json), "json", jsonPath));
|
|
943
947
|
|
|
944
948
|
// reload
|
|
945
949
|
await EntityManager.register(json);
|
|
@@ -1093,12 +1097,12 @@ export class Entity {
|
|
|
1093
1097
|
isOpen: children.length > 0,
|
|
1094
1098
|
has: Object.fromEntries(
|
|
1095
1099
|
subsetKeys.map((subsetKey) => {
|
|
1096
|
-
return [subsetKey, children.every((child) => child.has[subsetKey]
|
|
1100
|
+
return [subsetKey, children.every((child) => child.has[subsetKey])];
|
|
1097
1101
|
}),
|
|
1098
1102
|
),
|
|
1099
1103
|
isInternal: Object.fromEntries(
|
|
1100
1104
|
subsetKeys.map((subsetKey) => {
|
|
1101
|
-
return [subsetKey, children.every((child) => child.isInternal[subsetKey]
|
|
1105
|
+
return [subsetKey, children.every((child) => child.isInternal[subsetKey])];
|
|
1102
1106
|
}),
|
|
1103
1107
|
),
|
|
1104
1108
|
};
|
|
@@ -1281,7 +1285,7 @@ export class Entity {
|
|
|
1281
1285
|
}
|
|
1282
1286
|
|
|
1283
1287
|
getEntityIdFromSubsetField(subsetField: string): string {
|
|
1284
|
-
if (subsetField.includes(".")
|
|
1288
|
+
if (!subsetField.includes(".")) {
|
|
1285
1289
|
return this.id;
|
|
1286
1290
|
}
|
|
1287
1291
|
|
package/src/filter/utils.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Entity } from "../entity/entity";
|
|
2
2
|
import { isEnumProp } from "../types/types";
|
|
3
|
-
import {
|
|
3
|
+
import { operatorsByPropType } from "./types";
|
|
4
|
+
import { type FilterOperator, type FilterQuery } from "./types";
|
|
4
5
|
|
|
5
6
|
// ============================================================
|
|
6
7
|
// Query Normalization
|
package/src/logger/category.ts
CHANGED
package/src/logger/configure.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { configure, getConsoleSink } from "@logtape/logtape";
|
|
1
2
|
import {
|
|
2
|
-
configure,
|
|
3
3
|
type Filter,
|
|
4
4
|
type FilterLike,
|
|
5
|
-
getConsoleSink,
|
|
6
5
|
type LoggerConfig,
|
|
7
6
|
type LogRecord,
|
|
8
7
|
type Sink,
|
|
9
8
|
type TextFormatter,
|
|
10
9
|
} from "@logtape/logtape";
|
|
11
10
|
import { getPrettyFormatter } from "@logtape/pretty";
|
|
12
|
-
import type
|
|
11
|
+
import { type FastifyReply, type FastifyRequest } from "fastify";
|
|
12
|
+
|
|
13
13
|
import { isSameCategory } from "./category";
|
|
14
14
|
|
|
15
15
|
export type SonamuLoggingOptions<TSinkId extends string, TFilterId extends string> = {
|
|
@@ -102,12 +102,12 @@ export async function configureLogTape<TSinkId extends string, TFilterId extends
|
|
|
102
102
|
|
|
103
103
|
const sinks = {
|
|
104
104
|
"fastify-console": defaultFastifySink(fastifyCategory),
|
|
105
|
-
...
|
|
105
|
+
...options.sinks,
|
|
106
106
|
} as Record<TSinkId | "fastify-console", Sink>;
|
|
107
107
|
|
|
108
108
|
const filters = {
|
|
109
109
|
"fastify-console": defaultFastifyFilter(fastifyCategory),
|
|
110
|
-
...
|
|
110
|
+
...options.filters,
|
|
111
111
|
} as Record<TFilterId | "fastify-console", FilterLike>;
|
|
112
112
|
|
|
113
113
|
const loggers: Set<LoggerConfig<TSinkId | "fastify-console", TFilterId | "fastify-console">> =
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { describe, expect, test } from "vitest";
|
|
2
|
+
|
|
2
3
|
import { Sonamu } from "../../api";
|
|
3
4
|
import { Entity } from "../../entity/entity";
|
|
4
5
|
import { EntityManager } from "../../entity/entity-manager";
|
|
5
|
-
import type
|
|
6
|
-
import { setupBiome } from "../../utils/formatter";
|
|
6
|
+
import { type MigrationSet } from "../../types/types";
|
|
7
7
|
import {
|
|
8
8
|
generateAlterCode,
|
|
9
9
|
generateCreateCode,
|
|
@@ -13,7 +13,6 @@ import { getMigrationSetFromEntity } from "../migration-set";
|
|
|
13
13
|
|
|
14
14
|
const TEST_API_ROOT = "/Users/Nebuleto/Workspace/sonamu/modules/sonamu";
|
|
15
15
|
|
|
16
|
-
setupBiome(TEST_API_ROOT);
|
|
17
16
|
Sonamu.apiRootPath = TEST_API_ROOT;
|
|
18
17
|
|
|
19
18
|
let entitySeq = 0;
|