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,30 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import assert from "assert";
|
|
2
|
+
|
|
3
|
+
import { getLogger } from "@logtape/logtape";
|
|
4
|
+
import { type Logger } from "@logtape/logtape";
|
|
5
|
+
import { BackendPostgres, OpenWorkflow } from "@sonamu-kit/tasks";
|
|
6
|
+
import { type Worker } from "@sonamu-kit/tasks";
|
|
7
|
+
import { serializeRetryPolicy } from "@sonamu-kit/tasks/internal";
|
|
3
8
|
import {
|
|
4
9
|
type RunnableWorkflow,
|
|
5
10
|
type SchemaInput,
|
|
6
11
|
type SchemaOutput,
|
|
7
12
|
type StandardSchemaV1,
|
|
8
13
|
type StepApi,
|
|
9
|
-
serializeRetryPolicy,
|
|
10
14
|
type WorkflowRunHandle,
|
|
11
15
|
type WorkflowSpec,
|
|
12
16
|
} from "@sonamu-kit/tasks/internal";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import type
|
|
17
|
-
|
|
17
|
+
import { type Knex } from "knex";
|
|
18
|
+
import { schedule as cronSchedule } from "node-cron";
|
|
19
|
+
import { type ScheduledTask } from "node-cron";
|
|
20
|
+
import { type ZodObject } from "zod";
|
|
21
|
+
|
|
22
|
+
import { type Context } from "../api/context";
|
|
18
23
|
import { Sonamu } from "../api/sonamu";
|
|
19
24
|
import { convertDomainToCategory } from "../logger/category";
|
|
20
25
|
import { Naite } from "../naite/naite";
|
|
21
26
|
import { createMockSSEFactory } from "../stream/sse";
|
|
22
|
-
import type
|
|
23
|
-
import type
|
|
27
|
+
import { type Executable } from "../types/types";
|
|
28
|
+
import { type WorkflowMetadata } from "./decorator";
|
|
24
29
|
import { StepWrapper } from "./step-wrapper";
|
|
25
30
|
|
|
26
31
|
export interface WorkflowOptions {
|
|
27
|
-
// worker에서 동시 실행할 태스크 수, 기본은
|
|
32
|
+
// worker에서 동시 실행할 태스크 수, 기본은 1
|
|
28
33
|
concurrency?: number;
|
|
29
34
|
|
|
30
35
|
// worker에서 사용할 pub/sub 여부, 기본은 true
|
|
@@ -288,11 +293,9 @@ export class WorkflowManager {
|
|
|
288
293
|
headers: {},
|
|
289
294
|
createSSE: (schema: ZodObject) => createMockSSEFactory(schema),
|
|
290
295
|
naiteStore: Naite.createStore(),
|
|
296
|
+
locale: "",
|
|
291
297
|
user: null,
|
|
292
|
-
|
|
293
|
-
login: async () => {},
|
|
294
|
-
logout: () => {},
|
|
295
|
-
},
|
|
298
|
+
session: null,
|
|
296
299
|
} as unknown as Context;
|
|
297
300
|
|
|
298
301
|
const contextProvider = Sonamu.config.tasks?.contextProvider;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
|
+
|
|
2
3
|
import z from "zod";
|
|
4
|
+
|
|
3
5
|
import { SD } from "../dict/sd";
|
|
4
6
|
import { EntityManager } from "../entity/entity-manager";
|
|
5
7
|
import { ServiceUnavailableException } from "../exceptions/so-exceptions";
|
|
6
|
-
import type
|
|
8
|
+
import { type EntityPropNode, type RenderingNode } from "../types/types";
|
|
7
9
|
import { propToZodType, zodTypeToRenderingNode } from "./zod-converter";
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -23,7 +25,7 @@ export async function getColumnsNode(entityId: string, subsetKey: string): Promi
|
|
|
23
25
|
children: propNodes,
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
//
|
|
28
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- zod 스키마를 로드할 때 사용하는 타입
|
|
27
29
|
const columnsZodType = (await propNodeToZodType(rootPropNode)) as z.ZodObject<any>;
|
|
28
30
|
|
|
29
31
|
const columnsNode = zodTypeToRenderingNode(columnsZodType);
|
package/src/template/helpers.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import inflection from "inflection";
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
|
|
3
|
+
import { EntityManager } from "../entity/entity-manager";
|
|
4
|
+
import { type EntityNamesRecord } from "../entity/entity-manager";
|
|
5
|
+
import { isEnumProp, isRelationProp } from "../types/types";
|
|
6
|
+
import { type RelationProp } from "../types/types";
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* Enum의 표시용 라벨을 가져옵니다.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Sonamu } from "../../api";
|
|
2
|
-
import { EntityManager
|
|
3
|
-
import type
|
|
2
|
+
import { EntityManager } from "../../entity/entity-manager";
|
|
3
|
+
import { type EntityNamesRecord } from "../../entity/entity-manager";
|
|
4
|
+
import { type TemplateOptions } from "../../types/types";
|
|
4
5
|
import { Template } from "../template";
|
|
5
6
|
|
|
6
7
|
export class Template__entity extends Template {
|
|
@@ -64,15 +65,16 @@ export class Template__entity extends Template {
|
|
|
64
65
|
},
|
|
65
66
|
],
|
|
66
67
|
indexes: [...(options.indexes ?? [])],
|
|
67
|
-
subsets:
|
|
68
|
-
|
|
68
|
+
subsets:
|
|
69
|
+
options.subsets ??
|
|
70
|
+
(parentId
|
|
69
71
|
? {}
|
|
70
72
|
: {
|
|
71
73
|
A: ["id", "created_at"],
|
|
72
74
|
}),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
enums:
|
|
76
|
+
options.enums ??
|
|
77
|
+
(parentId
|
|
76
78
|
? {}
|
|
77
79
|
: {
|
|
78
80
|
[`${names.capital}OrderBy`]: {
|
|
@@ -80,7 +82,6 @@ export class Template__entity extends Template {
|
|
|
80
82
|
},
|
|
81
83
|
[`${names.capital}SearchField`]: { id: "ID" },
|
|
82
84
|
}),
|
|
83
|
-
},
|
|
84
85
|
}).trim(),
|
|
85
86
|
importKeys: [],
|
|
86
87
|
};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
|
+
|
|
2
3
|
import { unique } from "radashi";
|
|
4
|
+
|
|
3
5
|
import { Sonamu } from "../../api";
|
|
4
|
-
import type
|
|
6
|
+
import { type Entity } from "../../entity/entity";
|
|
5
7
|
import { EntityManager } from "../../entity/entity-manager";
|
|
6
8
|
import { Naite } from "../../naite/naite";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
type EntityPropNode,
|
|
10
|
-
isVirtualCodeProp,
|
|
11
|
-
isVirtualQueryProp,
|
|
12
|
-
} from "../../types/types";
|
|
9
|
+
import { isVirtualCodeProp, isVirtualQueryProp } from "../../types/types";
|
|
10
|
+
import { type EntityIndex, type EntityPropNode } from "../../types/types";
|
|
13
11
|
import { nonNullable } from "../../utils/utils";
|
|
14
12
|
import { Template } from "../template";
|
|
15
13
|
import { BUILT_IN_TYPES, propNodeToZodTypeDef, zodTypeToZodCode } from "../zod-converter";
|
|
@@ -69,7 +67,7 @@ export class Template__generated extends Template {
|
|
|
69
67
|
}
|
|
70
68
|
return {
|
|
71
69
|
lines: [...result.lines, `// ${ts.label}`, ...ts.lines, ""],
|
|
72
|
-
importKeys: unique([...result.importKeys, ...ts.importKeys].
|
|
70
|
+
importKeys: unique([...result.importKeys, ...ts.importKeys].toSorted()),
|
|
73
71
|
};
|
|
74
72
|
},
|
|
75
73
|
{
|
|
@@ -132,9 +130,7 @@ export class Template__generated extends Template {
|
|
|
132
130
|
" * @generated",
|
|
133
131
|
" * 직접 수정하지 마세요.",
|
|
134
132
|
" */",
|
|
135
|
-
"
|
|
136
|
-
"/** biome-ignore-all assist: generated는 무시 */",
|
|
137
|
-
"/** biome-ignore-all format: generated는 무시 */",
|
|
133
|
+
"/* oxlint-disable */",
|
|
138
134
|
"",
|
|
139
135
|
`import { z } from 'zod';`,
|
|
140
136
|
`import { ${sonamuImports.join(",")} } from "sonamu";`,
|
|
@@ -148,17 +144,15 @@ export class Template__generated extends Template {
|
|
|
148
144
|
}
|
|
149
145
|
return {
|
|
150
146
|
label: `Enums: ${entity.id}`,
|
|
151
|
-
lines:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
]),
|
|
161
|
-
],
|
|
147
|
+
lines: Object.entries(entity.enumLabels)
|
|
148
|
+
.filter(([_, enumLabel]) => Object.keys(enumLabel).length > 0)
|
|
149
|
+
.flatMap(([enumId, enumLabel]) => [
|
|
150
|
+
`export const ${enumId} = z.enum([${Object.keys(enumLabel).map(
|
|
151
|
+
(el) => `"${el}"`,
|
|
152
|
+
)}]).describe("${enumId}");`,
|
|
153
|
+
`export type ${enumId} = z.infer<typeof ${enumId}>;`,
|
|
154
|
+
`export const ${enumId}Label = ${JSON.stringify(enumLabel)};`,
|
|
155
|
+
]),
|
|
162
156
|
importKeys: [],
|
|
163
157
|
};
|
|
164
158
|
}
|
|
@@ -260,13 +254,11 @@ export class Template__generated extends Template {
|
|
|
260
254
|
.map((col) => `"${col}"`)
|
|
261
255
|
.join(", ")}],`
|
|
262
256
|
: "") +
|
|
263
|
-
(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
: ""
|
|
269
|
-
) +
|
|
257
|
+
(generatedColumns.length > 0
|
|
258
|
+
? `readonly __generated__: readonly [${generatedColumns
|
|
259
|
+
.map((col) => `"${col}"`)
|
|
260
|
+
.join(", ")}],`
|
|
261
|
+
: "") +
|
|
270
262
|
(hasVectorColumns.length > 0
|
|
271
263
|
? `readonly __vector__: readonly [${hasVectorColumns
|
|
272
264
|
.map((col) => `"${col}"`)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import qs from "qs";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
|
|
3
4
|
import { getZodObjectFromApi } from "../../api/code-converters";
|
|
4
|
-
import type
|
|
5
|
+
import { type ExtendedApi } from "../../api/decorators";
|
|
5
6
|
import { Sonamu } from "../../api/sonamu";
|
|
6
7
|
import { Template } from "../template";
|
|
7
8
|
|
|
@@ -66,7 +67,7 @@ export class Template__generated_http extends Template {
|
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
zodTypeToReqDefault(zodType: z.ZodType
|
|
70
|
+
zodTypeToReqDefault(zodType: z.ZodType, name: string): unknown {
|
|
70
71
|
if (zodType instanceof z.ZodObject) {
|
|
71
72
|
return Object.fromEntries(
|
|
72
73
|
Object.keys(zodType.shape).map((key) => [
|
|
@@ -103,16 +104,16 @@ export class Template__generated_http extends Template {
|
|
|
103
104
|
} else if (zodType instanceof z.ZodUnknown) {
|
|
104
105
|
return "unknown";
|
|
105
106
|
} else if (zodType instanceof z.ZodTuple) {
|
|
106
|
-
|
|
107
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- ZodTuple 타입 사용
|
|
107
108
|
return zodType.def.items.map((item: any) => this.zodTypeToReqDefault(item, name));
|
|
108
109
|
} else if (zodType instanceof z.ZodDate) {
|
|
109
110
|
return "2000-01-01";
|
|
110
111
|
} else if (zodType instanceof z.ZodLiteral) {
|
|
111
112
|
return zodType.value;
|
|
112
113
|
} else if (zodType instanceof z.ZodRecord || zodType instanceof z.ZodMap) {
|
|
113
|
-
//
|
|
114
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- ZodRecord 타입 사용
|
|
114
115
|
const kvDef = (zodType as z.ZodRecord<any, z.ZodType> | z.ZodMap<z.ZodType, z.ZodType>).def;
|
|
115
|
-
//
|
|
116
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- ZodIntersection 타입 사용
|
|
116
117
|
const key = this.zodTypeToReqDefault(kvDef.keyType, name) as any;
|
|
117
118
|
const value = this.zodTypeToReqDefault(kvDef.valueType, name);
|
|
118
119
|
return { [key]: value };
|
|
@@ -143,7 +144,9 @@ export class Template__generated_http extends Template {
|
|
|
143
144
|
return def;
|
|
144
145
|
} catch (error) {
|
|
145
146
|
console.error(error);
|
|
146
|
-
throw new Error(`Invalid zod type detected on ${api.modelName}:${api.methodName}
|
|
147
|
+
throw new Error(`Invalid zod type detected on ${api.modelName}:${api.methodName}`, {
|
|
148
|
+
cause: error,
|
|
149
|
+
});
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
|
+
|
|
2
3
|
import inflection from "inflection";
|
|
3
4
|
import { unique } from "radashi";
|
|
5
|
+
|
|
4
6
|
import { Sonamu } from "../../api";
|
|
5
|
-
import type
|
|
7
|
+
import { type Entity } from "../../entity/entity";
|
|
6
8
|
import { EntityManager } from "../../entity/entity-manager";
|
|
7
9
|
import {
|
|
8
10
|
isBelongsToOneRelationProp,
|
|
@@ -10,7 +12,7 @@ import {
|
|
|
10
12
|
isOneToOneRelationProp,
|
|
11
13
|
} from "../../types/types";
|
|
12
14
|
import { Template } from "../template";
|
|
13
|
-
import type
|
|
15
|
+
import { type SourceCode } from "./generated.template";
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* better-auth additionalFields의 type 값을 TypeScript 타입 문자열로 변환합니다.
|
|
@@ -291,7 +293,7 @@ export class Template__generated_sso extends Template {
|
|
|
291
293
|
return null;
|
|
292
294
|
}
|
|
293
295
|
|
|
294
|
-
//
|
|
296
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- additionalFields 타입이 동적임
|
|
295
297
|
const additionalFields = (authConfig as any)?.user?.additionalFields;
|
|
296
298
|
if (!additionalFields || Object.keys(additionalFields).length === 0) {
|
|
297
299
|
// additionalFields가 없으면 기본 User 타입만 사용
|
|
@@ -306,7 +308,7 @@ export class Template__generated_sso extends Template {
|
|
|
306
308
|
|
|
307
309
|
// additionalFields를 TypeScript 타입으로 변환
|
|
308
310
|
const fieldLines = Object.entries(additionalFields).map(([key, value]) => {
|
|
309
|
-
//
|
|
311
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- better-auth additionalFields 구조
|
|
310
312
|
const fieldConfig = value as any;
|
|
311
313
|
const isRequired = fieldConfig.required !== false;
|
|
312
314
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Sonamu } from "../../api";
|
|
2
|
-
import { EntityManager
|
|
3
|
-
import type
|
|
2
|
+
import { EntityManager } from "../../entity/entity-manager";
|
|
3
|
+
import { type EntityNamesRecord } from "../../entity/entity-manager";
|
|
4
|
+
import { type TemplateOptions } from "../../types/types";
|
|
4
5
|
import { Template } from "../template";
|
|
5
6
|
|
|
6
7
|
export class Template__init_types extends Template {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type z from "zod";
|
|
2
|
+
|
|
2
3
|
import { Sonamu } from "../../api";
|
|
3
|
-
import { EntityManager
|
|
4
|
+
import { EntityManager } from "../../entity/entity-manager";
|
|
5
|
+
import { type EntityNamesRecord } from "../../entity/entity-manager";
|
|
4
6
|
import { Naite } from "../../naite/naite";
|
|
5
|
-
import type
|
|
7
|
+
import { type TemplateOptions } from "../../types/types";
|
|
6
8
|
import { Template } from "../template";
|
|
7
9
|
import { getZodTypeById, zodTypeToRenderingNode } from "../zod-converter";
|
|
8
10
|
import { Template__view_list } from "./view_list.template";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Sonamu } from "../../api";
|
|
2
|
-
import { EntityManager
|
|
3
|
-
import type
|
|
2
|
+
import { EntityManager } from "../../entity/entity-manager";
|
|
3
|
+
import { type EntityNamesRecord } from "../../entity/entity-manager";
|
|
4
|
+
import { type TemplateOptions } from "../../types/types";
|
|
4
5
|
import { Template } from "../template";
|
|
5
6
|
|
|
6
7
|
export class Template__model_test extends Template {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import inflection from "inflection";
|
|
2
2
|
import { diff, unique } from "radashi";
|
|
3
|
+
|
|
3
4
|
import { apiParamToTsCode, apiParamTypeToTsType } from "../../api/code-converters";
|
|
4
|
-
import type
|
|
5
|
+
import { type ExtendedApi } from "../../api/decorators";
|
|
5
6
|
import { Sonamu } from "../../api/sonamu";
|
|
6
|
-
import type
|
|
7
|
+
import { type TemplateOptions } from "../../types/types";
|
|
7
8
|
import { ApiParamType } from "../../types/types";
|
|
8
9
|
import { Template } from "../template";
|
|
9
10
|
|
|
@@ -49,7 +50,7 @@ export class Template__queries extends Template {
|
|
|
49
50
|
(param) =>
|
|
50
51
|
!ApiParamType.isContext(param.type) &&
|
|
51
52
|
!ApiParamType.isRefKnex(param.type) &&
|
|
52
|
-
!(param.optional
|
|
53
|
+
!(param.optional && param.name.startsWith("_")),
|
|
53
54
|
);
|
|
54
55
|
|
|
55
56
|
// 타입 파라미터 이름 수집
|
|
@@ -105,8 +106,7 @@ ${functions.join("\n\n")}
|
|
|
105
106
|
" * @generated",
|
|
106
107
|
" * 직접 수정하지 마세요.",
|
|
107
108
|
" */",
|
|
108
|
-
"
|
|
109
|
-
"/** biome-ignore-all assist: generated는 무시 */",
|
|
109
|
+
"/* oxlint-disable */",
|
|
110
110
|
"",
|
|
111
111
|
`import type { SSRQuery } from 'sonamu/ssr';`,
|
|
112
112
|
"",
|
|
@@ -116,15 +116,7 @@ ${functions.join("\n\n")}
|
|
|
116
116
|
`}`,
|
|
117
117
|
"",
|
|
118
118
|
]
|
|
119
|
-
: [
|
|
120
|
-
"/**",
|
|
121
|
-
" * @generated",
|
|
122
|
-
" * 직접 수정하지 마세요.",
|
|
123
|
-
" */",
|
|
124
|
-
"/** biome-ignore-all lint: generated는 무시 */",
|
|
125
|
-
"/** biome-ignore-all assist: generated는 무시 */",
|
|
126
|
-
"",
|
|
127
|
-
],
|
|
119
|
+
: ["/**", " * @generated", " * 직접 수정하지 마세요.", " */", "/* oxlint-disable */", ""],
|
|
128
120
|
};
|
|
129
121
|
}
|
|
130
122
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
4
5
|
import { Sonamu } from "../../api/sonamu";
|
|
5
|
-
import { EntityManager
|
|
6
|
-
import type
|
|
6
|
+
import { EntityManager } from "../../entity/entity-manager";
|
|
7
|
+
import { type EntityNamesRecord } from "../../entity/entity-manager";
|
|
8
|
+
import { type TemplateOptions } from "../../types/types";
|
|
7
9
|
import { extractObjectDeclaration } from "../helpers";
|
|
8
10
|
import { Template } from "../template";
|
|
9
11
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import inflection from "inflection";
|
|
2
2
|
import { diff, unique } from "radashi";
|
|
3
|
+
|
|
3
4
|
import {
|
|
4
5
|
apiParamToTsCode,
|
|
5
6
|
apiParamTypeToTsType,
|
|
6
7
|
unwrapPromiseOnce,
|
|
7
8
|
} from "../../api/code-converters";
|
|
8
|
-
import type
|
|
9
|
+
import { type ExtendedApi } from "../../api/decorators";
|
|
9
10
|
import { Sonamu } from "../../api/sonamu";
|
|
10
11
|
import { EntityManager } from "../../entity/entity-manager";
|
|
11
|
-
import type
|
|
12
|
+
import { type TemplateOptions } from "../../types/types";
|
|
12
13
|
import { ApiParamType } from "../../types/types";
|
|
13
14
|
import { assertDefined } from "../../utils/utils";
|
|
14
15
|
import { Template } from "../template";
|
|
@@ -53,7 +54,7 @@ export class Template__services extends Template {
|
|
|
53
54
|
(param) =>
|
|
54
55
|
!ApiParamType.isContext(param.type) &&
|
|
55
56
|
!ApiParamType.isRefKnex(param.type) &&
|
|
56
|
-
!(param.optional
|
|
57
|
+
!(param.optional && param.name.startsWith("_")),
|
|
57
58
|
);
|
|
58
59
|
|
|
59
60
|
const apiBaseUrl = `${Sonamu.config.api.route.prefix}${api.path}`;
|
|
@@ -90,7 +91,7 @@ export function ${methodNameStreamCamelized}(
|
|
|
90
91
|
(param) =>
|
|
91
92
|
!ApiParamType.isContext(param.type) &&
|
|
92
93
|
!ApiParamType.isRefKnex(param.type) &&
|
|
93
|
-
!(param.optional
|
|
94
|
+
!(param.optional && param.name.startsWith("_")),
|
|
94
95
|
);
|
|
95
96
|
|
|
96
97
|
// 타입 파라미터 정의
|
|
@@ -253,11 +254,7 @@ export const use${hookName}Mutation = ${typeParamsDef}() => useMutation({
|
|
|
253
254
|
// paramsDef 예: "params: { category: string }" → "{ category: string }"
|
|
254
255
|
const paramsTypeDef =
|
|
255
256
|
paramsWithoutContext.length > 0
|
|
256
|
-
? paramsDef
|
|
257
|
-
.split(":")
|
|
258
|
-
.slice(1)
|
|
259
|
-
.join(":")
|
|
260
|
-
.trim() // "params: { category: string }" → "{ category: string }"
|
|
257
|
+
? paramsDef.split(":").slice(1).join(":").trim() // "params: { category: string }" → "{ category: string }"
|
|
261
258
|
: "";
|
|
262
259
|
|
|
263
260
|
const mutationParamType =
|
|
@@ -367,8 +364,7 @@ export const ${names.capital}AsyncIdConfig: AsyncIdConfig<${names.capital}Subset
|
|
|
367
364
|
" * @generated",
|
|
368
365
|
" * 직접 수정하지 마세요.",
|
|
369
366
|
" */",
|
|
370
|
-
"
|
|
371
|
-
"/** biome-ignore-all assist: generated는 무시 */",
|
|
367
|
+
"/* oxlint-disable */",
|
|
372
368
|
"",
|
|
373
369
|
`import { queryOptions, useQuery, useMutation, type UseMutationOptions } from '@tanstack/react-query';`,
|
|
374
370
|
`import type { AxiosProgressEvent } from 'axios';`,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { unique } from "radashi";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
import
|
|
3
|
+
|
|
4
|
+
import { EntityManager } from "../../entity/entity-manager";
|
|
5
|
+
import { type EntityNamesRecord } from "../../entity/entity-manager";
|
|
6
|
+
import { type RenderingNode, type TemplateOptions } from "../../types/types";
|
|
5
7
|
import {
|
|
6
8
|
getEnumInfoFromColName,
|
|
7
9
|
getRelationNameFromColumnName,
|
|
@@ -207,7 +209,7 @@ export class Template__view_form extends Template {
|
|
|
207
209
|
const { zodTypeToRenderingNode } = await import("../zod-converter");
|
|
208
210
|
const saveParamsNode = zodTypeToRenderingNode(SaveParamsZodType);
|
|
209
211
|
|
|
210
|
-
const columns = (
|
|
212
|
+
const columns = (saveParamsNode?.children ?? [])
|
|
211
213
|
.filter((col) => col.name !== "id")
|
|
212
214
|
.map((col) => {
|
|
213
215
|
const propCandidate = entity.props.find((prop) => prop.name === col.name);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { EntityManager
|
|
2
|
-
import type
|
|
1
|
+
import { EntityManager } from "../../entity/entity-manager";
|
|
2
|
+
import { type EntityNamesRecord } from "../../entity/entity-manager";
|
|
3
|
+
import { type TemplateOptions } from "../../types/types";
|
|
3
4
|
import { Template } from "../template";
|
|
4
5
|
|
|
5
6
|
export class Template__view_id_all_select extends Template {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import inflection from "inflection";
|
|
2
2
|
import { flat } from "radashi";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
import
|
|
4
|
+
|
|
5
|
+
import { EntityManager } from "../../entity/entity-manager";
|
|
6
|
+
import { type EntityNamesRecord } from "../../entity/entity-manager";
|
|
7
|
+
import { type RenderingNode, type TemplateOptions } from "../../types/types";
|
|
6
8
|
import {
|
|
7
9
|
getEnumInfoFromColName,
|
|
8
10
|
getRelationNameFromColumnName,
|
|
9
11
|
getRelationPropFromColName,
|
|
10
12
|
} from "../helpers";
|
|
11
|
-
import type
|
|
13
|
+
import { type RenderedTemplate } from "../template";
|
|
12
14
|
import { Template } from "../template";
|
|
13
15
|
|
|
14
16
|
export class Template__view_list extends Template {
|
|
@@ -266,7 +268,7 @@ export class Template__view_list extends Template {
|
|
|
266
268
|
// 실제 리스트 컬럼
|
|
267
269
|
const columns = (columnsNode.children as RenderingNode[])
|
|
268
270
|
|
|
269
|
-
.
|
|
271
|
+
.toSorted((a, b) => (a.name === "id" ? -1 : b.name === "id" ? 1 : 0))
|
|
270
272
|
.map((col) => {
|
|
271
273
|
const rendered = this.renderColumn(entityId, col, names);
|
|
272
274
|
|
|
@@ -305,7 +307,7 @@ export class Template__view_list extends Template {
|
|
|
305
307
|
["enums", "number-id", "number-fk_id", "string-fk_id"].includes(col.renderType),
|
|
306
308
|
)
|
|
307
309
|
// orderBy가 가장 뒤로 오게 순서 조정
|
|
308
|
-
.
|
|
310
|
+
.toSorted((a) => {
|
|
309
311
|
return a.name === "orderBy" ? 1 : -1;
|
|
310
312
|
});
|
|
311
313
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { EntityManager
|
|
2
|
-
import type
|
|
1
|
+
import { EntityManager } from "../../entity/entity-manager";
|
|
2
|
+
import { type EntityNamesRecord } from "../../entity/entity-manager";
|
|
3
|
+
import { type TemplateOptions } from "../../types/types";
|
|
3
4
|
import { Template } from "../template";
|
|
4
5
|
|
|
5
6
|
export class Template__view_search_input extends Template {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { type TemplateKey } from "../types/types";
|
|
3
4
|
import { globAsync } from "../utils/async-utils";
|
|
4
5
|
import { importMembers } from "../utils/esm-utils";
|
|
5
6
|
import { Template } from "./template";
|
|
@@ -91,7 +92,7 @@ class TemplateManagerClass {
|
|
|
91
92
|
register(template: Template): void {
|
|
92
93
|
this.templates.set(template.key, template);
|
|
93
94
|
// 하위 호환
|
|
94
|
-
Template._getTemplatesMap().set(template.key
|
|
95
|
+
Template._getTemplatesMap().set(template.key, template);
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
/**
|
|
@@ -131,7 +132,7 @@ class TemplateManagerClass {
|
|
|
131
132
|
* 모든 템플릿 키 목록
|
|
132
133
|
*/
|
|
133
134
|
getAllKeys(): string[] {
|
|
134
|
-
return Array.from(this.templates.keys()).
|
|
135
|
+
return Array.from(this.templates.keys()).toSorted();
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
/**
|
package/src/template/template.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
|
|
3
|
-
import
|
|
2
|
+
|
|
3
|
+
import { type EntityNamesRecord } from "../entity/entity-manager";
|
|
4
|
+
import { type TemplateKey, type TemplateOptions } from "../types/types";
|
|
4
5
|
import { globAsync } from "../utils/async-utils";
|
|
5
6
|
import { importMembers } from "../utils/esm-utils";
|
|
6
7
|
|
|
@@ -37,7 +38,7 @@ export abstract class Template {
|
|
|
37
38
|
);
|
|
38
39
|
|
|
39
40
|
for (const templateFile of templateFiles) {
|
|
40
|
-
//
|
|
41
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any -- importMembers의 반환 타입을 명시적으로 지정할 수 없음
|
|
41
42
|
const templates = await importMembers<any>(templateFile);
|
|
42
43
|
if (
|
|
43
44
|
templates.length === 1 &&
|