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
|
@@ -25,19 +25,19 @@ production/development master (live DB)
|
|
|
25
25
|
|
|
26
26
|
### Role of Each DB
|
|
27
27
|
|
|
28
|
-
| DB
|
|
29
|
-
|
|
30
|
-
| `project`
|
|
28
|
+
| DB | Purpose | Data origin |
|
|
29
|
+
| ----------------- | -------------------------------- | --------------------------------------- |
|
|
30
|
+
| `project` | Production/development live DB | Real user data |
|
|
31
31
|
| `project_fixture` | Reference data store for testing | Imported via fetch or generated via gen |
|
|
32
|
-
| `project_test`
|
|
32
|
+
| `project_test` | Test execution environment | Synced from fixture |
|
|
33
33
|
|
|
34
34
|
### Which DB Each Command Uses
|
|
35
35
|
|
|
36
|
-
| Command
|
|
37
|
-
|
|
38
|
-
| `fixture gen`
|
|
39
|
-
| `fixture fetch` | production master | fixture DB | Imports from live DB → fixture DB
|
|
40
|
-
| `fixture sync`
|
|
36
|
+
| Command | sourceDb | targetDb | Description |
|
|
37
|
+
| --------------- | ----------------- | ---------- | ------------------------------------------------------ |
|
|
38
|
+
| `fixture gen` | fixture DB | fixture DB | Resolves and generates relations within the fixture DB |
|
|
39
|
+
| `fixture fetch` | production master | fixture DB | Imports from live DB → fixture DB |
|
|
40
|
+
| `fixture sync` | fixture DB | test DB | Synchronizes fixture DB → test DB (existing behavior) |
|
|
41
41
|
|
|
42
42
|
**CRITICAL**: Incorrect sourceDb or targetDb settings will cause FK reference errors.
|
|
43
43
|
|
|
@@ -125,13 +125,14 @@ pnpm sonamu fixture fetch --all --strategy recent --limit 3
|
|
|
125
125
|
|
|
126
126
|
#### Strategies
|
|
127
127
|
|
|
128
|
-
| Strategy | Description
|
|
129
|
-
|
|
128
|
+
| Strategy | Description | Example |
|
|
129
|
+
| -------- | -------------------------------- | ------------------------------ |
|
|
130
130
|
| `recent` | Most recent data (by created_at) | `--strategy recent --limit 10` |
|
|
131
|
-
| `sample` | Uniform sampling
|
|
132
|
-
| `random` | Random sampling
|
|
131
|
+
| `sample` | Uniform sampling | `--strategy sample --limit 10` |
|
|
132
|
+
| `random` | Random sampling | `--strategy random --limit 10` |
|
|
133
133
|
|
|
134
134
|
**CRITICAL**: fetch retrieves related data **recursively** (maxDepth: 2)
|
|
135
|
+
|
|
135
136
|
- Fetching User → also imports User's department and institution
|
|
136
137
|
- Fetching Post → also imports Post's author (User)
|
|
137
138
|
|
|
@@ -229,10 +230,12 @@ pnpm sonamu fixture sync
|
|
|
229
230
|
FixtureGenerator automatically generates Korean data for specific field names:
|
|
230
231
|
|
|
231
232
|
**Fields with automatic Korean generation**:
|
|
233
|
+
|
|
232
234
|
- `name`, `username`: Korean full name (`fakerKO.person.fullName()`)
|
|
233
235
|
- Entity is `Department` and prop is `name`: Korean department name
|
|
234
236
|
|
|
235
237
|
**Example output**:
|
|
238
|
+
|
|
236
239
|
```typescript
|
|
237
240
|
// User
|
|
238
241
|
{ name: "김민준", username: "이서연" }
|
|
@@ -242,6 +245,7 @@ FixtureGenerator automatically generates Korean data for specific field names:
|
|
|
242
245
|
```
|
|
243
246
|
|
|
244
247
|
**Customization**:
|
|
248
|
+
|
|
245
249
|
```typescript
|
|
246
250
|
// Edit in fixture-generator.ts
|
|
247
251
|
if (entity?.id === "Department" && prop.name === "name") {
|
|
@@ -255,21 +259,23 @@ if (entity?.id === "Department" && prop.name === "name") {
|
|
|
255
259
|
Fields with unique constraints require a deduplication strategy.
|
|
256
260
|
|
|
257
261
|
**Problem**:
|
|
262
|
+
|
|
258
263
|
```sql
|
|
259
264
|
-- departments table
|
|
260
265
|
UNIQUE (company_id, name)
|
|
261
266
|
```
|
|
262
267
|
|
|
263
268
|
**Solution: Automatic variation**
|
|
269
|
+
|
|
264
270
|
```typescript
|
|
265
271
|
// Prevents "개발팀" from being generated multiple times under the same company_id
|
|
266
272
|
// Automatically adds prefix/suffix with 70% probability
|
|
267
273
|
|
|
268
274
|
// Result:
|
|
269
|
-
"개발팀"
|
|
270
|
-
"개발팀 1팀"
|
|
271
|
-
"개발팀 본부"
|
|
272
|
-
"글로벌 개발팀"
|
|
275
|
+
"개발팀"; // 30%
|
|
276
|
+
"개발팀 1팀"; // 20%
|
|
277
|
+
"개발팀 본부"; // 20%
|
|
278
|
+
"글로벌 개발팀"; // 30%
|
|
273
279
|
```
|
|
274
280
|
|
|
275
281
|
**Implementation location**: `generateDefaultValue()` in `fixture-generator.ts`
|
|
@@ -279,6 +285,7 @@ UNIQUE (company_id, name)
|
|
|
279
285
|
BelongsToOne relations auto-generate a `{name}_id` column, so code must use the `_id` suffix.
|
|
280
286
|
|
|
281
287
|
**Entity definition**:
|
|
288
|
+
|
|
282
289
|
```json
|
|
283
290
|
{
|
|
284
291
|
"type": "relation",
|
|
@@ -289,15 +296,17 @@ BelongsToOne relations auto-generate a `{name}_id` column, so code must use the
|
|
|
289
296
|
```
|
|
290
297
|
|
|
291
298
|
**Inside FixtureGenerator**:
|
|
299
|
+
|
|
292
300
|
```typescript
|
|
293
301
|
// ✓ CORRECT
|
|
294
|
-
fixture[`${prop.name}_id`] = relationValue;
|
|
302
|
+
fixture[`${prop.name}_id`] = relationValue; // company_id
|
|
295
303
|
|
|
296
304
|
// ✗ WRONG
|
|
297
|
-
fixture[prop.name] = relationValue;
|
|
305
|
+
fixture[prop.name] = relationValue; // company (FK saved as NULL!)
|
|
298
306
|
```
|
|
299
307
|
|
|
300
308
|
**Easy to get wrong because**:
|
|
309
|
+
|
|
301
310
|
- Entity JSON defines `name: "company"`
|
|
302
311
|
- DB column is auto-created as `company_id`
|
|
303
312
|
- Code must use `company_id`
|
|
@@ -307,6 +316,7 @@ fixture[prop.name] = relationValue; // company (FK saved as NULL!)
|
|
|
307
316
|
fixture gen **automatically sorts by dependency order** (uses FixtureManager's RelationGraph).
|
|
308
317
|
|
|
309
318
|
**Example**:
|
|
319
|
+
|
|
310
320
|
```bash
|
|
311
321
|
# Department references Company, but no need to worry about order
|
|
312
322
|
pnpm sonamu fixture gen --include Department,Company --count 5
|
|
@@ -327,6 +337,7 @@ pnpm sonamu fixture gen --include Department,Company --count 5
|
|
|
327
337
|
After generating fixtures, ID sequences may be out of sync.
|
|
328
338
|
|
|
329
339
|
**Check**:
|
|
340
|
+
|
|
330
341
|
```bash
|
|
331
342
|
PGPASSWORD=1234 psql -h 0.0.0.0 -U postgres -d project_fixture -c "
|
|
332
343
|
SELECT sequencename, last_value
|
|
@@ -337,6 +348,7 @@ ORDER BY sequencename;
|
|
|
337
348
|
```
|
|
338
349
|
|
|
339
350
|
**Reset**:
|
|
351
|
+
|
|
340
352
|
```sql
|
|
341
353
|
-- Per table
|
|
342
354
|
SELECT setval('departments_id_seq', (SELECT MAX(id) FROM departments), true);
|
|
@@ -344,6 +356,7 @@ SELECT setval('companies_id_seq', (SELECT MAX(id) FROM companies), true);
|
|
|
344
356
|
```
|
|
345
357
|
|
|
346
358
|
**Automated**:
|
|
359
|
+
|
|
347
360
|
```bash
|
|
348
361
|
# Reset all sequences script
|
|
349
362
|
PGPASSWORD=1234 psql -h 0.0.0.0 -U postgres -d project_fixture -c "
|
|
@@ -371,6 +384,7 @@ git commit -m "Add user fixtures for testing"
|
|
|
371
384
|
```
|
|
372
385
|
|
|
373
386
|
**When to use**:
|
|
387
|
+
|
|
374
388
|
- Consistent test data needed in CI/CD environments
|
|
375
389
|
- Reproducing specific scenarios
|
|
376
390
|
- Sharing test data across team members
|
|
@@ -404,6 +418,7 @@ Adding `cone` metadata to Entity JSON gives you finer control over fixture gener
|
|
|
404
418
|
```
|
|
405
419
|
|
|
406
420
|
**Supported strategies**:
|
|
421
|
+
|
|
407
422
|
- `sample`: Uniform sampling
|
|
408
423
|
- `recent`: Most recent data (by created_at)
|
|
409
424
|
- `random`: Random sampling
|
|
@@ -450,10 +465,12 @@ Adding `cone` metadata to Entity JSON gives you finer control over fixture gener
|
|
|
450
465
|
```
|
|
451
466
|
|
|
452
467
|
**How it works**:
|
|
468
|
+
|
|
453
469
|
- Without `--use-llm`: serves only as a reference description for developers/LLMs (used by cone-generator when generating metadata)
|
|
454
470
|
- With `--use-llm`: fixture gen calls the Claude API and generates actual values based on the note content
|
|
455
471
|
|
|
456
472
|
**Use cases**:
|
|
473
|
+
|
|
457
474
|
- Contextual text that is hard to express with simple faker.js (self-introductions, descriptions, etc.)
|
|
458
475
|
- Explaining the field's meaning and generation pattern to developers
|
|
459
476
|
- No length limit (short patterns or long descriptions are both fine)
|
|
@@ -511,11 +528,11 @@ export default defineConfig({
|
|
|
511
528
|
|
|
512
529
|
#### When to choose note vs fixtureGenerator
|
|
513
530
|
|
|
514
|
-
| Situation
|
|
515
|
-
|
|
516
|
-
| Simple values such as email, name, number
|
|
517
|
-
| Contextual text such as self-introductions or descriptions | `cone.note` + `--use-llm` (LLM)
|
|
518
|
-
| Selecting from a specific list of values
|
|
531
|
+
| Situation | Recommended |
|
|
532
|
+
| ---------------------------------------------------------- | --------------------------------- |
|
|
533
|
+
| Simple values such as email, name, number | `fixtureGenerator` (faker.js) |
|
|
534
|
+
| Contextual text such as self-introductions or descriptions | `cone.note` + `--use-llm` (LLM) |
|
|
535
|
+
| Selecting from a specific list of values | `fixtureGenerator` (arrayElement) |
|
|
519
536
|
|
|
520
537
|
---
|
|
521
538
|
|
|
@@ -523,12 +540,12 @@ export default defineConfig({
|
|
|
523
540
|
|
|
524
541
|
**Source:** `modules/sonamu/src/testing/fixture-generator.ts`
|
|
525
542
|
|
|
526
|
-
| Option
|
|
527
|
-
|
|
528
|
-
| `locale`
|
|
529
|
-
| `useLLM`
|
|
530
|
-
| `enableLLMCache` | boolean
|
|
531
|
-
| `llmModel`
|
|
543
|
+
| Option | Type | Default | Description |
|
|
544
|
+
| ---------------- | -------------------------- | --------------------- | --------------------------------------------- |
|
|
545
|
+
| `locale` | `"ko"` \| `"en"` \| `"ja"` | `"ko"` | Locale for generated data |
|
|
546
|
+
| `useLLM` | boolean | `false` | LLM-based data generation (`--use-llm`) |
|
|
547
|
+
| `enableLLMCache` | boolean | `true` | Cache LLM results (disable with `--no-cache`) |
|
|
548
|
+
| `llmModel` | string | `"claude-sonnet-4-5"` | LLM model to use |
|
|
532
549
|
|
|
533
550
|
---
|
|
534
551
|
|
|
@@ -539,6 +556,7 @@ export default defineConfig({
|
|
|
539
556
|
**Cause**: BelongsToOne relation is non-nullable but there is no data to reference
|
|
540
557
|
|
|
541
558
|
**Solution**:
|
|
559
|
+
|
|
542
560
|
```bash
|
|
543
561
|
# Generate the referenced Entity first
|
|
544
562
|
pnpm sonamu fixture gen --include Company --count 5
|
|
@@ -548,6 +566,7 @@ pnpm sonamu fixture gen --include Department --count 10
|
|
|
548
566
|
```
|
|
549
567
|
|
|
550
568
|
Or:
|
|
569
|
+
|
|
551
570
|
```bash
|
|
552
571
|
# Generate together (auto-sorted by dependency order)
|
|
553
572
|
pnpm sonamu fixture gen --include Company,Department --count 5
|
|
@@ -558,6 +577,7 @@ pnpm sonamu fixture gen --include Company,Department --count 5
|
|
|
558
577
|
**Cause**: Duplicate values generated for a field with a unique constraint
|
|
559
578
|
|
|
560
579
|
**Solution**:
|
|
580
|
+
|
|
561
581
|
1. Modify the per-field generation logic for that Entity in `fixture-generator.ts`
|
|
562
582
|
2. Add prefix/suffix or use UUID
|
|
563
583
|
3. Reduce count
|
|
@@ -567,6 +587,7 @@ pnpm sonamu fixture gen --include Company,Department --count 5
|
|
|
567
587
|
**Cause**: Incorrect sourceDb/targetDb configuration
|
|
568
588
|
|
|
569
589
|
**Check**:
|
|
590
|
+
|
|
570
591
|
```typescript
|
|
571
592
|
// Verify in fixture.ts
|
|
572
593
|
const fixtureDb = createKnexInstance(Sonamu.dbConfig.fixture);
|
|
@@ -574,6 +595,7 @@ const generator = new FixtureGenerator(fixtureDb, fixtureDb, "fixture", EntityMa
|
|
|
574
595
|
```
|
|
575
596
|
|
|
576
597
|
**Correct configuration**:
|
|
598
|
+
|
|
577
599
|
- `fixture gen`: sourceDb = fixtureDb, targetDb = fixtureDb
|
|
578
600
|
- `fixture fetch`: sourceDb = production, targetDb = fixtureDb
|
|
579
601
|
|
|
@@ -13,12 +13,12 @@ Criteria for deciding whether to directly modify the framework or apply a projec
|
|
|
13
13
|
|
|
14
14
|
Evaluate along the following 4 axes:
|
|
15
15
|
|
|
16
|
-
| Axis
|
|
17
|
-
|
|
18
|
-
| **Reproduction scope** | Only occurs in specific usage patterns
|
|
19
|
-
| **Workaround cost**
|
|
20
|
-
| **Impact scope**
|
|
21
|
-
| **Ownership**
|
|
16
|
+
| Axis | Project workaround | Framework fix |
|
|
17
|
+
| ---------------------- | ------------------------------------------------------------------ | --------------------------------------------------- |
|
|
18
|
+
| **Reproduction scope** | Only occurs in specific usage patterns | Occurs regardless of usage pattern |
|
|
19
|
+
| **Workaround cost** | Resolved by modifying one place in the project | Workaround must be propagated to all projects |
|
|
20
|
+
| **Impact scope** | Uncertain ripple effects on other projects if framework is changed | Change scope is isolated and side effects are clear |
|
|
21
|
+
| **Ownership** | The code has a known author and discussion is needed | Bug is clear and a review path is available |
|
|
22
22
|
|
|
23
23
|
**Criteria for choosing project workaround**: If 2 or more of the 4 axes lean toward "project workaround", apply the workaround first.
|
|
24
24
|
|
|
@@ -62,6 +62,7 @@ async upload(entity_type: string, entity_id: number, file_type: string)
|
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
Generated result:
|
|
65
|
+
|
|
65
66
|
```typescript
|
|
66
67
|
// mutationFn only passes params.params and params.files (entity_id and file_type are missing)
|
|
67
68
|
mutationFn: (params: { params: string; ... }) => upload(params.params, params.files)
|
|
@@ -77,11 +78,12 @@ async upload(params: { entity_type: string; entity_id: number; file_type: string
|
|
|
77
78
|
The Sonamu backend automatically deserializes nested formData in the form `params[entity_type]` using `qs`, so this has no effect on runtime behavior.
|
|
78
79
|
|
|
79
80
|
Call-site pattern:
|
|
81
|
+
|
|
80
82
|
```typescript
|
|
81
83
|
uploadMutation.mutate({
|
|
82
84
|
params: { entity_type, entity_id, file_type },
|
|
83
85
|
files,
|
|
84
|
-
})
|
|
86
|
+
});
|
|
85
87
|
```
|
|
86
88
|
|
|
87
89
|
**Rule**: If an `@upload` method requires 2 or more parameters, always wrap them in a single object.
|
|
@@ -9,56 +9,56 @@ description: Sonamu frontend integration. Auto-generated Service, TanStack Query
|
|
|
9
9
|
|
|
10
10
|
### Hooks
|
|
11
11
|
|
|
12
|
-
| Hook | Purpose
|
|
13
|
-
| --------------- |
|
|
14
|
-
| `useTypeForm` | Form state management (Zod-based)
|
|
15
|
-
| `useListParams` | URL-synced list parameters
|
|
16
|
-
| `useSelection` | Checkbox multi-selection
|
|
17
|
-
| `useModal` | Modal state management
|
|
18
|
-
| `useToast` | Toast notifications
|
|
12
|
+
| Hook | Purpose | Key Return Values |
|
|
13
|
+
| --------------- | --------------------------------- | ------------------------------------------------ |
|
|
14
|
+
| `useTypeForm` | Form state management (Zod-based) | form, setForm, register, submit, addError, reset |
|
|
15
|
+
| `useListParams` | URL-synced list parameters | listParams, setListParams, register |
|
|
16
|
+
| `useSelection` | Checkbox multi-selection | selectedKeys, toggle, selectAll, deselectAll |
|
|
17
|
+
| `useModal` | Modal state management | open, modal |
|
|
18
|
+
| `useToast` | Toast notifications | toast |
|
|
19
19
|
|
|
20
20
|
### Components
|
|
21
21
|
|
|
22
|
-
| Component | Purpose
|
|
23
|
-
| ------------- |
|
|
24
|
-
| `Input` | Text input
|
|
25
|
-
| `Textarea` | Multi-line input
|
|
26
|
-
| `Checkbox` | Checkbox
|
|
27
|
-
| `Select` | Single select
|
|
28
|
-
| `MultiSelect` | Multi-select
|
|
29
|
-
| `EnumSelect` | Enum select
|
|
30
|
-
| `FileInput` | File upload
|
|
22
|
+
| Component | Purpose | Key Props |
|
|
23
|
+
| ------------- | ---------------- | --------------------------------------------------- |
|
|
24
|
+
| `Input` | Text input | value, onValueChange |
|
|
25
|
+
| `Textarea` | Multi-line input | value, onValueChange |
|
|
26
|
+
| `Checkbox` | Checkbox | value (boolean), onValueChange, label |
|
|
27
|
+
| `Select` | Single select | items, value, onValueChange, placeholder, clearable |
|
|
28
|
+
| `MultiSelect` | Multi-select | options, value (array), onValueChange, maxCount |
|
|
29
|
+
| `EnumSelect` | Enum select | enum, labels, value, onValueChange |
|
|
30
|
+
| `FileInput` | File upload | uploadMode, viewMode, multiple, maxFiles |
|
|
31
31
|
|
|
32
32
|
### Service (Auto-generated)
|
|
33
33
|
|
|
34
|
-
| Method | Purpose
|
|
35
|
-
| ----------------- |
|
|
36
|
-
| `get{Entity}` | Fetch single record
|
|
37
|
-
| `get{Entities}` | Fetch list
|
|
38
|
-
| `save` | Save (create/update)
|
|
39
|
-
| `del` | Delete
|
|
40
|
-
| `use{Entity}` | Single fetch hook
|
|
41
|
-
| `use{Entities}` | List fetch hook
|
|
42
|
-
| `useSaveMutation` | Save mutation
|
|
34
|
+
| Method | Purpose | Example |
|
|
35
|
+
| ----------------- | -------------------- | ----------------------------------- |
|
|
36
|
+
| `get{Entity}` | Fetch single record | `UserService.getUser("A", 123)` |
|
|
37
|
+
| `get{Entities}` | Fetch list | `UserService.getUsers("P", params)` |
|
|
38
|
+
| `save` | Save (create/update) | `UserService.save([data])` |
|
|
39
|
+
| `del` | Delete | `UserService.del([1, 2, 3])` |
|
|
40
|
+
| `use{Entity}` | Single fetch hook | `UserService.useUser("A", id)` |
|
|
41
|
+
| `use{Entities}` | List fetch hook | `UserService.useUsers("P", params)` |
|
|
42
|
+
| `useSaveMutation` | Save mutation | `UserService.useSaveMutation()` |
|
|
43
43
|
|
|
44
44
|
### Utilities
|
|
45
45
|
|
|
46
|
-
| Function | Purpose
|
|
47
|
-
| ------------------ |
|
|
48
|
-
| `dateF` | Date formatting
|
|
49
|
-
| `datetimeF` | Datetime formatting
|
|
50
|
-
| `numF` | Number formatting
|
|
51
|
-
| `hidden` | Conditional hidden class
|
|
52
|
-
| `arrayableToArray` | Convert to array
|
|
46
|
+
| Function | Purpose | Example |
|
|
47
|
+
| ------------------ | ------------------------ | ------------------------------------------------- |
|
|
48
|
+
| `dateF` | Date formatting | `dateF(new Date())` → `"2024-01-15"` |
|
|
49
|
+
| `datetimeF` | Datetime formatting | `datetimeF(new Date())` → `"2024-01-15 10:30:00"` |
|
|
50
|
+
| `numF` | Number formatting | `numF(1234567)` → `"1,234,567"` |
|
|
51
|
+
| `hidden` | Conditional hidden class | `hidden(true)` → `"hidden"` |
|
|
52
|
+
| `arrayableToArray` | Convert to array | `arrayableToArray("a")` → `["a"]` |
|
|
53
53
|
|
|
54
54
|
### Configuration
|
|
55
55
|
|
|
56
|
-
| Item | Description
|
|
57
|
-
| ---------------- |
|
|
56
|
+
| Item | Description | Required |
|
|
57
|
+
| ---------------- | -------------------------------------------------- | ------------------------------------------ |
|
|
58
58
|
| `SonamuProvider` | Global configuration Provider (uploader, auth, SD) | Required (uploader required for FileInput) |
|
|
59
|
-
| `uploader` | File upload function
|
|
60
|
-
| `auth` | Authentication state and functions
|
|
61
|
-
| `SD` | Internationalization function
|
|
59
|
+
| `uploader` | File upload function | Required when using FileInput |
|
|
60
|
+
| `auth` | Authentication state and functions | Optional |
|
|
61
|
+
| `SD` | Internationalization function | Optional |
|
|
62
62
|
|
|
63
63
|
---
|
|
64
64
|
|
|
@@ -76,9 +76,7 @@ const user = await UserService.getUser("A", 123);
|
|
|
76
76
|
const { rows, total } = await UserService.getUsers("P", { num: 20, page: 1 });
|
|
77
77
|
|
|
78
78
|
// Save
|
|
79
|
-
const [userId] = await UserService.save([
|
|
80
|
-
{ email: "new@test.com", username: "newuser" },
|
|
81
|
-
]);
|
|
79
|
+
const [userId] = await UserService.save([{ email: "new@test.com", username: "newuser" }]);
|
|
82
80
|
|
|
83
81
|
// Delete
|
|
84
82
|
const count = await UserService.del([1, 2, 3]);
|
|
@@ -139,28 +137,22 @@ Type-safe form management based on Zod schemas (react-components v0.1.8+)
|
|
|
139
137
|
### Return Values
|
|
140
138
|
|
|
141
139
|
```typescript
|
|
142
|
-
const {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
submit,
|
|
147
|
-
addError,
|
|
148
|
-
removeError,
|
|
149
|
-
clearError,
|
|
150
|
-
reset,
|
|
151
|
-
} = useTypeForm(Schema, defaultValue);
|
|
140
|
+
const { form, setForm, register, submit, addError, removeError, clearError, reset } = useTypeForm(
|
|
141
|
+
Schema,
|
|
142
|
+
defaultValue,
|
|
143
|
+
);
|
|
152
144
|
```
|
|
153
145
|
|
|
154
|
-
| Return Value | Type | Description
|
|
155
|
-
| ------------- | --------------------------------------------------- |
|
|
156
|
-
| `form` | `z.infer<Schema>` | Current form data
|
|
157
|
-
| `setForm` | `React.Dispatch<SetStateAction<...>>` | Form state update function
|
|
158
|
-
| `register` | `(field: string) => RegisterReturn` | Field registration function
|
|
159
|
-
| `submit` | `(callback) => () => Promise<R>` | Submit handler factory
|
|
160
|
-
| `addError` | `(path: string, error: string \| ErrorObj) => void` | Manually add an error
|
|
161
|
-
| `removeError` | `(path: string) => void` | Remove error for a specific field
|
|
162
|
-
| `clearError` | `() => void` | Clear all errors
|
|
163
|
-
| `reset` | `() => void` | Reset form to defaultValue
|
|
146
|
+
| Return Value | Type | Description |
|
|
147
|
+
| ------------- | --------------------------------------------------- | --------------------------------- |
|
|
148
|
+
| `form` | `z.infer<Schema>` | Current form data |
|
|
149
|
+
| `setForm` | `React.Dispatch<SetStateAction<...>>` | Form state update function |
|
|
150
|
+
| `register` | `(field: string) => RegisterReturn` | Field registration function |
|
|
151
|
+
| `submit` | `(callback) => () => Promise<R>` | Submit handler factory |
|
|
152
|
+
| `addError` | `(path: string, error: string \| ErrorObj) => void` | Manually add an error |
|
|
153
|
+
| `removeError` | `(path: string) => void` | Remove error for a specific field |
|
|
154
|
+
| `clearError` | `() => void` | Clear all errors |
|
|
155
|
+
| `reset` | `() => void` | Reset form to defaultValue |
|
|
164
156
|
|
|
165
157
|
### register Return Object
|
|
166
158
|
|
|
@@ -197,9 +189,7 @@ function RegisterForm() {
|
|
|
197
189
|
return (
|
|
198
190
|
<form>
|
|
199
191
|
<Input {...emailProps} />
|
|
200
|
-
{emailProps.error &&
|
|
201
|
-
<span className="error">{emailProps.error.content}</span>
|
|
202
|
-
)}
|
|
192
|
+
{emailProps.error && <span className="error">{emailProps.error.content}</span>}
|
|
203
193
|
|
|
204
194
|
{/* Method 2: inline (for short cases) */}
|
|
205
195
|
<Input {...register("username")} />
|
|
@@ -258,14 +248,14 @@ import { Input, Checkbox, Select, Textarea } from "@sonamu-kit/react-components/
|
|
|
258
248
|
|
|
259
249
|
Fields defined as required in SaveParams **must be included** in the form initial values:
|
|
260
250
|
|
|
261
|
-
| Type | Initial Value
|
|
262
|
-
| ----------------- |
|
|
263
|
-
| string (required) | `""`
|
|
264
|
-
| number (required) | `0`
|
|
265
|
-
| Date (required) | `new Date()`
|
|
251
|
+
| Type | Initial Value |
|
|
252
|
+
| ----------------- | ------------------------------ |
|
|
253
|
+
| string (required) | `""` |
|
|
254
|
+
| number (required) | `0` |
|
|
255
|
+
| Date (required) | `new Date()` |
|
|
266
256
|
| enum (required) | Default value (e.g. `"draft"`) |
|
|
267
|
-
| FK (required) | `0`
|
|
268
|
-
| nullable | `null`
|
|
257
|
+
| FK (required) | `0` |
|
|
258
|
+
| nullable | `null` |
|
|
269
259
|
|
|
270
260
|
```typescript
|
|
271
261
|
const { form, setForm, register } = useTypeForm(TaskSaveParams, {
|
|
@@ -286,14 +276,7 @@ If a scaffolded form accesses relation objects like `row.collection?.id`, that r
|
|
|
286
276
|
|
|
287
277
|
```json
|
|
288
278
|
// question.entity.json > subsets > A
|
|
289
|
-
[
|
|
290
|
-
"id",
|
|
291
|
-
"content",
|
|
292
|
-
"collection.id",
|
|
293
|
-
"collection.title",
|
|
294
|
-
"parent.id",
|
|
295
|
-
"answer_group.id"
|
|
296
|
-
]
|
|
279
|
+
["id", "content", "collection.id", "collection.title", "parent.id", "answer_group.id"]
|
|
297
280
|
```
|
|
298
281
|
|
|
299
282
|
**Alternative**: If the FK is already on `row`, using `...row` alone is sufficient without accessing the relation (no subset modification needed)
|
|
@@ -542,11 +525,13 @@ function UserForm() {
|
|
|
542
525
|
```
|
|
543
526
|
|
|
544
527
|
**Notes**:
|
|
528
|
+
|
|
545
529
|
- You must explicitly reset lower values to `null` when a higher-level value changes. IdAsyncSelect does not reset automatically.
|
|
546
530
|
- Using the `disabled` prop to disable lower levels when the parent is not selected improves UX.
|
|
547
531
|
- If `baseListParams` is `undefined`, IdAsyncSelect stays in enabled=false state and does not fetch.
|
|
548
532
|
|
|
549
533
|
**Items to specify in Spec** (recommended to add to acceptanceCriteria in spec.json when cascade is present):
|
|
534
|
+
|
|
550
535
|
```json
|
|
551
536
|
"acceptanceCriteria": [
|
|
552
537
|
"When a department is selected, only divisions belonging to that department appear in the dropdown",
|
|
@@ -850,10 +835,7 @@ import { registerSSR } from "sonamu/ssr";
|
|
|
850
835
|
|
|
851
836
|
registerSSR({
|
|
852
837
|
path: "/companies/:companyId",
|
|
853
|
-
preload: (params) => [
|
|
854
|
-
UserService.me(),
|
|
855
|
-
CompanyService.findById("A", Number(params.companyId)),
|
|
856
|
-
],
|
|
838
|
+
preload: (params) => [UserService.me(), CompanyService.findById("A", Number(params.companyId))],
|
|
857
839
|
});
|
|
858
840
|
```
|
|
859
841
|
|